重复保存修复

parent 7472ddda
......@@ -47,7 +47,7 @@ public class ResultComputeService : IAutoInjection
/// 计算最终数据
/// </summary>
/// <param name="excel"></param>
public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerSheet> accountSheet)
public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerSheet> accountSheet, bool isSave = true)
{
//取出人员信息
var empolyeeList = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID);
......@@ -67,10 +67,13 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerShee
//计算 行政人员 平均值
baiscNormService.ComputeOtherAvg(baiscnormList, computResult2, empolyeeList);
var computes = Mapper.Map<List<res_compute>>(computResult);
computes.AddRange(Mapper.Map<List<res_compute>>(computResult2));
computes.ForEach(t => t.AllotID = allot.ID);
perforRescomputeRepository.AddRange(computes.ToArray());
if (isSave)
{
var computes = Mapper.Map<List<res_compute>>(computResult);
computes.AddRange(Mapper.Map<List<res_compute>>(computResult2));
computes.ForEach(t => t.AllotID = allot.ID);
perforRescomputeRepository.AddRange(computes.ToArray());
}
baiscnormList.ForEach(t => t.AllotID = allot.ID);
logManageService.WriteMsg("正在生成绩效", "保存最终绩效数据", 1, allot.ID, "ReceiveMessage");
......
......@@ -258,7 +258,7 @@ public void Generate(per_allot allot, string mail)
//计算各人群人均保底绩效
logManageService.WriteMsg("计算保底绩效参考标准值", "正在生成保底绩效行政工勤人均绩效", 1, allot.ID, "ReceiveMessage", true);
var minimumBaiscnorm2 = resultComputeService.Compute(allot, excel, sheet);
var minimumBaiscnorm2 = resultComputeService.Compute(allot, excel, sheet, false);
if (minimumBaiscnorm2 != null && minimumBaiscnorm2.Any(t => t.PositionName == EnumHelper.GetDescription(PerforType.行政工勤)))
{
var minimum = minimumBaiscnorm2.First(t => t.PositionName == EnumHelper.GetDescription(PerforType.行政工勤));
......
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