渝北独立BUG修复版本

parent 258012cb
......@@ -7,7 +7,7 @@
},
"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=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;"
},
"Application": {
......
......@@ -700,8 +700,8 @@ public bool IssuedChangeSecond(per_allot allot, List<ag_secondallot> secondList)
second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交";
}
_service.FreezeAllotSync(allot.ID);
_service.SecondUseTempRestoreSync();
_service.RestoreSecondAllotAsync();
_service.SecondUseTempRestore();
_service.RestoreSecondAllot();
}
}
perforAgsecondallotRepository.UpdateRange(updSeconds.ToArray());
......
......@@ -353,7 +353,7 @@ public void Generate(per_allot allot)
// 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)
//logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
//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);
_service.SecondUseTempRestore();
_service.RestoreSecondAllot();
_service.ClearAllot();
logManageService.WriteMsg("正在生成绩效", "绩效数据存储", 1, allot.ID, "ReceiveMessage", true);
_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);
// 验证科室核算单元、工号
_allotRepository.AccoungtingVerify(allot.ID);
logManageService.WriteMsg("额外操作", "补全支出费用类别", 1, allot.ID, "ReceiveMessage", true);
//补全支出费用类别
configService.SaveDrugtypeDisburse(allot.ID);
//logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
......@@ -473,12 +481,12 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
//SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 5, allot.ID, "ReceiveMessage", true);
logManageService.WriteMsg("操作结束", "操作结束", 5, allot.ID, "ReceiveMessage", true);
}
catch (Exception ex)
{
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);
//throw ex;
}
......
......@@ -30,7 +30,15 @@ public DapperService(IOptions<AppConnection> options)
/// <returns></returns>
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>
......@@ -80,24 +88,23 @@ decimal QueryDiff(int allotId)
/// 二次分配模板修复
/// </summary>
/// <param name="allotId"></param>
public void SecondUseTempRestoreSync()
public void SecondUseTempRestore()
{
Task.Factory.StartNew(() =>
try
{
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;
}
}
});
}
catch (Exception)
{
throw;
}
}
#endregion
......@@ -106,24 +113,21 @@ public void SecondUseTempRestoreSync()
/// 清理无效绩效数据
/// </summary>
/// <param name="allotId"></param>
public void ClearAllotSync()
public void ClearAllot()
{
Task.Factory.StartNew(() =>
try
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
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
......@@ -252,10 +256,8 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam
/// 科室改名历史数据处理
/// </summary>
/// <param name="allotId"></param>
public Task RestoreSecondAllotAsync()
{
return Task.Factory.StartNew(() =>
{
public void RestoreSecondAllot()
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
......@@ -268,8 +270,7 @@ public Task RestoreSecondAllotAsync()
{
throw;
}
}
});
}
}
public IEnumerable<dynamic> QuerySecondPrintHead(int allotId, string unitType, string accountingUnit)
......@@ -312,5 +313,16 @@ public IEnumerable<dynamic> QueryView(string viewName,int allotID)
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)
agsecondallotRepository.DeleteComputeHistory(request.SecondId);
if (request.IsPass == 1)
_service.FreezeAllotSync(second.AllotId.Value);
_service.SecondUseTempRestoreSync();
_service.RestoreSecondAllotAsync();
_service.SecondUseTempRestore();
_service.RestoreSecondAllot();
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