Browse Source

同步

bjmzak
wxd 2 years ago
parent
commit
82ba772b55
  1. 2
      src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs
  2. 9
      src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs
  3. 167
      src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs

2
src/Shentun.Peis.Application.Contracts/SumSuggestionHeaders/SumSuggestionDto.cs

@ -6,6 +6,8 @@ namespace Shentun.Peis.SumSuggestionHeaders
{ {
public class SumSuggestionDto public class SumSuggestionDto
{ {
public Guid PatientRegisterId { get; set; }
/// <summary> /// <summary>
/// 建议标题 /// 建议标题
/// </summary> /// </summary>

9
src/Shentun.Peis.Application/SumSuggestionHeaders/SumSuggestionHeaderAppService.cs

@ -124,6 +124,7 @@ namespace Shentun.Peis.SumSuggestionHeaders
DisplayOrder = sa.sumSuggestionContentHaveEmpty.DisplayOrder, DisplayOrder = sa.sumSuggestionContentHaveEmpty.DisplayOrder,
SuggestionContent = sa.sumSuggestionContentHaveEmpty.SuggestionContent, SuggestionContent = sa.sumSuggestionContentHaveEmpty.SuggestionContent,
}).OrderBy(o => o.DisplayOrder).Distinct().ToList(), }).OrderBy(o => o.DisplayOrder).Distinct().ToList(),
PatientRegisterId = input.PatientRegisterId
}).OrderBy(o => o.DisplayOrder).ToList(); }).OrderBy(o => o.DisplayOrder).ToList();
} }
@ -188,7 +189,8 @@ namespace Shentun.Peis.SumSuggestionHeaders
SuggestionContent = x.SuggestionContent, SuggestionContent = x.SuggestionContent,
DisplayOrder = x.DisplayOrder, DisplayOrder = x.DisplayOrder,
} }
).ToList()
).ToList(),
PatientRegisterId = input.PatientRegisterId
}; };
msg.Add(sumSuggestionDto); msg.Add(sumSuggestionDto);
} }
@ -205,11 +207,14 @@ namespace Shentun.Peis.SumSuggestionHeaders
SuggestionFlag = null, SuggestionFlag = null,
DisplayOrder = 0, DisplayOrder = 0,
DiagnosisIds = null, DiagnosisIds = null,
DiagnosisNames = null
DiagnosisNames = null,
PatientRegisterId = input.PatientRegisterId
}); });
} }
} }
return msg; return msg;
} }

167
src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs

@ -83,94 +83,90 @@ namespace Shentun.Peis.TransToWebPeis
[HttpPost("api/app/TransToWebPeis/TransBaseData")] [HttpPost("api/app/TransToWebPeis/TransBaseData")]
public async Task TransBaseDataAsync() 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> /// <summary>
/// 根据人员登记ID上传人员体检信息 /// 根据人员登记ID上传人员体检信息
/// </summary> /// </summary>
@ -179,15 +175,28 @@ namespace Shentun.Peis.TransToWebPeis
[HttpPost("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId")] [HttpPost("api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId")]
public async Task TransPatientRegisterByPatientRegisterIdAsync(PatientRegisterIdInputDto input) 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> /// <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," + 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," + "price, device_type_id, is_before_eat, clinical_meaning, default_result," +
"is_picture_rotate, is_check, is_active, simple_code, display_order, concurrency_stamp," + "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," + "(@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," + "@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 List<SugarParameter>() {
new SugarParameter("asbitem_id",asbitem.Id), new SugarParameter("asbitem_id",asbitem.Id),
new SugarParameter("asbitem_name",asbitem.DisplayName), new SugarParameter("asbitem_name",asbitem.DisplayName),
@ -342,7 +351,9 @@ namespace Shentun.Peis.TransToWebPeis
new SugarParameter("creator_id",asbitem.CreatorId), new SugarParameter("creator_id",asbitem.CreatorId),
new SugarParameter("last_modification_time",asbitem.LastModificationTime), new SugarParameter("last_modification_time",asbitem.LastModificationTime),
new SugarParameter("last_modifier_id",asbitem.LastModifierId), 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)
}); });
//插入明细 //插入明细

Loading…
Cancel
Save