|
|
|
@ -43,15 +43,18 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
{ |
|
|
|
await LoginAsync(); |
|
|
|
await InitAsync(); |
|
|
|
for(var i = 0;i<30;i++) |
|
|
|
for (var i = 0; i < 30; i++) |
|
|
|
{ |
|
|
|
var qztlPatientRegisterFromInterface = await CallInterfaceServiceAsync(); |
|
|
|
if (qztlPatientRegisterFromInterface == null || !qztlPatientRegisterFromInterface.plans.Any()) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//设置导入人员信息
|
|
|
|
foreach (var patient in qztlPatientRegisterFromInterface.plans) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
//婚姻状况
|
|
|
|
var maritalStatusId = ConvertMaritalStatus(patient.wedding); |
|
|
|
@ -116,7 +119,7 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
customerOrgDto = await CallAppServiceAsync<CreateCustomerOrgDto, CustomerOrgDto>( |
|
|
|
"api/app/customerorg/create", new CreateCustomerOrgDto() |
|
|
|
{ |
|
|
|
MedicalCenterId = _customerOrgDto.MedicalCenterId , |
|
|
|
MedicalCenterId = _customerOrgDto.MedicalCenterId, |
|
|
|
ParentId = _importCustomerOrgId, |
|
|
|
DisplayName = orgName, |
|
|
|
ShortName = orgName, |
|
|
|
@ -272,6 +275,25 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
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 = result.Replace(":\"[{", ":[{").Replace("}]\"", "}]").Replace("\\", ""); |
|
|
|
|
|
|
|
if(result.IndexOf("status") < 0) |
|
|
|
{ |
|
|
|
throw new Exception($"调用WebApi中无status,返回值:" + result); |
|
|
|
} |
|
|
|
QztlPatientRegisterFromInterface? resultDto = JsonConvert.DeserializeObject<QztlPatientRegisterFromInterface>(result); |
|
|
|
if (resultDto != null) |
|
|
|
{ |
|
|
|
@ -632,7 +657,7 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
|
|
|
|
public async Task NoteOk(List<string> successIds, List<string> deleteIds) |
|
|
|
{ |
|
|
|
if(successIds == null || deleteIds == null) |
|
|
|
if (successIds == null || deleteIds == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -642,9 +667,9 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
return; |
|
|
|
} |
|
|
|
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]; |
|
|
|
} |
|
|
|
@ -725,7 +750,7 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|