diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/Dian/ImportLisResultPlugInsDian.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/Dian/ImportLisResultPlugInsDian.cs index 5c9dd84..63b451d 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/Dian/ImportLisResultPlugInsDian.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportLisResults/Dian/ImportLisResultPlugInsDian.cs @@ -59,14 +59,14 @@ namespace Shentun.Peis.PlugIns.Extensions.ImportLisResults.Dian foreach (var patientRegister in patientRegisters) { - await ImportDianResultByPatientRegisterIdAsync(patientRegister); + await ImportDianResultByPatientRegisterIdAsync(patientRegister.PatientRegisterId); } } - public async Task ImportDianResultByPatientRegisterIdAsync(PatientReisterForLisResultDian input) + public async Task ImportDianResultByPatientRegisterIdAsync(Guid patientRegisterId) { var lisResultAddress = InterfaceConfig.GetSection("Interface").GetSection("LisResultAddress").Value; var lisReportAddress = InterfaceConfig.GetSection("Interface").GetSection("LisReportAddress").Value; @@ -115,7 +115,7 @@ namespace Shentun.Peis.PlugIns.Extensions.ImportLisResults.Dian " left join asbitem as e on c.asbitem_id=e.id " + " left join register_check_item as f on b.id=f.register_check_id " + " left join item as g on f.item_id=g.id " + - $" where a.id='{input.PatientRegisterId}' and e.is_outsend='Y' "; + $" where a.id='{patientRegisterId}' and e.is_outsend='Y' "; @@ -221,7 +221,7 @@ namespace Shentun.Peis.PlugIns.Extensions.ImportLisResults.Dian string sql_register_check_id = "select distinct b.id as register_check_id from patient_register as a " + " left join register_check as b on a.id=b.patient_register_id " + " left join register_check_asbitem as c on b.id=c.register_check_id " + - $" where a.id='{input.PatientRegisterId}' and c.asbitem_id=ANY(@asbitemIds) "; + $" where a.id='{patientRegisterId}' and c.asbitem_id=ANY(@asbitemIds) "; var registerCheckIds = (await conn.QueryAsync(sql_register_check_id, new { asbitemIds = asbitemIds.Select(s => Guid.Parse(s.ItemId)).ToArray() diff --git a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs index 4609d5e..8b816f9 100644 --- a/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs +++ b/src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs @@ -897,10 +897,12 @@ namespace Shentun.Peis.CCTJExportDatas DisplayOrder = oldItemTypeList.Rows.IndexOf(row) + 1, SimpleCode = LanguageConverter.GetPYSimpleCode(row["department_name"].ToString()), CheckTypeFlag = Convert.ToChar(row["department_type"]), - GuidTypeId = defaultGuidTypeId, + // GuidTypeId = defaultGuidTypeId, + GuidTypeId = Convert.ToChar(row["department_type"]), IsMergeAsbitem = Convert.ToChar(row["merge_asbitem_flag"]), IsWrap = 'N', - MedicalReportTypeId = defaultMedicalReportTypeId, + MedicalReportTypeId = Convert.ToChar(row["department_type"]), + //MedicalReportTypeId = defaultMedicalReportTypeId, ParentId = null, PathCode = _itemTypeManager.CreatePathCode(null).Result, IsCheckRequest = Convert.ToChar(row["print_pacs_barcode_flag"]) @@ -4955,7 +4957,7 @@ namespace Shentun.Peis.CCTJExportDatas if (count == 0) { var oldCardRegisterList = await oldDb.Ado.GetDataTableAsync("SELECT [card_register_id],[card_type_id],[card_no],[discount],[expiry_date],[customer_name],[id_card_no]," + - "[telephone],[mobile_telephone],[card_flag],[remark],[sale_date],[amender],[amended_date] FROM [dbo].[card_register] order by card_register_id asc"); + "[telephone],[mobile_telephone],[card_flag],[remark],[sale_date],[amender],[amended_date] FROM [dbo].[card_register] where card_flag='Y' order by card_register_id asc"); if (oldCardRegisterList.Rows.Count > 0) { @@ -4963,12 +4965,21 @@ namespace Shentun.Peis.CCTJExportDatas { using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) { + + #region 统计金额 + + string sql_money = $"select sum(bill_money) as card_balance from card_bill where card_register_id='{row["card_register_id"]}'"; + var cardBalance = oldDb.Ado.SqlQuerySingle(sql_money); + #endregion + + if (cardBalance <= 0) + continue; Guid cardRegisterId = GuidGenerator.Create(); var cardTypeFieldComparison = await _fieldComparisonRepository.FirstOrDefaultAsync(f => f.TableName == "card_type" && f.OldKeyValue == row["card_type_id"].ToString().Trim()); var data = new CardRegister(cardRegisterId) { - CardBalance = 0, + CardBalance = cardBalance, CardNo = row["card_no"].ToString(), IdNo = row["id_card_no"].ToString(), CardPassword = "", diff --git a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs index f0df0f3..0cab7bd 100644 --- a/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs +++ b/src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs @@ -12,6 +12,7 @@ using Shentun.Peis.LisRequests; using Shentun.Peis.Models; using Shentun.Peis.PatientRegisters; using Shentun.Peis.PlugIns.ImportLisResults; +using Shentun.Peis.PlugIns.LisRequests; using Shentun.Peis.ReferenceRanges; using Shentun.Peis.RegisterCheckItems; using Shentun.Peis.RegisterChecks; @@ -348,6 +349,7 @@ namespace Shentun.Peis.ImportLisResults var assemblyName = config.GetSection("Interface").GetSection("AssemblyName").Value; var className = config.GetSection("Interface").GetSection("ClassName").Value; object[] objects = new object[] { input.PatientRegisterId }; + var pluginsOut = await Utilities.ReflectionHelper.InvokeAsync(assemblyName, className, [thirdInterface.Id], "ImportDianResultByPatientRegisterIdAsync", objects);