清理无效数据

parent f7c427b1
...@@ -447,9 +447,10 @@ public void Generate(per_allot allot) ...@@ -447,9 +447,10 @@ public void Generate(per_allot allot)
//resultComputeService.SaveReserved(allot, allot.HospitalId); //resultComputeService.SaveReserved(allot, allot.HospitalId);
// 科室创建但不下发 // 科室创建但不下发
resultComputeService.GenerateSecondAllot(allot); resultComputeService.GenerateSecondAllot(allot);
_service.FreezeAllotSync(allot.ID); _service.FreezeAllotSync(allot.ID);
_service.SecondUseTempRestoreSync(); _service.SecondUseTempRestoreSync();
_service.ClearAllotSync();
UpdateAllotStates(allot.ID, (int)AllotStates.绩效结果解析成功, EnumHelper.GetDescription(AllotStates.绩效结果解析成功), generate); UpdateAllotStates(allot.ID, (int)AllotStates.绩效结果解析成功, EnumHelper.GetDescription(AllotStates.绩效结果解析成功), generate);
perforCofdirectorRepository.SupplementaryData(allot.ID); perforCofdirectorRepository.SupplementaryData(allot.ID);
......
...@@ -58,29 +58,48 @@ public void FreezeAllot(int allotId) ...@@ -58,29 +58,48 @@ public void FreezeAllot(int allotId)
/// <param name="allotId"></param> /// <param name="allotId"></param>
public void SecondUseTempRestoreSync() public void SecondUseTempRestoreSync()
{ {
Task.Factory.StartNew(() => SecondUseTempRestore()); Task.Factory.StartNew(() =>
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = $@"call proc_second_restore()";
connection.Execute(sql, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
});
} }
#endregion
#region 清理无效绩效数据
/// <summary> /// <summary>
/// 数据静态存储 /// 清理无效绩效数据
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
/// <returns></returns> public void ClearAllotSync()
public void SecondUseTempRestore()
{ {
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString)) Task.Factory.StartNew(() =>
{ {
if (connection.State != ConnectionState.Open) connection.Open(); using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
try
{ {
string sql = $@"call proc_second_restore()"; if (connection.State != ConnectionState.Open) connection.Open();
connection.Execute(sql, commandTimeout: 60 * 60); try
{
string sql = $@"call proc_clear_allot()";
connection.Execute(sql, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
} }
catch (Exception) });
{
throw;
}
}
} }
#endregion #endregion
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment