清理无效数据

parent f7c427b1
......@@ -447,9 +447,10 @@ public void Generate(per_allot allot)
//resultComputeService.SaveReserved(allot, allot.HospitalId);
// 科室创建但不下发
resultComputeService.GenerateSecondAllot(allot);
resultComputeService.GenerateSecondAllot(allot);
_service.FreezeAllotSync(allot.ID);
_service.SecondUseTempRestoreSync();
_service.ClearAllotSync();
UpdateAllotStates(allot.ID, (int)AllotStates.绩效结果解析成功, EnumHelper.GetDescription(AllotStates.绩效结果解析成功), generate);
perforCofdirectorRepository.SupplementaryData(allot.ID);
......
......@@ -58,29 +58,48 @@ public void FreezeAllot(int allotId)
/// <param name="allotId"></param>
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>
/// <param name="allotId"></param>
/// <returns></returns>
public void SecondUseTempRestore()
public void ClearAllotSync()
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
Task.Factory.StartNew(() =>
{
if (connection.State != ConnectionState.Open) connection.Open();
try
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
string sql = $@"call proc_second_restore()";
connection.Execute(sql, commandTimeout: 60 * 60);
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = $@"call proc_clear_allot()";
connection.Execute(sql, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
catch (Exception)
{
throw;
}
}
});
}
#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