|
|
|
@ -121,6 +121,13 @@ namespace Shentun.Peis.Schedulers |
|
|
|
var reportApiBaseAddress = interfaceConfig.GetSection("Interface").GetSection("ReportApiBaseAddress").Value; |
|
|
|
var reportApiUrl = interfaceConfig.GetSection("Interface").GetSection("ReportApiUrl").Value; |
|
|
|
|
|
|
|
//是否开启自动导报告
|
|
|
|
var IsSyncReport = interfaceConfig.GetSection("Interface").GetSection("Scheduler") |
|
|
|
.GetSection("IsSyncReport").Value; |
|
|
|
|
|
|
|
//是否开启同步预登记数据
|
|
|
|
var IsSyncPreRegister = interfaceConfig.GetSection("Interface").GetSection("Scheduler") |
|
|
|
.GetSection("IsSyncPreRegister").Value; |
|
|
|
|
|
|
|
SyncPatientRegisterReportInputDto input = new SyncPatientRegisterReportInputDto |
|
|
|
{ |
|
|
|
@ -134,60 +141,66 @@ namespace Shentun.Peis.Schedulers |
|
|
|
object[] classConstructorArg = new object[] { thirdInterfaceDto.Id }; |
|
|
|
object[] objects = [input]; |
|
|
|
|
|
|
|
var pluginsOut = ReflectionHelper.InvokeAsync<List<SyncPatientRegisterIdsDto>>(assemblyName, className, classConstructorArg, funName, objects).Result; |
|
|
|
|
|
|
|
#region 同步备单数据
|
|
|
|
|
|
|
|
var preRegistrationFunName = "GetSyncPreRegistrationPatientRegisterIds"; |
|
|
|
var preRegistrationPluginsOut = ReflectionHelper.InvokeAsync<List<SyncPatientRegisterIdsDto>>(assemblyName, className, classConstructorArg, preRegistrationFunName, objects).Result; |
|
|
|
#region 同步备单数据
|
|
|
|
|
|
|
|
if (preRegistrationPluginsOut.Any()) |
|
|
|
if (IsSyncPreRegister == "Y") |
|
|
|
{ |
|
|
|
var preRegistrationFunName = "GetSyncPreRegistrationPatientRegisterIds"; |
|
|
|
var preRegistrationPluginsOut = ReflectionHelper.InvokeAsync<List<SyncPatientRegisterIdsDto>>(assemblyName, className, classConstructorArg, preRegistrationFunName, objects).Result; |
|
|
|
|
|
|
|
foreach (var item in preRegistrationPluginsOut) |
|
|
|
if (preRegistrationPluginsOut.Any()) |
|
|
|
{ |
|
|
|
|
|
|
|
PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto |
|
|
|
foreach (var item in preRegistrationPluginsOut) |
|
|
|
{ |
|
|
|
PatientRegisterId = item.Id |
|
|
|
}; |
|
|
|
|
|
|
|
appServiceHelper.CallAppService<object, object>("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId", patientRegisterIdDto); |
|
|
|
} |
|
|
|
PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto |
|
|
|
{ |
|
|
|
PatientRegisterId = item.Id |
|
|
|
}; |
|
|
|
|
|
|
|
appServiceHelper.CallAppService<object, object>("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId", patientRegisterIdDto); |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogError("同步预登记数据成功"); |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogError("同步预登记数据成功"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//需要同步报告的数据
|
|
|
|
if (pluginsOut.Any()) |
|
|
|
#region 同步报告
|
|
|
|
if (IsSyncReport == "Y") |
|
|
|
{ |
|
|
|
// pluginsOut = pluginsOut.Take(10).ToList();
|
|
|
|
|
|
|
|
foreach (var item in pluginsOut) |
|
|
|
//需要同步报告的数据
|
|
|
|
var pluginsOut = ReflectionHelper.InvokeAsync<List<SyncPatientRegisterIdsDto>>(assemblyName, className, classConstructorArg, funName, objects).Result; |
|
|
|
if (pluginsOut.Any()) |
|
|
|
{ |
|
|
|
// pluginsOut = pluginsOut.Take(10).ToList();
|
|
|
|
|
|
|
|
PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto |
|
|
|
foreach (var item in pluginsOut) |
|
|
|
{ |
|
|
|
PatientRegisterId = item.Id |
|
|
|
}; |
|
|
|
|
|
|
|
appServiceHelper.CallAppService<object, object>("api/app/TransToWebPeis/SyncPatientRegisterReportByPatientRegisterId", patientRegisterIdDto); |
|
|
|
} |
|
|
|
PatientRegisterIdInputDto patientRegisterIdDto = new PatientRegisterIdInputDto |
|
|
|
{ |
|
|
|
PatientRegisterId = item.Id |
|
|
|
}; |
|
|
|
|
|
|
|
appServiceHelper.CallAppService<object, object>("api/app/TransToWebPeis/SyncPatientRegisterReportByPatientRegisterId", patientRegisterIdDto); |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogError($"同步数据成功:人员登记ID[{string.Join(',', pluginsOut.Select(s => s.Id))}]"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Logger.LogError("无数据需要同步"); |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogError($"同步数据成功:人员登记ID[{string.Join(',', pluginsOut.Select(s => s.Id))}]"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Logger.LogError("无数据需要同步"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|