From 7461a5902f844365e219c7beed0f2b81530bd794 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Mon, 23 Mar 2026 18:55:11 +0800 Subject: [PATCH] 0323 --- .../GetAuditDoctorWorkLoadReportDto.cs | 5 ++++ .../GetDoctorPersonnelWorkLoadReportDto.cs | 5 ++++ .../GetSumCheckDoctorWorkLoadReportDto.cs | 5 ++++ .../InternalReportAppService.cs | 16 ++++++---- .../PatientRegisterAppService.cs | 30 +++++++++++++++++-- .../PeisReports/PeisReportAppService.cs | 4 +-- 6 files changed, 56 insertions(+), 9 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/InternalReports/GetAuditDoctorWorkLoadReportDto.cs b/src/Shentun.Peis.Application.Contracts/InternalReports/GetAuditDoctorWorkLoadReportDto.cs index be918204..504ac2ae 100644 --- a/src/Shentun.Peis.Application.Contracts/InternalReports/GetAuditDoctorWorkLoadReportDto.cs +++ b/src/Shentun.Peis.Application.Contracts/InternalReports/GetAuditDoctorWorkLoadReportDto.cs @@ -11,6 +11,11 @@ namespace Shentun.Peis.InternalReports /// public string AuditDoctorName { get; set; } + /// + /// 审核医生账户 + /// + public string AuditDoctorCode { get; set; } + /// /// 审核数量 /// diff --git a/src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs b/src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs index 7813b367..1e2d4b0b 100644 --- a/src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs +++ b/src/Shentun.Peis.Application.Contracts/InternalReports/GetDoctorPersonnelWorkLoadReportDto.cs @@ -12,6 +12,11 @@ namespace Shentun.Peis.InternalReports /// public string DoctorName { get; set; } + /// + /// 医生账户 + /// + public string DoctorCode { get; set; } + /// /// 组合项目名称 /// diff --git a/src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs b/src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs index 47178f32..ff912aa1 100644 --- a/src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs +++ b/src/Shentun.Peis.Application.Contracts/InternalReports/GetSumCheckDoctorWorkLoadReportDto.cs @@ -11,6 +11,11 @@ namespace Shentun.Peis.InternalReports /// public string SumCheckDoctorName { get; set; } + /// + /// 总检医生账户 + /// + public string SumCheckDoctorCode { get; set; } + /// /// 总检数量 /// diff --git a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs index f905d6bb..2eaada74 100644 --- a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs +++ b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs @@ -114,6 +114,7 @@ namespace Shentun.Peis.InternalReports a, CheckDoctorId = ad.CheckDoctorId, DoctorName = ab != null ? ab.Surname : ad.CheckDoctorId, + DoctorCode = ab != null ? ab.UserName : "", AsbitemName = ac != null ? ac.DisplayName : "" }); @@ -128,6 +129,7 @@ namespace Shentun.Peis.InternalReports AsbitemName = s.FirstOrDefault().AsbitemName, CheckCount = s.Count(), DoctorName = s.FirstOrDefault().DoctorName, + DoctorCode = s.FirstOrDefault().DoctorCode, AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice), 2), AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice), 2), SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount), 2), @@ -156,7 +158,8 @@ namespace Shentun.Peis.InternalReports select new { a, - SumCheckDoctorName = ab != null ? ab.Surname : "" + SumCheckDoctorName = ab != null ? ab.Surname : "", + SumCheckDoctorCode = ab != null ? ab.UserName : "" }); @@ -171,6 +174,7 @@ namespace Shentun.Peis.InternalReports .Select(s => new GetSumCheckDoctorWorkLoadReportDto { SumCheckDoctorName = s.Key.SumCheckDoctorName, + SumCheckDoctorCode = s.FirstOrDefault().SumCheckDoctorCode, SumCheckCount = s.Count(), Percentage = Math.Round(Convert.ToDecimal(s.Count() * 100) / sumCount, 2).ToString() }).ToList(); @@ -195,7 +199,8 @@ namespace Shentun.Peis.InternalReports select new { patientRegister, - AuditDoctorName = userEmptyHave != null ? userEmptyHave.Surname : "" + AuditDoctorName = userEmptyHave != null ? userEmptyHave.Surname : "", + AuditDoctorCode = userEmptyHave != null ? userEmptyHave.UserName : "" }); @@ -210,6 +215,7 @@ namespace Shentun.Peis.InternalReports .Select(s => new GetAuditDoctorWorkLoadReportDto { AuditDoctorName = s.Key.AuditDoctorName, + AuditDoctorCode = s.FirstOrDefault().AuditDoctorCode, AuditCount = s.Count(), Percentage = Math.Round(Convert.ToDecimal(s.Count() * 100) / sumCount, 2).ToString() }).ToList(); @@ -253,12 +259,12 @@ namespace Shentun.Peis.InternalReports List Ids = new List(); foreach (var item in input.ItemTypeId) { - var tempItemTypeIds =await _itemTypeManager.GetChildItemTypeIdsAsync(item); + var tempItemTypeIds = await _itemTypeManager.GetChildItemTypeIdsAsync(item); Ids.AddRange(tempItemTypeIds); } Ids = Ids.Distinct().ToList(); - + qeruy = qeruy.Where(m => Ids.Contains(m.ItemTypeId)); } @@ -443,7 +449,7 @@ namespace Shentun.Peis.InternalReports } - + var entlistdto = query.ToList().GroupBy(g => new { g.a.AsbitemId, g.RegisterId }) .Select(s => new GetPeisWorkLoadReportDto { diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index 94b42b72..ad2857f3 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -3465,22 +3465,48 @@ namespace Shentun.Peis.PatientRegisters throw new UserFriendlyException("系统中已有该身份证号的不同姓名人员"); else { - patientList = patientList.Where(m => m.DisplayName == input.PatientName).ToList(); + //patientList = patientList.Where(m => m.DisplayName == input.PatientName).ToList(); + //if (patientList.Count > 1) + //{ + // var tPatientRegisterList = await _repository.GetListAsync(m => patientList.Select(s => s.Id).Contains(m.PatientId)); + // if (tPatientRegisterList.Count > 0) + // { + // patient = patientList.FirstOrDefault(f => f.Id == tPatientRegisterList.OrderByDescending(o => o.MedicalTimes).Select(s => s.PatientId).FirstOrDefault()); + // } + // else + // { + // patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + // } + //} + //else + //{ + // patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + //} + + if (patientList.Count > 1) { var tPatientRegisterList = await _repository.GetListAsync(m => patientList.Select(s => s.Id).Contains(m.PatientId)); if (tPatientRegisterList.Count > 0) { patient = patientList.FirstOrDefault(f => f.Id == tPatientRegisterList.OrderByDescending(o => o.MedicalTimes).Select(s => s.PatientId).FirstOrDefault()); + if (patient.DisplayName != input.PatientName) + { + throw new UserFriendlyException("最后一次体检的姓名跟当前导入的不一致"); + } } else { patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + if (patient == null) + { + patient = patientList.FirstOrDefault(); + } } } else { - patient = patientList.FirstOrDefault(f => f.DisplayName == input.PatientName); + patient = patientList.FirstOrDefault(); } } } diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs index 6b8237c5..d138292a 100644 --- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs +++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs @@ -436,9 +436,9 @@ namespace Shentun.Peis.PeisReports IsUploadAppoint = s.a.IsUploadAppoint, IsPatientOccupationalDisease = _patientOccupationalDiseaseManager.GetPatientRegisterIsOccupationalDisease(s.a.Id).GetAwaiter().GetResult(), MedicalStartDate = DataHelper.ConversionDateShortToString(s.a.MedicalStartDate), - SummaryDate = DataHelper.ConversionDateShortToString(s.a.SummaryDate), + SummaryDate = DataHelper.ConversionDateToString(s.a.SummaryDate), SummaryDoctorName = _cacheService.GetSurnameAsync(s.a.SummaryDoctorId).GetAwaiter().GetResult(), - AuditDate = DataHelper.ConversionDateShortToString(s.a.AuditDate), + AuditDate = DataHelper.ConversionDateToString(s.a.AuditDate), AuditDoctorName = _cacheService.GetSurnameAsync(s.a.AuditDoctorId).GetAwaiter().GetResult(), ReportPrintName = _cacheService.GetSurnameAsync(s.a.ReportPrintOperating).GetAwaiter().GetResult(), IsReceiveReport = s.a.IsReceiveReport,