渝北独立BUG修复版本

parent 258012cb
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" "PerformanceConnectionString": "server=192.168.18.166;database=db_test_beiliu;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
//"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;" //"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
}, },
"Application": { "Application": {
......
...@@ -700,8 +700,8 @@ public bool IssuedChangeSecond(per_allot allot, List<ag_secondallot> secondList) ...@@ -700,8 +700,8 @@ public bool IssuedChangeSecond(per_allot allot, List<ag_secondallot> secondList)
second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交"; second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交";
} }
_service.FreezeAllotSync(allot.ID); _service.FreezeAllotSync(allot.ID);
_service.SecondUseTempRestoreSync(); _service.SecondUseTempRestore();
_service.RestoreSecondAllotAsync(); _service.RestoreSecondAllot();
} }
} }
perforAgsecondallotRepository.UpdateRange(updSeconds.ToArray()); perforAgsecondallotRepository.UpdateRange(updSeconds.ToArray());
......
...@@ -353,7 +353,7 @@ public void Generate(per_allot allot) ...@@ -353,7 +353,7 @@ public void Generate(per_allot allot)
// return; // return;
//} //}
} }
UpdateAllotStates(allot.ID, (int)AllotStates.正在生成绩效, EnumHelper.GetDescription(AllotStates.正在生成绩效)); _service.UpdateAllotStates(allot.ID, (int)AllotStates.正在生成绩效, EnumHelper.GetDescription(AllotStates.正在生成绩效));
//保底绩效计算需分两次进行; //保底绩效计算需分两次进行;
//第一次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)得出科室业绩绩效; //第一次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)得出科室业绩绩效;
...@@ -450,17 +450,25 @@ public void Generate(per_allot allot) ...@@ -450,17 +450,25 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
//resultComputeService.SaveReserved(allot, allot.HospitalId); //resultComputeService.SaveReserved(allot, allot.HospitalId);
logManageService.WriteMsg("正在生成绩效", "验证科室核算单元&工号", 1, allot.ID, "ReceiveMessage", true);
// 验证科室核算单元、工号
_allotRepository.AccoungtingVerify(allot.ID);
logManageService.WriteMsg("正在生成绩效", "待下发科室准备", 1, allot.ID, "ReceiveMessage", true);
// 科室创建但不下发 // 科室创建但不下发
resultComputeService.GenerateSecondAllot(allot); resultComputeService.GenerateSecondAllot(allot);
_service.SecondUseTempRestore();
_service.RestoreSecondAllot();
_service.ClearAllot();
logManageService.WriteMsg("正在生成绩效", "绩效数据存储", 1, allot.ID, "ReceiveMessage", true);
_service.FreezeAllotSync(allot.ID); _service.FreezeAllotSync(allot.ID);
_service.SecondUseTempRestoreSync();
_service.RestoreSecondAllotAsync();
_service.ClearAllotSync();
UpdateAllotStates(allot.ID, (int)AllotStates.绩效结果解析成功, EnumHelper.GetDescription(AllotStates.绩效结果解析成功), generate); logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 1, allot.ID, "ReceiveMessage", true);
_service.UpdateAllotStates(allot.ID, (int)AllotStates.绩效结果解析成功, EnumHelper.GetDescription(AllotStates.绩效结果解析成功), generate);
logManageService.WriteMsg("额外操作", "补充费用占比类型", 1, allot.ID, "ReceiveMessage", true);
perforCofdirectorRepository.SupplementaryData(allot.ID); perforCofdirectorRepository.SupplementaryData(allot.ID);
// 验证科室核算单元、工号 logManageService.WriteMsg("额外操作", "补全支出费用类别", 1, allot.ID, "ReceiveMessage", true);
_allotRepository.AccoungtingVerify(allot.ID);
//补全支出费用类别 //补全支出费用类别
configService.SaveDrugtypeDisburse(allot.ID); configService.SaveDrugtypeDisburse(allot.ID);
//logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
...@@ -473,12 +481,12 @@ public void Generate(per_allot allot) ...@@ -473,12 +481,12 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
//SendEmail(allot, mail, 1, time); //SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功"); //logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 5, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("操作结束", "操作结束", 5, allot.ID, "ReceiveMessage", true);
} }
catch (Exception ex) catch (Exception ex)
{ {
logManageService.WriteMsg("绩效生成失败", ex.Message, 4, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("绩效生成失败", ex.Message, 4, allot.ID, "ReceiveMessage");
UpdateAllotStates(allot.ID, (int)AllotStates.绩效解析失败, EnumHelper.GetDescription(AllotStates.绩效解析失败)); _service.UpdateAllotStates(allot.ID, (int)AllotStates.绩效解析失败, EnumHelper.GetDescription(AllotStates.绩效解析失败));
//SendEmail(allot, mail, 2, time); //SendEmail(allot, mail, 2, time);
//throw ex; //throw ex;
} }
......
...@@ -30,7 +30,15 @@ public DapperService(IOptions<AppConnection> options) ...@@ -30,7 +30,15 @@ public DapperService(IOptions<AppConnection> options)
/// <returns></returns> /// <returns></returns>
public void FreezeAllotSync(int allotId) public void FreezeAllotSync(int allotId)
{ {
Task.Factory.StartNew(() => FreezeAllot(allotId)); Task.Factory.StartNew(() =>
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
string sql = $@"call proc_freeze_allot({allotId})";
connection.Execute(sql, commandTimeout: 60 * 60);
}
});
} }
/// <summary> /// <summary>
...@@ -80,25 +88,24 @@ decimal QueryDiff(int allotId) ...@@ -80,25 +88,24 @@ decimal QueryDiff(int allotId)
/// 二次分配模板修复 /// 二次分配模板修复
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
public void SecondUseTempRestoreSync() public void SecondUseTempRestore()
{ {
Task.Factory.StartNew(() => try
{ {
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString)) using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{ {
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = $@"call proc_second_restore()"; string sql = $@"call proc_second_restore()";
connection.Execute(sql, commandTimeout: 60 * 60); connection.Execute(sql, commandTimeout: 60 * 60);
}
} }
catch (Exception) catch (Exception)
{ {
throw; throw;
} }
} }
});
}
#endregion #endregion
#region 清理无效绩效数据 #region 清理无效绩效数据
...@@ -106,25 +113,22 @@ public void SecondUseTempRestoreSync() ...@@ -106,25 +113,22 @@ public void SecondUseTempRestoreSync()
/// 清理无效绩效数据 /// 清理无效绩效数据
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
public void ClearAllotSync() public void ClearAllot()
{ {
Task.Factory.StartNew(() => try
{ {
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString)) using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{ {
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = $@"call proc_clear_allot()"; string sql = $@"call proc_clear_allot()";
connection.Execute(sql, commandTimeout: 60 * 60); connection.Execute(sql, commandTimeout: 60 * 60);
} }
}
catch (Exception) catch (Exception)
{ {
throw; throw;
} }
} }
});
}
#endregion #endregion
public void SyncDataToResult(int allotId) public void SyncDataToResult(int allotId)
...@@ -252,9 +256,7 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam ...@@ -252,9 +256,7 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam
/// 科室改名历史数据处理 /// 科室改名历史数据处理
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
public Task RestoreSecondAllotAsync() public void RestoreSecondAllot()
{
return Task.Factory.StartNew(() =>
{ {
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString)) using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{ {
...@@ -269,7 +271,6 @@ public Task RestoreSecondAllotAsync() ...@@ -269,7 +271,6 @@ public Task RestoreSecondAllotAsync()
throw; throw;
} }
} }
});
} }
public IEnumerable<dynamic> QuerySecondPrintHead(int allotId, string unitType, string accountingUnit) public IEnumerable<dynamic> QuerySecondPrintHead(int allotId, string unitType, string accountingUnit)
...@@ -312,5 +313,16 @@ public IEnumerable<dynamic> QueryView(string viewName,int allotID) ...@@ -312,5 +313,16 @@ public IEnumerable<dynamic> QueryView(string viewName,int allotID)
return connection.Query(sql,new { allotID }, commandTimeout: 60 * 60); return connection.Query(sql,new { allotID }, commandTimeout: 60 * 60);
} }
} }
public int UpdateAllotStates(int allotId, int states, string remark, int generate = 0)
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
string sql = $@"update per_allot set States=@states,Remark=@remark,Generate = @generate where Id = @allotId";
return connection.Execute(sql, new { allotId, states, remark, generate }, commandTimeout: 60 * 60);
}
}
} }
} }
...@@ -1740,8 +1740,8 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -1740,8 +1740,8 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
agsecondallotRepository.DeleteComputeHistory(request.SecondId); agsecondallotRepository.DeleteComputeHistory(request.SecondId);
if (request.IsPass == 1) if (request.IsPass == 1)
_service.FreezeAllotSync(second.AllotId.Value); _service.FreezeAllotSync(second.AllotId.Value);
_service.SecondUseTempRestoreSync(); _service.SecondUseTempRestore();
_service.RestoreSecondAllotAsync(); _service.RestoreSecondAllot();
return result; return result;
} }
......
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