From dcf2e3265cdb43fb2f2cadc69b2e613650f4ec3d Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Sun, 12 May 2024 20:45:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientRegisterAppService.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 51d0f9e..5af69e0 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -1083,6 +1083,8 @@ namespace Shentun.Peis.PatientRegisters from ac in cc.DefaultIfEmpty() join d in await _registerCheckAsbitemRepository.GetQueryableAsync() on ac.Id equals d.RegisterCheckId into dd from ad in dd.DefaultIfEmpty() + join e in await _asbitemRepository.GetQueryableAsync() on ad.AsbitemId equals e.Id + where e.IsCheck == 'Y' select new { a, @@ -1324,6 +1326,8 @@ namespace Shentun.Peis.PatientRegisters from ac in cc.DefaultIfEmpty() join d in await _registerCheckAsbitemRepository.GetQueryableAsync() on ac.Id equals d.RegisterCheckId into dd from ad in dd.DefaultIfEmpty() + join e in await _asbitemRepository.GetQueryableAsync() on ad.AsbitemId equals e.Id + where e.IsCheck == 'Y' select new { a, @@ -1431,7 +1435,9 @@ namespace Shentun.Peis.PatientRegisters - if (input.CompleteFlag != null && input.CompleteFlag != PatientRegisterCompleteFlag.ItemCheckUnSumCheck) + if (input.CompleteFlag != null + && input.CompleteFlag != PatientRegisterCompleteFlag.ItemCheckUnSumCheck + && input.CompleteFlag != PatientRegisterCompleteFlag.PartCheck) { sumquery = sumquery.Where(m => m.a.CompleteFlag == input.CompleteFlag); } @@ -3026,13 +3032,16 @@ namespace Shentun.Peis.PatientRegisters public async Task GetPatientRegisterItemStatusAsync(Guid PatientRegisterId) { //未检组合项目 - var UnCheckedAsbitem = (await _registerCheckAsbitemRepository.GetDbSetAsync()) + var UnCheckedAsbitem = (await _registerCheckAsbitemRepository.GetQueryableAsync()) .Include(x => x.Asbitem) .Include(x => x.RegisterCheck) - .Where(m => m.PatientRegisterId == PatientRegisterId && m.RegisterCheck.CompleteFlag == RegisterCheckCompleteFlag.UnChecked).OrderBy(o => o.Asbitem.DisplayOrder).Select(s => s.Asbitem.DisplayName).ToList(); + .Where(m => m.PatientRegisterId == PatientRegisterId + && m.RegisterCheck.CompleteFlag == RegisterCheckCompleteFlag.UnChecked + && m.Asbitem.IsCheck == 'Y') + .OrderBy(o => o.Asbitem.DisplayOrder).Select(s => s.Asbitem.DisplayName).ToList(); //弃检检组合项目 - var GiveUpAsbitem = (await _registerCheckAsbitemRepository.GetDbSetAsync()) + var GiveUpAsbitem = (await _registerCheckAsbitemRepository.GetQueryableAsync()) .Include(x => x.Asbitem) .Include(x => x.RegisterCheck) .Where(m => m.PatientRegisterId == PatientRegisterId && m.RegisterCheck.CompleteFlag == RegisterCheckCompleteFlag.GiveUpChecked).OrderBy(o => o.Asbitem.DisplayOrder).Select(s => s.Asbitem.DisplayName).ToList(); From 4175603baadfac8076e75cedf1d0821ba96161ed Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Sun, 12 May 2024 23:24:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BD=93=E6=A3=80=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientRegisters/GetListInSearchDto.cs | 7 +++++- .../PatientRegisterAppService.cs | 23 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs index 11bd572..adc9318 100644 --- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs @@ -55,6 +55,11 @@ namespace Shentun.Peis.PatientRegisters /// public string? EndDate { get; set; } + /// + /// 日期类型(1、登记日期 2、体检日期 ) 默认登记日期 + /// + public char DateType { get; set; } = '1'; + /// /// 完成状态 /// @@ -75,7 +80,7 @@ namespace Shentun.Peis.PatientRegisters public int MaxResultCount { get; set; } = 50; public int SkipCount { get; set; } = 0; - + } } diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 5af69e0..5d49cd0 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -447,9 +447,26 @@ namespace Shentun.Peis.PatientRegisters entlist = entlist.Where(m => m.patientRegister.SexId == input.SexId); if (!string.IsNullOrEmpty(input.StartDate) && !string.IsNullOrEmpty(input.EndDate)) - entlist = entlist.Where(m => m.patientRegister.CreationTime >= Convert.ToDateTime(input.StartDate) && - m.patientRegister.CreationTime < Convert.ToDateTime(input.EndDate).AddDays(1)); - + { + if (input.DateType == '1') + { + entlist = entlist.Where(m => m.patientRegister.CreationTime >= Convert.ToDateTime(input.StartDate) && + m.patientRegister.CreationTime < Convert.ToDateTime(input.EndDate).AddDays(1)); + } + else if (input.DateType == '2') + { + entlist = entlist.Where(m => m.patientRegister.MedicalStartDate >= Convert.ToDateTime(input.StartDate) && + m.patientRegister.MedicalStartDate < Convert.ToDateTime(input.EndDate).AddDays(1)); + } + else + { + entlist = entlist.Where(m => (m.patientRegister.CreationTime >= Convert.ToDateTime(input.StartDate) && + m.patientRegister.CreationTime < Convert.ToDateTime(input.EndDate).AddDays(1)) + || (m.patientRegister.MedicalStartDate >= Convert.ToDateTime(input.StartDate) && + m.patientRegister.MedicalStartDate < Convert.ToDateTime(input.EndDate).AddDays(1)) + ); + } + } if (input.CompleteFlag != null) { entlist = entlist.Where(m => m.patientRegister.CompleteFlag == input.CompleteFlag);