Browse Source

青藏公司

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
4029af9c6d
  1. 39
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportPatientRegisterPlugInsGem.cs
  2. 2
      test/Shentun.Peis.Application.Tests/PrintReportAppServiceTest.cs

39
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/ImportPatientRegisterPlugInsGem.cs

@ -43,15 +43,18 @@ namespace Shentun.Peis.PlugIns.Gem
{ {
await LoginAsync(); await LoginAsync();
await InitAsync(); await InitAsync();
for(var i = 0;i<30;i++)
for (var i = 0; i < 30; i++)
{ {
var qztlPatientRegisterFromInterface = await CallInterfaceServiceAsync(); var qztlPatientRegisterFromInterface = await CallInterfaceServiceAsync();
if (qztlPatientRegisterFromInterface == null || !qztlPatientRegisterFromInterface.plans.Any()) if (qztlPatientRegisterFromInterface == null || !qztlPatientRegisterFromInterface.plans.Any())
{ {
return; return;
} }
//设置导入人员信息 //设置导入人员信息
foreach (var patient in qztlPatientRegisterFromInterface.plans) foreach (var patient in qztlPatientRegisterFromInterface.plans)
{
try
{ {
//婚姻状况 //婚姻状况
var maritalStatusId = ConvertMaritalStatus(patient.wedding); var maritalStatusId = ConvertMaritalStatus(patient.wedding);
@ -116,7 +119,7 @@ namespace Shentun.Peis.PlugIns.Gem
customerOrgDto = await CallAppServiceAsync<CreateCustomerOrgDto, CustomerOrgDto>( customerOrgDto = await CallAppServiceAsync<CreateCustomerOrgDto, CustomerOrgDto>(
"api/app/customerorg/create", new CreateCustomerOrgDto() "api/app/customerorg/create", new CreateCustomerOrgDto()
{ {
MedicalCenterId = _customerOrgDto.MedicalCenterId ,
MedicalCenterId = _customerOrgDto.MedicalCenterId,
ParentId = _importCustomerOrgId, ParentId = _importCustomerOrgId,
DisplayName = orgName, DisplayName = orgName,
ShortName = orgName, ShortName = orgName,
@ -272,6 +275,25 @@ namespace Shentun.Peis.PlugIns.Gem
await NoteOk(succesIds, deleteIds); await NoteOk(succesIds, deleteIds);
} }
catch (Exception ex)
{
if (ex.Message.Contains("人员信息姓名和性别和原来的信息都不一致") ||
ex.Message.Contains("身份证号解析出的性别与填入的性别不一致"))
{
continue;
}
else
{
throw ex;
}
}
}
} }
@ -379,7 +401,10 @@ namespace Shentun.Peis.PlugIns.Gem
result = await response.Content.ReadAsStringAsync(); result = await response.Content.ReadAsStringAsync();
result = result.Replace(":\"[{", ":[{").Replace("}]\"", "}]").Replace("\\", ""); result = result.Replace(":\"[{", ":[{").Replace("}]\"", "}]").Replace("\\", "");
if(result.IndexOf("status") < 0)
{
throw new Exception($"调用WebApi中无status,返回值:" + result);
}
QztlPatientRegisterFromInterface? resultDto = JsonConvert.DeserializeObject<QztlPatientRegisterFromInterface>(result); QztlPatientRegisterFromInterface? resultDto = JsonConvert.DeserializeObject<QztlPatientRegisterFromInterface>(result);
if (resultDto != null) if (resultDto != null)
{ {
@ -632,7 +657,7 @@ namespace Shentun.Peis.PlugIns.Gem
public async Task NoteOk(List<string> successIds, List<string> deleteIds) public async Task NoteOk(List<string> successIds, List<string> deleteIds)
{ {
if(successIds == null || deleteIds == null)
if (successIds == null || deleteIds == null)
{ {
return; return;
} }
@ -642,9 +667,9 @@ namespace Shentun.Peis.PlugIns.Gem
return; return;
} }
string successIdStr = ""; string successIdStr = "";
for (var i = 0 ; i < successIds.Count; i++)
for (var i = 0; i < successIds.Count; i++)
{ {
if(i == 0)
if (i == 0)
{ {
successIdStr = successIds[i]; successIdStr = successIds[i];
} }
@ -725,7 +750,7 @@ namespace Shentun.Peis.PlugIns.Gem
} }
return; return;
} }
return ;
return;
} }
} }

2
test/Shentun.Peis.Application.Tests/PrintReportAppServiceTest.cs

@ -34,7 +34,7 @@ namespace Shentun.Peis
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{ {
var items = await _appService.GetLisRequestReportByPatientRegisterIdAsync(new PatientRegisterIdInputDto() var items = await _appService.GetLisRequestReportByPatientRegisterIdAsync(new PatientRegisterIdInputDto()
{ PatientRegisterId = new Guid("3a127094-8fcf-78cc-3397-dedd7decb7b4") });
{ PatientRegisterId = new Guid("3a12815b-da56-ef02-4782-5760e0965cd8") });
_output.WriteLine(items.Count().ToString()); _output.WriteLine(items.Count().ToString());
foreach (var item in items) foreach (var item in items)
{ {

Loading…
Cancel
Save