Browse Source

测试

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
da07ff5416
  1. 8
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs
  2. 4
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsHzcyHis.cs
  3. 12
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs
  4. 2
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs
  5. 0
      src/Shentun.Peis.Application/AppServiceHelper.cs
  6. 14
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  7. 81
      test/Shentun.Peis.Application.Tests/AppointPatientRegisterAppServiceTest.cs

8
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsGem.cs → 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 namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
{ {
public class ImportPatientRegisterPlugInsGem : ImportPatientRegisterPlugInsBase
public class ImportPatientRegisterPlugInsQztl : ImportPatientRegisterPlugInsBase
{ {
private Guid _importCustomerOrgId; private Guid _importCustomerOrgId;
private string _hospitalId; private string _hospitalId;
@ -37,11 +37,11 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
private List<CustomerOrgGroupDto> _customerOrgGroupDtos; private List<CustomerOrgGroupDto> _customerOrgGroupDtos;
private string _answerWebApiUrl; 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<string, List<PersonnelTypeDto>>("api/app/PersonnelType/GetAll", ""); _personnelTypes = await CallAppServiceAsync<string, List<PersonnelTypeDto>>("api/app/PersonnelType/GetAll", "");
} }
//public
public async Task<QztlPatientRegisterFromInterface?> CallInterfaceServiceAsync() public async Task<QztlPatientRegisterFromInterface?> CallInterfaceServiceAsync()
{ {
string baseAddress = InterfaceWebApiUrl; string baseAddress = InterfaceWebApiUrl;

4
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsGemHis.cs → ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/PatientRegisterPluginsHzcyHis.cs

@ -12,11 +12,11 @@ using static ServiceReferenceHzcyHis.bstjPortTypeClient;
namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
{ {
public class PatientRegisterPluginsGemHis : PatientRegisterPluginsBase
public class PatientRegisterPluginsHzcyHis : PatientRegisterPluginsBase
{ {
private string _endpointAddress = ""; private string _endpointAddress = "";
public PatientRegisterPluginsGemHis(string parmValue) : base(parmValue)
public PatientRegisterPluginsHzcyHis(string parmValue) : base(parmValue)
{ {
_endpointAddress = InterfaceConfig.GetSection("Interface").GetSection("EndpointAddress").Value; _endpointAddress = InterfaceConfig.GetSection("Interface").GetSection("EndpointAddress").Value;

12
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/HisTest.cs

@ -16,7 +16,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task PatientQuery() public async Task PatientQuery()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisPatientQueryInput = new HisPatientQueryInput() var hisPatientQueryInput = new HisPatientQueryInput()
{ {
Data = new HisPatientQueryDataInput() Data = new HisPatientQueryDataInput()
@ -55,7 +55,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task PatientNew() public async Task PatientNew()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisPatientQueryInput = new HisPatientQueryInput() var hisPatientQueryInput = new HisPatientQueryInput()
{ {
Data = new HisPatientQueryDataInput() Data = new HisPatientQueryDataInput()
@ -97,7 +97,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task MecSave() public async Task MecSave()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisInput = new HisMecSaveInput() var hisInput = new HisMecSaveInput()
{ {
Data = new HisMecSaveDataInput() Data = new HisMecSaveDataInput()
@ -145,7 +145,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task CancelQrCode() public async Task CancelQrCode()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisInput = new HisCancelQrCodeInput() var hisInput = new HisCancelQrCodeInput()
{ {
Data = new HisCancelQrCodeDataInput() Data = new HisCancelQrCodeDataInput()
@ -180,7 +180,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task PayStatus() public async Task PayStatus()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisInput = new HisPayStatusInput() var hisInput = new HisPayStatusInput()
{ {
Data = new HisPayStatusDataInput() Data = new HisPayStatusDataInput()
@ -215,7 +215,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
[Fact] [Fact]
public async Task AgreeRefund() public async Task AgreeRefund()
{ {
var patientRegisterPluginsGemHis = new PatientRegisterPluginsGemHis(GetConfigParm());
var patientRegisterPluginsGemHis = new PatientRegisterPluginsHzcyHis(GetConfigParm());
var hisInput = new HisAgreeRefundInput() var hisInput = new HisAgreeRefundInput()
{ {
Data = new HisAgreeRefundDataInput() Data = new HisAgreeRefundDataInput()

2
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"; string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json";
configParm = File.ReadAllText(filePath); configParm = File.ReadAllText(filePath);
var input = new ImportPatientRegisterPlugInsGem(configParm);
var input = new ImportPatientRegisterPlugInsQztl(configParm);
await input.ImportAsync(); await input.ImportAsync();

0
src/Shentun.Peis.HttpApi.Host/AppServiceHelper.cs → src/Shentun.Peis.Application/AppServiceHelper.cs

14
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -236,17 +236,19 @@ public class PeisHttpApiHostModule : AbpModule
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
// options.JsonSerializerOptions.PropertyNamingPolicy = null; // options.JsonSerializerOptions.PropertyNamingPolicy = null;
//}); //});
//Configure<JsonOptions>(x =>
//{
// //x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
// x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter());
// x.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
Configure<JsonOptions>(x =>
{
//x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter());
x.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
//});
});
Configure<AbpJsonOptions>(x => Configure<AbpJsonOptions>(x =>
{ {
x.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss"; x.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
}); });
} }

81
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<ChargeRequest, Guid> _repository;
private readonly AppointPatientRegisterAppService _appService;
private readonly ITestOutputHelper _output;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public AppointPatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper)
{
_output = testOutputHelper;
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
_repository = GetRequiredService<IRepository<ChargeRequest, Guid>>();
_appService = GetRequiredService<AppointPatientRegisterAppService>();
}
[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<AppointPatientRegisterInputDto, List<AppointPatientRegisterDto>>
("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();
}
}
}
}
Loading…
Cancel
Save