From 0b406d5c27ada04fbdf3dff11e525cd5e97a4f16 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Mon, 17 Nov 2025 09:37:33 +0800 Subject: [PATCH] 1117 --- ...RecoverGuideByPatientRegisterNoInputDto.cs | 14 +++++ .../CCTJExportDataAppService.cs | 2 +- .../PacsBusiness/PacsBusinessAppService.cs | 4 ++ .../PatientRegisterAppService.cs | 21 ++++++++ .../TransToWebPeisAppService.cs | 54 ++++++++++++++++--- .../PatientRegisterManager.cs | 15 ++++++ .../CustomerExceptionFilterAttribute.cs | 28 ++++++++-- 7 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs new file mode 100644 index 0000000..8b22e5b --- /dev/null +++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.Peis.PatientRegisters +{ + public class BatchRecoverGuideByPatientRegisterNoInputDto + { + /// + /// 条码号集合 + /// + public List PatientRegisterNos { get; set; } = new List(); + } +} diff --git a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs index e4a3945..3bda1bb 100644 --- a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs +++ b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs @@ -3414,7 +3414,7 @@ namespace Shentun.Peis.CCTJExportDatas { Guid tempRegisterCheckPictureId = GuidGenerator.Create(); var fileName = checkPictureRow["picture_filename"].ToString(); - fileName = fileName.Replace("\\\\192.168.0.3", ""); + fileName = fileName.Replace("\\\\192.168.0.3", "").Replace(@"\", "/").Replace("//", "/"); var tempRegisterCheckPicture = new RegisterCheckPicture(tempRegisterCheckPictureId) { DisplayOrder = dt_check_picture.Rows.IndexOf(checkPictureRow) + 1, diff --git a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs index 6ca723c..ce7b3aa 100644 --- a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs +++ b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs @@ -36,6 +36,7 @@ using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Auditing; using Volo.Abp.Domain.Repositories; using Volo.Abp.Identity; using Volo.Abp.Security.Claims; @@ -235,6 +236,7 @@ namespace Shentun.Peis.PacsBusiness /// /// Result /// + [DisableAuditing] [HttpPost("api/app/PacsBusiness/ImportElectrocardiogramPictureByPatientRegisterNo")] public async Task ImportElectrocardiogramPictureByPatientRegisterNoAsync(ImportElectrocardiogramPictureByPatientRegisterNoInputDto input) { @@ -347,6 +349,7 @@ namespace Shentun.Peis.PacsBusiness /// Result /// [HttpPost("api/app/PacsBusiness/ImportElectrocardiogramResultByPatientRegisterNo")] + [DisableAuditing] public async Task ImportElectrocardiogramResultByPatientRegisterNoAsync(ImportElectrocardiogramResultByPatientRegisterNoInputDto input) { Random rd = new Random(); @@ -462,6 +465,7 @@ namespace Shentun.Peis.PacsBusiness /// Result /// [HttpPost("api/app/PacsBusiness/ImportDeviceReportFileByPatientRegisterNo")] + [DisableAuditing] public async Task ImportDeviceReportFileByPatientRegisterNoAsync(ImportDeviceReportFileByPatientRegisterNoInputDto input) { Random rd = new Random(); diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs index eeb6774..60c9c7f 100644 --- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs @@ -2346,6 +2346,27 @@ namespace Shentun.Peis.PatientRegisters return msg; } + + /// + /// 批量回收指引单 根据条码号 + /// + /// + /// + /// + [HttpPost("api/app/PatientRegister/BatchRecoverGuideByPatientRegisterNo")] + public async Task BatchRecoverGuideByPatientRegisterNoAsync(BatchRecoverGuideByPatientRegisterNoInputDto input) + { + + if (!input.PatientRegisterNos.Any()) + throw new UserFriendlyException("条码号不能为空"); + + foreach (var patientRegisterNo in input.PatientRegisterNos) + { + var patientRegister = await _repository.FirstOrDefaultAsync(f => f.PatientRegisterNo == patientRegisterNo); + await _patientRegisterManager.BatchRecoverGuideByPatientRegisterNoAsync(patientRegister); + } + } + ///// ///// 人员签到 ///// diff --git a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs index 745f9bd..e2f2994 100644 --- a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs +++ b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs @@ -67,6 +67,7 @@ namespace Shentun.Peis.TransToWebPeis private readonly IConfiguration _configuration; private readonly IRepository _patientRepository; private readonly ThirdBookingPushAppService _thirdBookingPushAppService; + private readonly CacheService _cacheService; private readonly SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig() { @@ -103,7 +104,8 @@ namespace Shentun.Peis.TransToWebPeis PrintReportAppService printReportAppService, IConfiguration configuration, IRepository patientRepository, - ThirdBookingPushAppService thirdBookingPushAppService) + ThirdBookingPushAppService thirdBookingPushAppService, + CacheService cacheService) { _itemTypeRepository = itemTypeRepository; _logger = logger; @@ -125,6 +127,7 @@ namespace Shentun.Peis.TransToWebPeis _configuration = configuration; _patientRepository = patientRepository; _thirdBookingPushAppService = thirdBookingPushAppService; + _cacheService = cacheService; } @@ -506,13 +509,39 @@ namespace Shentun.Peis.TransToWebPeis var itemTypes = await _itemTypeRepository.GetListAsync(); if (itemTypes.Count > 0) { - + var isMedicalReportTypeId = WebDb.Ado.GetInt(@" SELECT COUNT(*) FROM information_schema.columns + WHERE table_schema = 'public' AND table_name = 'item_type' + AND column_name = 'medical_report_type_id'"); foreach (var itemType in itemTypes) { - await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " + - "VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);", - new List() { + if (isMedicalReportTypeId > 0) + { + await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id,medical_report_type_id) " + + "VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@medical_report_type_id);", + new List() { + new SugarParameter("@item_type_id",itemType.Id), + new SugarParameter("@item_type_name",itemType.DisplayName), + new SugarParameter("@simple_code",itemType.SimpleCode), + new SugarParameter("@parent_id",itemType.ParentId), + new SugarParameter("@path_code",itemType.PathCode), + new SugarParameter("@check_type_flag",itemType.CheckTypeFlag), + new SugarParameter("@display_order",itemType.DisplayOrder), + new SugarParameter("@is_wrap",itemType.IsWrap), + new SugarParameter("@concurrency_stamp",itemType.ConcurrencyStamp), + new SugarParameter("@creation_time",itemType.CreationTime), + new SugarParameter("@creator_id",itemType.CreatorId), + new SugarParameter("@last_modification_time",itemType.LastModificationTime), + new SugarParameter("@last_modifier_id",itemType.LastModifierId), + new SugarParameter("@medical_report_type_id",itemType.MedicalReportTypeId) + + }); + } + else + { + await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " + + "VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);", + new List() { new SugarParameter("@item_type_id",itemType.Id), new SugarParameter("@item_type_name",itemType.DisplayName), new SugarParameter("@simple_code",itemType.SimpleCode), @@ -526,7 +555,8 @@ namespace Shentun.Peis.TransToWebPeis new SugarParameter("@creator_id",itemType.CreatorId), new SugarParameter("@last_modification_time",itemType.LastModificationTime), new SugarParameter("@last_modifier_id",itemType.LastModifierId) - }); + }); + } } _logger.LogInformation($"项目类别数据处理完毕,数量{itemTypes.Count}"); @@ -1079,6 +1109,16 @@ namespace Shentun.Peis.TransToWebPeis foreach (var registerCheckWithDetail in registerCheckWithDetails) { + + var checkDoctorIdConvert = registerCheckWithDetail.CheckDoctorId; + if (!string.IsNullOrWhiteSpace(checkDoctorIdConvert)) + { + if (Guid.TryParse(checkDoctorIdConvert, out var checkDoctorIdGuid)) + { + checkDoctorIdConvert = await _cacheService.GetSurnameAsync(checkDoctorIdGuid); + } + } + #region register_check await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.register_check(register_check_id, patient_register_id, check_request_no, third_info, complete_flag, critical_value, critical_value_flag, critical_value_process_content," + "critical_value_process_flag, critical_value_process_doctor, critical_value_process_date, critical_value_create_date, check_doctor_id, check_date, is_audit," + @@ -1099,7 +1139,7 @@ namespace Shentun.Peis.TransToWebPeis new SugarParameter("critical_value_process_doctor",""), new SugarParameter("critical_value_process_date",null), new SugarParameter("critical_value_create_date",null), - new SugarParameter("check_doctor_id",registerCheckWithDetail.CheckDoctorId), + new SugarParameter("check_doctor_id",checkDoctorIdConvert), new SugarParameter("check_date",registerCheckWithDetail.CheckDate), new SugarParameter("is_audit",registerCheckWithDetail.IsAudit), new SugarParameter("auditor_user_id",registerCheckWithDetail.AuditorUserId), diff --git a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs index 38f061c..fdd133f 100644 --- a/src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs +++ b/src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs @@ -23,6 +23,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Volo.Abp.Guids; @@ -1212,6 +1213,20 @@ namespace Shentun.Peis.PatientRegisters } } + /// + /// 回收表格 + /// + /// 登记表ID + /// + public async Task BatchRecoverGuideByPatientRegisterNoAsync(PatientRegister patientRegister) + { + if (patientRegister != null) + { + patientRegister.IsRecoverGuide = 'Y'; + await _repository.UpdateAsync(patientRegister); + } + } + private bool IsParmNotNUll(object obj) { if (obj == null) diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs index 595486c..4eb44fc 100644 --- a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs +++ b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs @@ -1,4 +1,6 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -7,9 +9,12 @@ using Shentun.Peis.Filter; using Shentun.WebApi.Service; using System; using System.Collections.Generic; +using System.Linq; +using System.Reflection; using System.Threading; using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; namespace Shentun.Peis @@ -34,9 +39,24 @@ namespace Shentun.Peis //异常日志记录 string error = string.Empty; ReadException(exceptionContext.Exception, ref error); - //LogHelper.Logger.LogError(error); - _logger.LogError("异常:" + error + Environment.NewLine + "异常堆栈:" + exceptionContext.Exception.StackTrace - ); + + bool isWriteLog = true; + + if (exceptionContext.ActionDescriptor is ControllerActionDescriptor actionDescriptor) + { + // 1. 先检查方法上的特性 + var methodAttribute = actionDescriptor.MethodInfo + .GetCustomAttributes(inherit: true) + .FirstOrDefault(); + if (methodAttribute != null) + { + isWriteLog = false; + } + } + + if (isWriteLog) + _logger.LogError("异常:" + error + Environment.NewLine + "异常堆栈:" + exceptionContext.Exception.StackTrace + ); //处理异常信息 string errorMessage; @@ -89,7 +109,7 @@ namespace Shentun.Peis List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems", "api/third/thirdpartypublicinterface/updatechecknostate" }; - + if (filterApiUrl.Contains(exceptionContext.HttpContext.Request.Path.ToString().ToLower())) { ThirdReturn msg = new ThirdReturn