diff --git a/SimpleAdmin.Application/Services/Prescription/PrescriptionService.cs b/SimpleAdmin.Application/Services/Prescription/PrescriptionService.cs index 310771a..5006675 100644 --- a/SimpleAdmin.Application/Services/Prescription/PrescriptionService.cs +++ b/SimpleAdmin.Application/Services/Prescription/PrescriptionService.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; +using NewLife.Reflection; using SimpleAdmin.Application.Entity; using SimpleAdmin.Application.Services.Prescription; using Yitter.IdGenerator; @@ -103,7 +104,15 @@ public class PrescriptionService : DbRepository, IPrescriptionServ } } } - + foreach (var item in prescriptionPage.List) + { + //家属成本多十个点 + if (item.PersonType== PersonType.Relative) + { + // 四舍五入规则 + item.TotalMedicineCost = Math.Round(item.TotalMedicineCost * (decimal)1.1, 2, MidpointRounding.AwayFromZero); + } + } return prescriptionPage; } catch (Exception ex) @@ -171,8 +180,7 @@ public class PrescriptionService : DbRepository, IPrescriptionServ remainingToCalculate = 0; } } - - return totalCost; + return Math.Round(totalCost, 2, MidpointRounding.AwayFromZero); } @@ -299,7 +307,6 @@ public class PrescriptionService : DbRepository, IPrescriptionServ } else if (!string.IsNullOrWhiteSpace(input.Person.EmployeeName)) { - // 兼容:即便没有显式 EmployeeIsTemp,前端传了 EmployeeName,我们也可以选择创建员工 var newEmp = new Person { Id = YitIdHelper.NextId(), @@ -440,7 +447,6 @@ public class PrescriptionService : DbRepository, IPrescriptionServ DiagnosisResult = input.DiagnosisResult, UserMedicinaAdvice = input.UserMedicinaAdvice, VisitDate = input.VisitDate ?? DateTime.Now, - CreateTime = DateTime.Now // 新增时设置创建时间 }; await Context.Insertable(prescription).ExecuteCommandAsync(); input.Id = prescripId;