二次分配确认机制: gitflow-hotfix-stash: 二次分配保存前重新计算

parent a607506f
...@@ -765,6 +765,13 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request) ...@@ -765,6 +765,13 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
var cleanDatas = request.Body.Where(w => w.Count > 0 && w.GetValue(nameof(ResponseType), "") == ResponseType.OK.ToString()).ToList(); var cleanDatas = request.Body.Where(w => w.Count > 0 && w.GetValue(nameof(ResponseType), "") == ResponseType.OK.ToString()).ToList();
if (cleanDatas == null || cleanDatas.Count == 0) if (cleanDatas == null || cleanDatas.Count == 0)
throw new PerformanceException("提交参数都是无效数据,请重新填写数据后保存!"); throw new PerformanceException("提交参数都是无效数据,请重新填写数据后保存!");
// 计算提交数据结果
_redistributionService.ResultCompute((ComputeMode)request.ComputeMode, request.Head, cleanDatas, loads, workloadGroups);
// 补充医院其他绩效
_redistributionService.SupplementOtherPerfor(second, cleanDatas);
// 重算部分数据
_redistributionService.RedistributionCompute((ComputeMode)request.ComputeMode, request.Head, cleanDatas);
var result = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas); var result = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas);
return result ? new ApiResponse(ResponseType.OK) : new ApiResponse(ResponseType.Fail, "保存失败"); return result ? new ApiResponse(ResponseType.OK) : new ApiResponse(ResponseType.Fail, "保存失败");
...@@ -823,6 +830,14 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request) ...@@ -823,6 +830,14 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
if (cleanDatas == null || cleanDatas.Count == 0) if (cleanDatas == null || cleanDatas.Count == 0)
throw new PerformanceException("提交参数都是无效数据,请重新填写数据后查看计算结果!"); throw new PerformanceException("提交参数都是无效数据,请重新填写数据后查看计算结果!");
// 计算提交数据结果
_redistributionService.ResultCompute((ComputeMode)request.ComputeMode, request.Head, cleanDatas, loads, workloadGroups);
// 补充医院其他绩效
_redistributionService.SupplementOtherPerfor(second, cleanDatas);
// 重算部分数据
_redistributionService.RedistributionCompute((ComputeMode)request.ComputeMode, request.Head, cleanDatas);
var saveResult = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas); var saveResult = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas);
if (saveResult) if (saveResult)
{ {
......
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