Browse Source

单位查询

bjmzak
wxd 2 years ago
parent
commit
26b52c5bfc
  1. 9
      src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs

9
src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs

@ -33,7 +33,7 @@ namespace Shentun.Peis.CustomerReports
/// 客户报表
/// </summary>
[ApiExplorerSettings(GroupName = "Work")]
//[Authorize]
[Authorize]
public class CustomerReportAppService : ApplicationService
{
private readonly IRepository<Patient, Guid> _patientRepository;
@ -1952,8 +1952,9 @@ namespace Shentun.Peis.CustomerReports
sumquery = sumquery.Where(m => m.a.CompleteFlag == PatientRegisterCompleteFlag.PartCheck || m.a.CompleteFlag == PatientRegisterCompleteFlag.SumCheck);
}
// 分组数据
var groupDetails = sumquery.GroupBy(g => g.a.CustomerOrgGroupId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_GroupDetail
var groupDetails = sumquery.ToList().GroupBy(g => g.a.CustomerOrgGroupId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_GroupDetail
{
CustomerOrgGroupName = s.FirstOrDefault().ac != null ? s.FirstOrDefault().ac.DisplayName : "",
CustomerOrgGroupPrice = s.FirstOrDefault().ac != null ? Math.Round(s.FirstOrDefault().ac.Price, 2).ToString() : "0",
@ -1989,7 +1990,7 @@ namespace Shentun.Peis.CustomerReports
query_addItem = query_addItem.Where(m => m.a.PayTypeFlag == PayTypeFlag.OrgPay);
}
var addItems = query_addItem.GroupBy(g => g.a.AsbitemId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_AddItem
var addItems = query_addItem.ToList().GroupBy(g => g.a.AsbitemId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_AddItem
{
AsbitemName = s.FirstOrDefault().ab != null ? s.FirstOrDefault().ab.DisplayName : "",
PatientCount = s.Count(),
@ -2115,7 +2116,7 @@ namespace Shentun.Peis.CustomerReports
ChargeAmount = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount), 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.Amount), 2).ToString(),
ItmeTypeName = s.FirstOrDefault().ae.DisplayName,
Discount = ((int)Math.Ceiling(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.StandardPrice * v.c.Amount))).ToString()
Discount = s.Sum(v => v.c.StandardPrice * v.c.Amount) == 0 ? "0" : ((int)Math.Ceiling(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.StandardPrice * v.c.Amount))).ToString()
}).ToList();
//v.a.ChargePrice.Value* v.a.Amount.Value

Loading…
Cancel
Save