|
|
|
@ -83,94 +83,90 @@ namespace Shentun.Peis.TransToWebPeis |
|
|
|
[HttpPost("api/app/TransToWebPeis/TransBaseData")] |
|
|
|
public async Task TransBaseDataAsync() |
|
|
|
{ |
|
|
|
//var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType ==
|
|
|
|
//ThirdInterfaceTypeFlag.TranToWebPeis && o.IsActive == 'Y');
|
|
|
|
//foreach (var thirdInterface in thirdInterfaces)
|
|
|
|
//{
|
|
|
|
// var connectString = GetConnectionStrings(thirdInterface.ParmValue);
|
|
|
|
var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType == |
|
|
|
ThirdInterfaceTypeFlag.TranToWebPeis); |
|
|
|
foreach (var thirdInterface in thirdInterfaces) |
|
|
|
{ |
|
|
|
var connectString = GetConnectionStrings(thirdInterface.ParmValue); |
|
|
|
|
|
|
|
// SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
// {
|
|
|
|
// ConnectionString = connectString,
|
|
|
|
// DbType = SqlSugar.DbType.PostgreSQL,
|
|
|
|
// IsAutoCloseConnection = true
|
|
|
|
// });
|
|
|
|
SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() |
|
|
|
{ |
|
|
|
ConnectionString = connectString, |
|
|
|
DbType = SqlSugar.DbType.PostgreSQL, |
|
|
|
IsAutoCloseConnection = true |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// await TransItemType(WebDb);
|
|
|
|
// await TransItem(connectString);
|
|
|
|
// await TransAsbitem(connectString);
|
|
|
|
// await TransMedicalPackage(connectString);
|
|
|
|
// await TransDiagnosis(connectString);
|
|
|
|
//}
|
|
|
|
#region 清理基础数据
|
|
|
|
//删除
|
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from medical_package_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from medical_package;"); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_register;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org;"); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis_level;"); |
|
|
|
|
|
|
|
var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"; |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from asbitem_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from asbitem;"); |
|
|
|
|
|
|
|
SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() |
|
|
|
{ |
|
|
|
ConnectionString = connectString, |
|
|
|
DbType = SqlSugar.DbType.PostgreSQL, |
|
|
|
IsAutoCloseConnection = true |
|
|
|
}); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from item"); |
|
|
|
|
|
|
|
#region 清理基础数据
|
|
|
|
//删除
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from item_type"); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from medical_package_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from medical_package;"); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_group;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org_register;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from customer_org;"); |
|
|
|
await TransItemType(WebDb); |
|
|
|
await TransItem(WebDb); |
|
|
|
await TransAsbitem(WebDb); |
|
|
|
await TransMedicalPackage(WebDb); |
|
|
|
await TransDiagnosis(WebDb); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from diagnosis_level;"); |
|
|
|
await TransCustomerOrgAsync(WebDb); |
|
|
|
await TransCustomerOrgRegisterAsync(WebDb); |
|
|
|
await TransCustomerOrgGroupAsync(WebDb); |
|
|
|
await TransCustomerOrgGroupDetailAsync(WebDb); |
|
|
|
} |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from asbitem_detail;"); |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from asbitem;"); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from item"); |
|
|
|
|
|
|
|
await WebDb.Ado.ExecuteCommandAsync("delete from item_type"); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
//var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;";
|
|
|
|
|
|
|
|
await TransItemType(WebDb); |
|
|
|
await TransItem(WebDb); |
|
|
|
await TransAsbitem(WebDb); |
|
|
|
await TransMedicalPackage(WebDb); |
|
|
|
await TransDiagnosis(WebDb); |
|
|
|
//SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
//{
|
|
|
|
// ConnectionString = connectString,
|
|
|
|
// DbType = SqlSugar.DbType.PostgreSQL,
|
|
|
|
// IsAutoCloseConnection = true
|
|
|
|
//});
|
|
|
|
|
|
|
|
await TransCustomerOrgAsync(WebDb); |
|
|
|
await TransCustomerOrgRegisterAsync(WebDb); |
|
|
|
await TransCustomerOrgGroupAsync(WebDb); |
|
|
|
await TransCustomerOrgGroupDetailAsync(WebDb); |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 上传单位信息
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("api/app/TransToWebPeis/TransCustomerOrg")] |
|
|
|
public async Task TransCustomerOrgWithDetailAsync() |
|
|
|
{ |
|
|
|
//customer_org,customer_org_register
|
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 上传人员体检信息
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("api/app/TransToWebPeis/TransPatientRegister")] |
|
|
|
public async Task TransPatientRegisterAsync() |
|
|
|
{ |
|
|
|
//patient,patient_register,register_check,register_check_asbitem
|
|
|
|
//register_check_item,register_check_picture,register_check_summary,register_check_suggestion
|
|
|
|
//sum_summary_header,sum_summary_content,sum_suggestion_header,sum_suggestion_content,sum_diagnosis,
|
|
|
|
|
|
|
|
} |
|
|
|
///// <summary>
|
|
|
|
///// 上传单位信息
|
|
|
|
///// </summary>
|
|
|
|
///// <returns></returns>
|
|
|
|
//[HttpPost("api/app/TransToWebPeis/TransCustomerOrg")]
|
|
|
|
//public async Task TransCustomerOrgWithDetailAsync()
|
|
|
|
//{
|
|
|
|
// //customer_org,customer_org_register
|
|
|
|
//}
|
|
|
|
///// <summary>
|
|
|
|
///// 上传人员体检信息
|
|
|
|
///// </summary>
|
|
|
|
///// <returns></returns>
|
|
|
|
//[HttpPost("api/app/TransToWebPeis/TransPatientRegister")]
|
|
|
|
//public async Task TransPatientRegisterAsync()
|
|
|
|
//{
|
|
|
|
// //patient,patient_register,register_check,register_check_asbitem
|
|
|
|
// //register_check_item,register_check_picture,register_check_summary,register_check_suggestion
|
|
|
|
// //sum_summary_header,sum_summary_content,sum_suggestion_header,sum_suggestion_content,sum_diagnosis,
|
|
|
|
|
|
|
|
//}
|
|
|
|
/// <summary>
|
|
|
|
/// 根据人员登记ID上传人员体检信息
|
|
|
|
/// </summary>
|
|
|
|
@ -179,15 +175,28 @@ namespace Shentun.Peis.TransToWebPeis |
|
|
|
[HttpPost("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId")] |
|
|
|
public async Task TransPatientRegisterByPatientRegisterIdAsync(PatientRegisterIdInputDto input) |
|
|
|
{ |
|
|
|
var connectString = "Host=10.1.12.140;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"; |
|
|
|
|
|
|
|
SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() |
|
|
|
var thirdInterfaces = await _thirdInterfaceRepository.GetListAsync(o => o.ThirdInterfaceType == |
|
|
|
ThirdInterfaceTypeFlag.TranToWebPeis); |
|
|
|
foreach (var thirdInterface in thirdInterfaces) |
|
|
|
{ |
|
|
|
ConnectionString = connectString, |
|
|
|
DbType = SqlSugar.DbType.PostgreSQL, |
|
|
|
IsAutoCloseConnection = true |
|
|
|
}); |
|
|
|
await TransPatientRegisterWithDetailAsync(WebDb, input.PatientRegisterId); |
|
|
|
var connectString = GetConnectionStrings(thirdInterface.ParmValue); |
|
|
|
|
|
|
|
SqlSugarClient WebDb = new SqlSugarClient(new ConnectionConfig() |
|
|
|
{ |
|
|
|
ConnectionString = connectString, |
|
|
|
DbType = SqlSugar.DbType.PostgreSQL, |
|
|
|
IsAutoCloseConnection = true |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await TransPatientRegisterWithDetailAsync(WebDb, input.PatientRegisterId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 撤销上传人员体检信息
|
|
|
|
@ -317,10 +326,10 @@ namespace Shentun.Peis.TransToWebPeis |
|
|
|
await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.asbitem(asbitem_id, asbitem_name, short_name, for_sex_id, item_type_id," + |
|
|
|
"price, device_type_id, is_before_eat, clinical_meaning, default_result," + |
|
|
|
"is_picture_rotate, is_check, is_active, simple_code, display_order, concurrency_stamp," + |
|
|
|
"creation_time, creator_id, last_modification_time, last_modifier_id, is_web_appoint) values " + |
|
|
|
"creation_time, creator_id, last_modification_time, last_modifier_id, is_web_appoint,warn,disease_screening_type_id) values " + |
|
|
|
"(@asbitem_id,@asbitem_name,@short_name,@for_sex_id,@item_type_id,@price,@device_type_id::uuid,@is_before_eat,@clinical_meaning," + |
|
|
|
"@default_result,@is_picture_rotate,@is_check,@is_active,@simple_code,@display_order,@concurrency_stamp,@creation_time," + |
|
|
|
"@creator_id,@last_modification_time,@last_modifier_id,@is_web_appoint)", |
|
|
|
"@creator_id,@last_modification_time,@last_modifier_id,@is_web_appoint,@warn,@disease_screening_type_id::uuid)", |
|
|
|
new List<SugarParameter>() { |
|
|
|
new SugarParameter("asbitem_id",asbitem.Id), |
|
|
|
new SugarParameter("asbitem_name",asbitem.DisplayName), |
|
|
|
@ -342,7 +351,9 @@ namespace Shentun.Peis.TransToWebPeis |
|
|
|
new SugarParameter("creator_id",asbitem.CreatorId), |
|
|
|
new SugarParameter("last_modification_time",asbitem.LastModificationTime), |
|
|
|
new SugarParameter("last_modifier_id",asbitem.LastModifierId), |
|
|
|
new SugarParameter("is_web_appoint",asbitem.IsWebAppoint) |
|
|
|
new SugarParameter("is_web_appoint",asbitem.IsWebAppoint), |
|
|
|
new SugarParameter("warn",asbitem.Warn), |
|
|
|
new SugarParameter("disease_screening_type_id",asbitem.DiseaseScreeningTypeId) |
|
|
|
}); |
|
|
|
|
|
|
|
//插入明细
|
|
|
|
|