From 82ba772b55c4c2420e5fcfa0219b3a86cf08ac36 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Thu, 23 May 2024 21:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SumSuggestionHeaders/SumSuggestionDto.cs | 2 + .../SumSuggestionHeaderAppService.cs | 9 +- .../TransToWebPeisAppService.cs | 167 ++++++++++-------- 3 files changed, 98 insertions(+), 80 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs b/src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs index f92c436..e311cee 100644 --- a/src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs +++ b/src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs @@ -6,6 +6,8 @@ namespace Shentun.Peis.SumSuggestionHeaders { public class SumSuggestionDto { + public Guid PatientRegisterId { get; set; } + /// /// 建议标题 /// diff --git a/src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs b/src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs index fe2c03d..4c18f47 100644 --- a/src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs +++ b/src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs @@ -124,6 +124,7 @@ namespace Shentun.Peis.SumSuggestionHeaders DisplayOrder = sa.sumSuggestionContentHaveEmpty.DisplayOrder, SuggestionContent = sa.sumSuggestionContentHaveEmpty.SuggestionContent, }).OrderBy(o => o.DisplayOrder).Distinct().ToList(), + PatientRegisterId = input.PatientRegisterId }).OrderBy(o => o.DisplayOrder).ToList(); } @@ -188,7 +189,8 @@ namespace Shentun.Peis.SumSuggestionHeaders SuggestionContent = x.SuggestionContent, DisplayOrder = x.DisplayOrder, } - ).ToList() + ).ToList(), + PatientRegisterId = input.PatientRegisterId }; msg.Add(sumSuggestionDto); } @@ -205,11 +207,14 @@ namespace Shentun.Peis.SumSuggestionHeaders SuggestionFlag = null, DisplayOrder = 0, DiagnosisIds = null, - DiagnosisNames = null + DiagnosisNames = null, + PatientRegisterId = input.PatientRegisterId }); } } + + return msg; } diff --git a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs index b2fded6..f3fc425 100644 --- a/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs +++ b/src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs @@ -83,94 +83,90 @@ namespace Shentun.Peis.TransToWebPeis [HttpPost("api/app/TransToWebPeis/TransBaseData")] public async Task TransBaseDataAsync() { - //var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType == - //ThirdInterfaceTypeFlag.TranToWebPeis && o.IsActive == 'Y'); - //foreach (var thirdInterface in thirdInterfaces) - //{ - // var connectString = GetConnectionStrings(thirdInterface.ParmValue); + var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType == + ThirdInterfaceTypeFlag.TranToWebPeis); + foreach (var thirdInterface in thirdInterfaces) + { + var connectString = GetConnectionStrings(thirdInterface.ParmValue); - // SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() - // { - // ConnectionString = connectString, - // DbType = SqlSugar.DbType.PostgreSQL, - // IsAutoCloseConnection = true - // }); + SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() + { + ConnectionString = connectString, + DbType = SqlSugar.DbType.PostgreSQL, + IsAutoCloseConnection = true + }); - // await TransItemType(WebDb); - // await TransItem(connectString); - // await TransAsbitem(connectString); - // await TransMedicalPackage(connectString); - // await TransDiagnosis(connectString); - //} + #region 清理基础数据 + //删除 + await WebDb.Ado.ExecuteCommandAsync("delete from medical_package_detail;"); + await WebDb.Ado.ExecuteCommandAsync("delete from medical_package;"); + await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group_detail;"); + await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group;"); + await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_register;"); + await WebDb.Ado.ExecuteCommandAsync("delete from customer_org;"); + await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis;"); + await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis_level;"); - var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"; + await WebDb.Ado.ExecuteCommandAsync("delete from asbitem_detail;"); + await WebDb.Ado.ExecuteCommandAsync("delete from asbitem;"); - SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() - { - ConnectionString = connectString, - DbType = SqlSugar.DbType.PostgreSQL, - IsAutoCloseConnection = true - }); + await WebDb.Ado.ExecuteCommandAsync("delete from item"); - #region 清理基础数据 - //删除 + await WebDb.Ado.ExecuteCommandAsync("delete from item_type"); + #endregion - await WebDb.Ado.ExecuteCommandAsync("delete from medical_package_detail;"); - await WebDb.Ado.ExecuteCommandAsync("delete from medical_package;"); - await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group_detail;"); - await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group;"); - await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_register;"); - await WebDb.Ado.ExecuteCommandAsync("delete from customer_org;"); + await TransItemType(WebDb); + await TransItem(WebDb); + await TransAsbitem(WebDb); + await TransMedicalPackage(WebDb); + await TransDiagnosis(WebDb); - await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis;"); - await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis_level;"); + await TransCustomerOrgAsync(WebDb); + await TransCustomerOrgRegisterAsync(WebDb); + await TransCustomerOrgGroupAsync(WebDb); + await TransCustomerOrgGroupDetailAsync(WebDb); + } - await WebDb.Ado.ExecuteCommandAsync("delete from asbitem_detail;"); - await WebDb.Ado.ExecuteCommandAsync("delete from asbitem;"); - await WebDb.Ado.ExecuteCommandAsync("delete from item"); - await WebDb.Ado.ExecuteCommandAsync("delete from item_type"); - #endregion + //var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"; - await TransItemType(WebDb); - await TransItem(WebDb); - await TransAsbitem(WebDb); - await TransMedicalPackage(WebDb); - await TransDiagnosis(WebDb); + //SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() + //{ + // ConnectionString = connectString, + // DbType = SqlSugar.DbType.PostgreSQL, + // IsAutoCloseConnection = true + //}); - await TransCustomerOrgAsync(WebDb); - await TransCustomerOrgRegisterAsync(WebDb); - await TransCustomerOrgGroupAsync(WebDb); - await TransCustomerOrgGroupDetailAsync(WebDb); - } - /// - /// 上传单位信息 - /// - /// - [HttpPost("api/app/TransToWebPeis/TransCustomerOrg")] - public async Task TransCustomerOrgWithDetailAsync() - { - //customer_org,customer_org_register - } - /// - /// 上传人员体检信息 - /// - /// - [HttpPost("api/app/TransToWebPeis/TransPatientRegister")] - public async Task TransPatientRegisterAsync() - { - //patient,patient_register,register_check,register_check_asbitem - //register_check_item,register_check_picture,register_check_summary,register_check_suggestion - //sum_summary_header,sum_summary_content,sum_suggestion_header,sum_suggestion_content,sum_diagnosis, } + ///// + ///// 上传单位信息 + ///// + ///// + //[HttpPost("api/app/TransToWebPeis/TransCustomerOrg")] + //public async Task TransCustomerOrgWithDetailAsync() + //{ + // //customer_org,customer_org_register + //} + ///// + ///// 上传人员体检信息 + ///// + ///// + //[HttpPost("api/app/TransToWebPeis/TransPatientRegister")] + //public async Task TransPatientRegisterAsync() + //{ + // //patient,patient_register,register_check,register_check_asbitem + // //register_check_item,register_check_picture,register_check_summary,register_check_suggestion + // //sum_summary_header,sum_summary_content,sum_suggestion_header,sum_suggestion_content,sum_diagnosis, + + //} /// /// 根据人员登记ID上传人员体检信息 /// @@ -179,15 +175,28 @@ namespace Shentun.Peis.TransToWebPeis [HttpPost("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId")] public async Task TransPatientRegisterByPatientRegisterIdAsync(PatientRegisterIdInputDto input) { - var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"; - SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() + var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType == + ThirdInterfaceTypeFlag.TranToWebPeis); + foreach (var thirdInterface in thirdInterfaces) { - ConnectionString = connectString, - DbType = SqlSugar.DbType.PostgreSQL, - IsAutoCloseConnection = true - }); - await TransPatientRegisterWithDetailAsync(WebDb, input.PatientRegisterId); + var connectString = GetConnectionStrings(thirdInterface.ParmValue); + + SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() + { + ConnectionString = connectString, + DbType = SqlSugar.DbType.PostgreSQL, + IsAutoCloseConnection = true + }); + + + await TransPatientRegisterWithDetailAsync(WebDb, input.PatientRegisterId); + + } + + + + } /// /// 撤销上传人员体检信息 @@ -317,10 +326,10 @@ namespace Shentun.Peis.TransToWebPeis await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.asbitem(asbitem_id, asbitem_name, short_name, for_sex_id, item_type_id," + "price, device_type_id, is_before_eat, clinical_meaning, default_result," + "is_picture_rotate, is_check, is_active, simple_code, display_order, concurrency_stamp," + - "creation_time, creator_id, last_modification_time, last_modifier_id, is_web_appoint) values " + + "creation_time, creator_id, last_modification_time, last_modifier_id, is_web_appoint,warn,disease_screening_type_id) values " + "(@asbitem_id,@asbitem_name,@short_name,@for_sex_id,@item_type_id,@price,@device_type_id::uuid,@is_before_eat,@clinical_meaning," + "@default_result,@is_picture_rotate,@is_check,@is_active,@simple_code,@display_order,@concurrency_stamp,@creation_time," + - "@creator_id,@last_modification_time,@last_modifier_id,@is_web_appoint)", + "@creator_id,@last_modification_time,@last_modifier_id,@is_web_appoint,@warn,@disease_screening_type_id::uuid)", new List() { new SugarParameter("asbitem_id",asbitem.Id), new SugarParameter("asbitem_name",asbitem.DisplayName), @@ -342,7 +351,9 @@ namespace Shentun.Peis.TransToWebPeis new SugarParameter("creator_id",asbitem.CreatorId), new SugarParameter("last_modification_time",asbitem.LastModificationTime), new SugarParameter("last_modifier_id",asbitem.LastModifierId), - new SugarParameter("is_web_appoint",asbitem.IsWebAppoint) + new SugarParameter("is_web_appoint",asbitem.IsWebAppoint), + new SugarParameter("warn",asbitem.Warn), + new SugarParameter("disease_screening_type_id",asbitem.DiseaseScreeningTypeId) }); //插入明细