From 9024a961c83f3ca6b0612caa8498d8b326070438 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Thu, 10 Oct 2024 11:51:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=90=88=E7=BB=93=E6=9E=9C=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8A=A0=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...etAsbitemSpecificResultReportRequestDto.cs | 5 +++++ .../CustomerReportAppService.cs | 20 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetAsbitemSpecificResultReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetAsbitemSpecificResultReportRequestDto.cs index 834e182..219968f 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerReports/GetAsbitemSpecificResultReportRequestDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerReports/GetAsbitemSpecificResultReportRequestDto.cs @@ -18,5 +18,10 @@ namespace Shentun.Peis.CustomerReports /// [Required(ErrorMessage ="组合项目不能为空")] public List AsbitemId { get; set; } + + /// + /// 项目完成标志 0(为未检), 1(已检), 2(弃检) + /// + public char? CompleteFlag { get; set; } } } diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs index 6ce39dd..4626cf3 100644 --- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs +++ b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs @@ -1283,12 +1283,22 @@ namespace Shentun.Peis.CustomerReports public async Task> GetAsbitemSpecificResultReportAsync(GetAsbitemSpecificResultReportRequestDto input) { + //var query = from a in await _patientRegisterRepository.GetQueryableAsync() + // join b in await _patientRepository.GetQueryableAsync() on a.PatientId equals b.Id into bb + // from ab in bb.DefaultIfEmpty() + // join d in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals d.PatientRegisterId + // join e in await _asbitemRepository.GetQueryableAsync() on d.AsbitemId equals e.Id + // join c in await _registerCheckRepository.GetQueryableAsync() on d.RegisterCheckId equals c.Id + // join g in await _sexRepository.GetQueryableAsync() on a.SexId equals g.Id into gg + // from ag in gg.DefaultIfEmpty() + // select new { a, ab, c, d, ag, e }; + var query = from a in await _patientRegisterRepository.GetQueryableAsync() join b in await _patientRepository.GetQueryableAsync() on a.PatientId equals b.Id into bb from ab in bb.DefaultIfEmpty() - join d in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals d.PatientRegisterId + join c in await _registerCheckRepository.GetQueryableAsync() on a.Id equals c.PatientRegisterId + join d in await _registerAsbitemRepository.GetQueryableAsync() on c.Id equals d.RegisterCheckId join e in await _asbitemRepository.GetQueryableAsync() on d.AsbitemId equals e.Id - join c in await _registerCheckRepository.GetQueryableAsync() on d.RegisterCheckId equals c.Id join g in await _sexRepository.GetQueryableAsync() on a.SexId equals g.Id into gg from ag in gg.DefaultIfEmpty() select new { a, ab, c, d, ag, e }; @@ -1314,7 +1324,7 @@ namespace Shentun.Peis.CustomerReports var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); } - if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) + if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) { if (item.DateType == '1') { @@ -1388,6 +1398,10 @@ namespace Shentun.Peis.CustomerReports sumquery = sumquery.Where(m => input.AsbitemId.Contains(m.d.AsbitemId)); + if (input.CompleteFlag != null) + { + sumquery = sumquery.Where(m => m.c.CompleteFlag == input.CompleteFlag); + } if (sumquery.Any()) {