diff --git a/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs b/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs index f1937ae8..c1a7087a 100644 --- a/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs +++ b/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using Shentun.Peis.Enums; using Shentun.Peis.Models; using System; using System.Collections.Generic; @@ -78,7 +79,7 @@ namespace Shentun.Peis.ChargeAsbitems RegisterAsbitemChargePrice = ad != null ? ad.ChargePrice : 0, RegisterAsbitemCreationTime = ad != null ? ad.CreationTime : dtnull, RegisterAsbitemCreatorName = af != null ? af.UserName : "", - RegisterAsbitemPayTypeFlag = ad != null ? ad.PayTypeFlag : "", + RegisterAsbitemPayTypeFlag = ad != null ? ad.PayTypeFlag : PayTypeFlag.PersonPay, RegisterCheckCompleteFlag = ae != null ? ae.CompleteFlag : charnull, }; @@ -90,7 +91,7 @@ namespace Shentun.Peis.ChargeAsbitems ChargeId = s.a.ChargeId, AsbitemId = s.a.AsbitemId, AsbitemName = s.a.Asbitem.DisplayName, - AsbitemPrice = s.AsbitemPrice.Value, + AsbitemPrice = s.AsbitemPrice, CreationTime = s.a.CreationTime, CreatorId = s.a.CreatorId, CreatorName = s.CreatorName, @@ -99,7 +100,7 @@ namespace Shentun.Peis.ChargeAsbitems LastModifierId = s.a.LastModifierId, LastModifierName = s.LastModifierName, RegisterAsbitemId = s.a.RegisterAsbitemId, - RegisterAsbitemChargePrice = s.RegisterAsbitemChargePrice.Value, + RegisterAsbitemChargePrice = s.RegisterAsbitemChargePrice, RegisterAsbitemCreationTime = s.RegisterAsbitemCreationTime != null ? s.RegisterAsbitemCreationTime.Value.ToString("dd/MM/yyyy") : "", RegisterAsbitemCreatorName = s.RegisterAsbitemCreatorName, RegisterAsbitemPayTypeFlag = s.RegisterAsbitemPayTypeFlag, diff --git a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs index b530265b..e95011fc 100644 --- a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs +++ b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs @@ -125,10 +125,10 @@ namespace Shentun.Peis.InternalReports AsbitemName = s.FirstOrDefault().AsbitemName, CheckCount = s.Count(), DoctorName = s.FirstOrDefault().DoctorName, - AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice.Value), 2), - AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice.Value), 2), - SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2), - SumStandardPrice = Math.Round(s.Sum(v => v.a.StandardPrice.Value * v.a.Amount.Value), 2) + AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice), 2), + AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice), 2), + SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount), 2), + SumStandardPrice = Math.Round(s.Sum(v => v.a.StandardPrice * v.a.Amount), 2) }).ToList(); @@ -260,10 +260,10 @@ namespace Shentun.Peis.InternalReports AsbitemName = s.First().AsbitemName, AsbitemCount = s.Count(), ItemTypeName = s.First().ItemTypeName, - AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2), - AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2), - SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2), - SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2) + AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2), + AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2), + SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2), + SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2) }).ToList(); return entlist; @@ -326,10 +326,10 @@ namespace Shentun.Peis.InternalReports ItemTypeName = s.First().ItemTypeName, CustomerName = s.First().CustomerName, DoctorName = s.First().DoctorName, - AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2), - AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2), - SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2), - SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2) + AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2), + AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2), + SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2), + SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2) }).ToList(); return entlist; @@ -385,10 +385,10 @@ namespace Shentun.Peis.InternalReports DoctorCheckCount = s.Count(), ItemTypeName = s.First().ItemTypeName, CustomerName = s.First().CustomerName, - AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2), - AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2), - SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2), - SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2) + AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2), + AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2), + SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2), + SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2) }).ToList(); return entlist; @@ -431,18 +431,18 @@ namespace Shentun.Peis.InternalReports .Select(s => new GetPeisWorkLoadReportDto { AsbitemName = s.FirstOrDefault().AsbitemName, - PersonCount = s.Sum(v => v.a.Amount).Value, + PersonCount = s.Sum(v => v.a.Amount), RegisterName = s.FirstOrDefault().RegisterName, - StandardPrice = Math.Round(s.FirstOrDefault().a.StandardPrice.Value, 2).ToString(), - StandardAmount = Math.Round(s.Sum(v => v.a.StandardPrice.Value * v.a.Amount.Value), 2).ToString(), - ChargeAmount = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(), - ChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value) / s.Sum(v => v.a.Amount).Value, 2).ToString(), - PersonAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(), - UnitAmount = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value) - - (s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value)), 2).ToString(), - PersonPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(), - PersonUnPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value) - - (s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value)), 2).ToString() + StandardPrice = Math.Round(s.FirstOrDefault().a.StandardPrice, 2).ToString(), + StandardAmount = Math.Round(s.Sum(v => v.a.StandardPrice * v.a.Amount), 2).ToString(), + ChargeAmount = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(), + ChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount) / s.Sum(v => v.a.Amount), 2).ToString(), + PersonAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(), + UnitAmount = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount) - + (s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount)), 2).ToString(), + PersonPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(), + PersonUnPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount) + - (s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice * v.a.Amount)), 2).ToString() }).ToList();