From 5dc3d3560765ece3aa4995f63bff64d01a7329c6 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Thu, 30 May 2024 23:01:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...erOrgFeeSettlementInGroupReportReduceDto.cs | 10 ++++++++++
.../GetItemTypeWorkLoadInStandardRequestDto.cs | 6 ++++++
.../GetPatientRegisterReportRequestDto.cs | 2 +-
.../CustomerReportAppService.cs | 10 +++++++---
.../InternalReportAppService.cs | 18 ++++++++++++------
.../PeisReports/PeisReportAppService.cs | 4 ++--
6 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetCustomerOrgFeeSettlementInGroupReportReduceDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetCustomerOrgFeeSettlementInGroupReportReduceDto.cs
index 18fae110..5931753c 100644
--- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetCustomerOrgFeeSettlementInGroupReportReduceDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetCustomerOrgFeeSettlementInGroupReportReduceDto.cs
@@ -62,5 +62,15 @@ namespace Shentun.Peis.CustomerReports
/// 总金额=(价格*数量)sum)
///
public string SumPrice { get; set; }
+
+ ///
+ /// 标准价格
+ ///
+ public string StandardPrice { get; set; }
+
+ ///
+ /// 标准金额
+ ///
+ public string StandardMoney { get; set; }
}
}
diff --git a/src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs b/src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs
index d70892e6..aae1e7c8 100644
--- a/src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/InternalReports/GetItemTypeWorkLoadInStandardRequestDto.cs
@@ -11,6 +11,12 @@ namespace Shentun.Peis.InternalReports
///
public List ItemTypeId { get; set; }
+
+ ///
+ /// 体检类别
+ ///
+ public List MedicalTypeIds { get; set; } = new List();
+
///
/// 开始检查日期
///
diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
index 2dcc024c..4ccb6254 100644
--- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
@@ -56,7 +56,7 @@ namespace Shentun.Peis.PeisReports
///
/// 体检类别
///
- public Guid? MedicalTypeId { get; set; }
+ public List MedicalTypeIds { get; set; } = new List();
///
/// 人员类别
diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
index 4df0095b..b22ddc65 100644
--- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
+++ b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
@@ -1863,12 +1863,14 @@ 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 GetCustomerOrgFeeSettlementInGroupReportReduce_AddItem
+ var addItems = query_addItem.ToList().GroupBy(g => g.a.AsbitemId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportReduce_AddItem
{
AsbitemName = s.FirstOrDefault().ab != null ? s.FirstOrDefault().ab.DisplayName : "",
PatientCount = s.Count(),
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount), 2).ToString(),
- Price = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString()
+ Price = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString(),
+ StandardPrice = Math.Round(s.Sum(ss => ss.a.StandardPrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString(),
+ StandardMoney = Math.Round(s.Sum(ss => ss.a.StandardPrice * ss.a.Amount), 2).ToString()
}).ToList();
var entdto = new GetCustomerOrgFeeSettlementInGroupReportReduceDto
@@ -1952,7 +1954,7 @@ namespace Shentun.Peis.CustomerReports
sumquery = sumquery.Where(m => m.a.CompleteFlag == PatientRegisterCompleteFlag.PartCheck || m.a.CompleteFlag == PatientRegisterCompleteFlag.SumCheck);
}
-
+
// 分组数据
var groupDetails = sumquery.ToList().GroupBy(g => g.a.CustomerOrgGroupId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_GroupDetail
{
@@ -1996,6 +1998,8 @@ namespace Shentun.Peis.CustomerReports
PatientCount = s.Count(),
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount), 2).ToString(),
Price = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString(),
+ StandardPrice = Math.Round(s.Sum(ss => ss.a.StandardPrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString(),
+ StandardMoney = Math.Round(s.Sum(ss => ss.a.StandardPrice * ss.a.Amount), 2).ToString(),
Patients = s.Select(sa => new GetCustomerOrgFeeSettlementInGroupReportDetail_Patient
{
Age = sa.ac != null ? sa.ac.Age : null,
diff --git a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
index 33c3af4d..e6f9f32f 100644
--- a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
+++ b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
using NUglify.Helpers;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
@@ -148,7 +149,7 @@ namespace Shentun.Peis.InternalReports
var query = (from a in await _patientRegisterRepository.GetQueryableAsync()
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb
from ab in bb.DefaultIfEmpty()
- where (a.SummaryDoctorId!=null) && a.SummaryDate != null && a.SummaryDate.Value >= Convert.ToDateTime(input.StartDate) &&
+ where (a.SummaryDoctorId != null) && a.SummaryDate != null && a.SummaryDate.Value >= Convert.ToDateTime(input.StartDate) &&
a.SummaryDate < Convert.ToDateTime(input.EndDate).AddDays(1)
select new
{
@@ -187,7 +188,7 @@ namespace Shentun.Peis.InternalReports
var query = (from a in await _patientRegisterRepository.GetQueryableAsync()
join b in await _userRepository.GetQueryableAsync() on a.SummaryDoctorId equals b.Id into bb
from ab in bb.DefaultIfEmpty()
- where (a.AuditDoctorId!=null) && a.AuditDate != null && a.AuditDate.Value >= Convert.ToDateTime(input.StartDate) &&
+ where (a.AuditDoctorId != null) && a.AuditDate != null && a.AuditDate.Value >= Convert.ToDateTime(input.StartDate) &&
a.AuditDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1)
select new
{
@@ -228,9 +229,9 @@ namespace Shentun.Peis.InternalReports
var qeruy = from a in await _registerAsbitemRepository.GetQueryableAsync()
join b in await _asbitemRepository.GetQueryableAsync() on a.AsbitemId equals b.Id
join c in await _itemTypeRepository.GetQueryableAsync() on b.ItemTypeId equals c.Id
- join d in await _registerCheckRepository.GetQueryableAsync() on a.RegisterCheckId equals d.Id into dd
- from ad in dd.DefaultIfEmpty()
- where (!string.IsNullOrEmpty(ad.CheckDoctorId) && ad.CheckDate != null)
+ join d in await _registerCheckRepository.GetQueryableAsync() on a.RegisterCheckId equals d.Id
+ join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on d.PatientRegisterId equals patientRegister.Id
+ where (!string.IsNullOrEmpty(d.CheckDoctorId) && d.CheckDate != null)
select new
{
a.AsbitemId,
@@ -240,7 +241,8 @@ namespace Shentun.Peis.InternalReports
AsbitemName = b.DisplayName,
ItemTypeId = b.ItemTypeId,
ItemTypeName = c.DisplayName,
- ad.CheckDate
+ d.CheckDate,
+ MedicalTypeId = patientRegister.MedicalTypeId
};
if (input.ItemTypeId.Any())
@@ -253,6 +255,10 @@ namespace Shentun.Peis.InternalReports
qeruy = qeruy.Where(m => m.CheckDate.Value >= Convert.ToDateTime(input.StartDate) &&
m.CheckDate.Value < Convert.ToDateTime(input.EndDate).AddDays(1));
}
+ if (input.MedicalTypeIds.Any())
+ {
+ qeruy = qeruy.Where(m => m.MedicalTypeId != null && input.MedicalTypeIds.Contains(m.MedicalTypeId.Value));
+ }
var entlist = qeruy.GroupBy(g => new { g.ItemTypeId, g.AsbitemId })
.Select(s => new GetItemTypeWorkLoadInStandardDto
diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
index 92bfe188..f01c04a4 100644
--- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
+++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs
@@ -271,9 +271,9 @@ namespace Shentun.Peis.PeisReports
}
}
- if (input.MedicalTypeId != null)
+ if (input.MedicalTypeIds.Any())
{
- sumquery = sumquery.Where(m => m.a.MedicalTypeId == input.MedicalTypeId);
+ sumquery = sumquery.Where(m => m.a.MedicalTypeId != null && input.MedicalTypeIds.Contains(m.a.MedicalTypeId.Value));
}
if (input.PersonnelTypeId != null)