From da07ff541647a0ac35cabbe7e1776415e9205d68 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G961P6V\\Zhh" <839860190@qq.com> Date: Sun, 9 Jun 2024 23:51:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cs => ImportPatientRegisterPlugInsQztl.cs} | 8 +- ...is.cs => PatientRegisterPluginsHzcyHis.cs} | 4 +- .../Shentun.Peis.PlugIns.Gem.Test/HisTest.cs | 12 +-- .../ImportPatientRegisterPlugInsHzcyTest.cs | 2 +- .../AppServiceHelper.cs | 0 .../PeisHttpApiHostModule.cs | 14 ++-- .../AppointPatientRegisterAppServiceTest.cs | 81 +++++++++++++++++++ 7 files changed, 102 insertions(+), 19 deletions(-) rename ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/{ImportPatientRegisterPlugInsGem.cs => ImportPatientRegisterPlugInsQztl.cs} (99%) rename ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/{PatientRegisterPluginsGemHis.cs => PatientRegisterPluginsHzcyHis.cs} (96%) rename src/{Shentun.Peis.HttpApi.Host => Shentun.Peis.Application}/AppServiceHelper.cs (100%) create mode 100644 test/Shentun.Peis.Application.Tests/AppointPatientRegisterAppServiceTest.cs diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsGem.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs similarity index 99% rename from ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsGem.cs rename to ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs index 4a74631..a5dc656 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsGem.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs @@ -25,7 +25,7 @@ using Shentun.Peis.PlugIns.PatientRegisters; namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl { - public class ImportPatientRegisterPlugInsGem : ImportPatientRegisterPlugInsBase + public class ImportPatientRegisterPlugInsQztl : ImportPatientRegisterPlugInsBase { private Guid _importCustomerOrgId; private string _hospitalId; @@ -37,11 +37,11 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl private List _customerOrgGroupDtos; private string _answerWebApiUrl; - public ImportPatientRegisterPlugInsGem(Guid thirdInterfaceId) : base(thirdInterfaceId) + public ImportPatientRegisterPlugInsQztl(Guid thirdInterfaceId) : base(thirdInterfaceId) { } - public ImportPatientRegisterPlugInsGem(string parmValue) : base(parmValue) + public ImportPatientRegisterPlugInsQztl(string parmValue) : base(parmValue) { } @@ -372,7 +372,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl _personnelTypes = await CallAppServiceAsync>("api/app/PersonnelType/GetAll", ""); } - + //public public async Task CallInterfaceServiceAsync() { string baseAddress = InterfaceWebApiUrl; diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsGemHis.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsHzcyHis.cs similarity index 96% rename from ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsGemHis.cs rename to ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsHzcyHis.cs index 3cd736f..29f47ea 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsGemHis.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsHzcyHis.cs @@ -12,11 +12,11 @@ using static ServiceReferenceHzcyHis.bstjPortTypeClient; namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl { - public class PatientRegisterPluginsGemHis : PatientRegisterPluginsBase + public class PatientRegisterPluginsHzcyHis : PatientRegisterPluginsBase { private string _endpointAddress = ""; - public PatientRegisterPluginsGemHis(string parmValue) : base(parmValue) + public PatientRegisterPluginsHzcyHis(string parmValue) : base(parmValue) { _endpointAddress = InterfaceConfig.GetSection("Interface").GetSection("EndpointAddress").Value; diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs index e5fd6b4..063ecd1 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs @@ -16,7 +16,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task PatientQuery() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisPatientQueryInput = new HisPatientQueryInput() { Data = new HisPatientQueryDataInput() @@ -55,7 +55,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task PatientNew() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisPatientQueryInput = new HisPatientQueryInput() { Data = new HisPatientQueryDataInput() @@ -97,7 +97,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task MecSave() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisInput = new HisMecSaveInput() { Data = new HisMecSaveDataInput() @@ -145,7 +145,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task CancelQrCode() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisInput = new HisCancelQrCodeInput() { Data = new HisCancelQrCodeDataInput() @@ -180,7 +180,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task PayStatus() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisInput = new HisPayStatusInput() { Data = new HisPayStatusDataInput() @@ -215,7 +215,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test [Fact] public async Task AgreeRefund() { - var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm()); + var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm()); var hisInput = new HisAgreeRefundInput() { Data = new HisAgreeRefundDataInput() diff --git a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs index 1b67172..7cea871 100644 --- a/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs +++ b/ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs @@ -26,7 +26,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json"; configParm = File.ReadAllText(filePath); - var input = new ImportPatientRegisterPlugInsGem(configParm); + var input = new ImportPatientRegisterPlugInsQztl(configParm); await input.ImportAsync(); diff --git a/src/Shentun.Peis.HttpApi.Host/AppServiceHelper.cs b/src/Shentun.Peis.Application/AppServiceHelper.cs similarity index 100% rename from src/Shentun.Peis.HttpApi.Host/AppServiceHelper.cs rename to src/Shentun.Peis.Application/AppServiceHelper.cs diff --git a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs index 10781cd..0f212b4 100644 --- a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs +++ b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs @@ -236,17 +236,19 @@ public class PeisHttpApiHostModule : AbpModule // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); // options.JsonSerializerOptions.PropertyNamingPolicy = null; //}); - //Configure(x => - //{ - // //x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); - // x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter()); - // x.JsonSerializerOptions.PropertyNameCaseInsensitive = true; + Configure(x => + { + //x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); + x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter()); + x.JsonSerializerOptions.PropertyNameCaseInsensitive = true; - //}); + }); Configure(x => { x.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss"; + + }); } diff --git a/test/Shentun.Peis.Application.Tests/AppointPatientRegisterAppServiceTest.cs b/test/Shentun.Peis.Application.Tests/AppointPatientRegisterAppServiceTest.cs new file mode 100644 index 0000000..a4ddc40 --- /dev/null +++ b/test/Shentun.Peis.Application.Tests/AppointPatientRegisterAppServiceTest.cs @@ -0,0 +1,81 @@ +using Shentun.Peis.AppointPatientRegisters; +using Shentun.Peis.ChargeRequests; +using Shentun.Peis.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Uow; +using Xunit; +using Xunit.Abstractions; + +namespace Shentun.Peis +{ + public class AppointPatientRegisterAppServiceTest : PeisApplicationTestBase + { + private readonly IRepository _repository; + private readonly AppointPatientRegisterAppService _appService; + private readonly ITestOutputHelper _output; + private readonly IUnitOfWorkManager _unitOfWorkManager; + public AppointPatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper) + { + _output = testOutputHelper; + _unitOfWorkManager = GetRequiredService(); + _repository = GetRequiredService>(); + _appService = GetRequiredService(); + } + + [Fact] + public async Task GetListByFilterAsync() + { + using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) + { + + var entity = new AppointPatientRegisterInputDto() + { + ThirdInterFaceId = new Guid("43a9c3a5-8741-4c64-b869-bc304712d88e"), + AppointStartDate = DateTime.Now.Date.AddDays(-10), + MobilePhone = "18911254911" + + }; + + var newEntity = await _appService.GetListByFilterAsync(entity); + foreach (var item in newEntity) + { + _output.WriteLine(item.PersonName); + } + await unitOfWork.CompleteAsync(); + } + } + [Fact] + public async Task GetListByFilterAsync2() + { + using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) + { + + var entity = new AppointPatientRegisterInputDto() + { + ThirdInterFaceId = new Guid("43a9c3a5-8741-4c64-b869-bc304712d88e"), + AppointStartDate = DateTime.Now.Date.AddDays(-10), + MobilePhone = "18911254911" + + }; + var appServiceHelper = new AppServiceHelper(); + var list = await appServiceHelper.CallAppServiceAsync> + ("api/app/AppointPatientRegister/GetListByFilter", entity); + foreach(var item in list) + { + _output.WriteLine(item.PersonName); + } + //var newEntity = await _appService.GetListByFilterAsync(entity); + //foreach (var item in newEntity) + //{ + // _output.WriteLine(item.PersonName); + //} + await unitOfWork.CompleteAsync(); + } + } + } +}