From 1002a932353bf5e65bd5859ced53c59435f32fa3 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Tue, 18 Nov 2025 11:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChargeBackPays/ChargeBackPayDto.cs | 4 +++ .../PatientRegisterNoInputDto.cs | 5 +++ .../GetPatientRegisterReportDto.cs | 13 +++++++- .../GetPatientRegisterReportRequestDto.cs | 2 +- .../ChargeBackPays/ChargeBackPayAppService.cs | 31 ++++++++++++------- .../PatientRegisterAppService.cs | 16 +++++++++- .../PeisReports/PeisReportAppService.cs | 18 +++++++++-- 7 files changed, 72 insertions(+), 17 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs b/src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs index 799b5e6..b5a8169 100644 --- a/src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs +++ b/src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs @@ -32,5 +32,9 @@ namespace Shentun.Peis.ChargeBackPays /// 会员卡ID /// public Guid? CardRegisterId { get; set; } + /// + /// 会员卡号 + /// + public string CardNo { get; set; } } } diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs index e0d4474..43b762f 100644 --- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs @@ -13,5 +13,10 @@ namespace Shentun.Peis.PatientRegisters /// 档案号 /// public string PatientNo { get; set; } + + /// + /// 身份证 + /// + public string IdNo { get; set; } } } diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs index ecfa781..26a786d 100644 --- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs @@ -164,6 +164,17 @@ namespace Shentun.Peis.PeisReports public string SummaryDate { get; set; } - + + /// + /// 审核医生 + /// + public string AuditDoctorName { get; set; } + /// + /// 审核日期 + /// + public string AuditDate { get; set; } + + + } } diff --git a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs index 3c9c6ca..42d75b7 100644 --- a/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs @@ -98,7 +98,7 @@ namespace Shentun.Peis.PeisReports public List CustomerOrgGroupId { get; set; } = new List(); /// - /// 日期类型(1、登记日期 2、体检日期 3、总检日期 4、项目检查日期) + /// 日期类型(1、登记日期 2、体检日期 3、总检日期 4、项目检查日期 5.人员审核日期) /// [Required(ErrorMessage = "日期类型不能为空")] public char DateType { get; set; } diff --git a/src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs b/src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs index 3193cca..9360bb4 100644 --- a/src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs +++ b/src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Shentun.Peis.ChargeAsbitems; using Shentun.Peis.ChargePays; +using Shentun.Peis.IncludeDetails; using Shentun.Peis.Models; using System; using System.Collections.Generic; @@ -24,14 +25,16 @@ namespace Shentun.Peis.ChargeBackPays { private readonly IRepository _chargeBackPayRepository; private readonly IRepository _cardBillRepository; + private readonly IRepository _cardRegisterRepository; public ChargeBackPayAppService( IRepository chargeBackPayRepository, - IRepository cardBillRepository - ) + IRepository cardBillRepository, + IRepository cardRegisterRepository) { this._chargeBackPayRepository = chargeBackPayRepository; this._cardBillRepository = cardBillRepository; + _cardRegisterRepository = cardRegisterRepository; } /// @@ -44,17 +47,20 @@ namespace Shentun.Peis.ChargeBackPays { Guid? guidNull = null; - var chargeBackPayList = from a in (await _chargeBackPayRepository.GetQueryableAsync()) - join b in (await _cardBillRepository.GetQueryableAsync()) on a.CardBillId equals b.Id into bb - from ab in bb.DefaultIfEmpty() - where a.ChargeBackId == ChargeBackId + var chargeBackPayList = from chargeBackPay in await _chargeBackPayRepository.GetQueryableAsync() + join cardBill in await _cardBillRepository.GetQueryableAsync() on chargeBackPay.CardBillId equals cardBill.Id into cardBillTemp + from cardBillEmpty in cardBillTemp.DefaultIfEmpty() + join cardRegister in await _cardRegisterRepository.GetQueryableAsync() on cardBillEmpty.CardRegisterId equals cardRegister.Id into cardRegisterTemp + from cardRegisterEmpty in cardRegisterTemp.DefaultIfEmpty() + where chargeBackPay.ChargeBackId == ChargeBackId select new { - ChargeBackId = a.ChargeBackId, - CardBillId = a.CardBillId, - BackMoeny = a.BackMoeny, - PayModeId = a.PayModeId, - CardRegisterId = ab != null ? ab.CardRegisterId : guidNull, + ChargeBackId = chargeBackPay.ChargeBackId, + CardBillId = chargeBackPay.CardBillId, + BackMoeny = chargeBackPay.BackMoeny, + PayModeId = chargeBackPay.PayModeId, + CardRegisterId = cardBillEmpty != null ? cardBillEmpty.CardRegisterId : guidNull, + CardNo = cardRegisterEmpty.CardNo }; var entlistdto = chargeBackPayList.Select(s => new ChargeBackPayDto @@ -63,7 +69,8 @@ namespace Shentun.Peis.ChargeBackPays ChargeBackId = s.ChargeBackId, CardBillId = s.CardBillId, PayModeId = s.PayModeId, - CardRegisterId = s.CardRegisterId + CardRegisterId = s.CardRegisterId, + CardNo = s.CardNo }).ToList(); return entlistdto; diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 60c9c7f..c9bbbbd 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -984,10 +984,24 @@ namespace Shentun.Peis.PatientRegisters } ent = patientRegisterList.First(); } + else if (!string.IsNullOrWhiteSpace(input.IdNo)) + { + patientRegisterList = query.Where(m => m.Patient.IdNo == input.IdNo).OrderByDescending(o => o.MedicalTimes).ToList(); + if (patientRegisterList.Count == 0) + { + throw new UserFriendlyException("未找到人员信息"); + } + patientRegisterList = patientRegisterList.Where(m => m.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration).ToList(); + if (patientRegisterList.Count == 0) + { + throw new UserFriendlyException("该人未正式登记"); + } + ent = patientRegisterList.First(); + } else { - throw new UserFriendlyException("人员登记号和档案号至少有一个"); + throw new UserFriendlyException("检索条件不能为空"); } if (ent.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration) { diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs index def6583..23e53c7 100644 --- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs +++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs @@ -117,7 +117,9 @@ namespace Shentun.Peis.PeisReports a.MaritalStatusId, a.IsUploadAppoint, a.SummaryDoctorId, - a.MedicalConclusionId + a.MedicalConclusionId, + a.AuditDate, + a.AuditDoctorId }, //RegisterCheckCompleteFlag = registerCheck.CompleteFlag, //IsCheck = asbitem.IsCheck, @@ -186,6 +188,11 @@ namespace Shentun.Peis.PeisReports sumquery = sumquery.Where(m => m.a.SummaryDate != null && m.a.SummaryDate.Value >= Convert.ToDateTime(item.StartDate) && m.a.SummaryDate.Value < Convert.ToDateTime(item.EndDate).AddDays(1)); } + else if (item.DateType == '5') + { + sumquery = sumquery.Where(m => m.a.AuditDate != null && m.a.AuditDate.Value >= Convert.ToDateTime(item.StartDate) && + m.a.AuditDate.Value < Convert.ToDateTime(item.EndDate).AddDays(1)); + } } if (input.CustomerOrgs.Count > 1) @@ -226,6 +233,11 @@ namespace Shentun.Peis.PeisReports newquery = newquery.Where(m => m.a.SummaryDate != null && m.a.SummaryDate.Value >= Convert.ToDateTime(item2.StartDate) && m.a.SummaryDate.Value < Convert.ToDateTime(item2.EndDate).AddDays(1)); } + else if (item2.DateType == '5') + { + sumquery = sumquery.Where(m => m.a.AuditDate != null && m.a.AuditDate.Value >= Convert.ToDateTime(item2.StartDate) && + m.a.AuditDate.Value < Convert.ToDateTime(item2.EndDate).AddDays(1)); + } } sumquery = sumquery.Union(newquery); } @@ -365,7 +377,9 @@ namespace Shentun.Peis.PeisReports IsPatientOccupationalDisease = _patientOccupationalDiseaseManager.GetPatientRegisterIsOccupationalDisease(s.a.Id).GetAwaiter().GetResult(), MedicalStartDate = DataHelper.ConversionDateShortToString(s.a.MedicalStartDate), SummaryDate = DataHelper.ConversionDateShortToString(s.a.SummaryDate), - SummaryDoctorName = _cacheService.GetSurnameAsync(s.a.SummaryDoctorId).GetAwaiter().GetResult() + SummaryDoctorName = _cacheService.GetSurnameAsync(s.a.SummaryDoctorId).GetAwaiter().GetResult(), + AuditDate = DataHelper.ConversionDateShortToString(s.a.AuditDate), + AuditDoctorName = _cacheService.GetSurnameAsync(s.a.AuditDoctorId).GetAwaiter().GetResult() }); }