一次分配精度问题

parent b20935a5
...@@ -324,7 +324,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot ...@@ -324,7 +324,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
dept.PerforFee = dept.Income * dept.BasicFactor; dept.PerforFee = dept.Income * dept.BasicFactor;
//dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + dept.AssessBeforeOtherFee) ?? 0); //dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + dept.AssessBeforeOtherFee) ?? 0);
dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.AssessBeforeOtherFee) ?? 0); dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.AssessBeforeOtherFee) ?? 0, MidpointRounding.AwayFromZero);
dept.AssessLaterPerforTotal = Math.Round((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra + dept.AssessLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero); dept.AssessLaterPerforTotal = Math.Round((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra + dept.AssessLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero);
dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero); dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero);
//dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number); //dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
...@@ -418,9 +418,9 @@ public void ComputeOffice(per_allot allot, PerExcel excel) ...@@ -418,9 +418,9 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0); dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.PerforTotal = Math.Round(empolyees.Sum(w => w.GiveFee ?? 0)); dept.PerforTotal = Math.Round(empolyees.Sum(w => w.GiveFee ?? 0), MidpointRounding.AwayFromZero);
dept.AssessLaterPerforTotal = Math.Round((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) ?? 0); dept.AssessLaterPerforTotal = Math.Round((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) ?? 0, MidpointRounding.AwayFromZero);
dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0); dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero);
//dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number); //dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number; dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number;
......
...@@ -219,11 +219,11 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -219,11 +219,11 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
NightShiftWorkPerforFee = nightShift, NightShiftWorkPerforFee = nightShift,
}; };
logger.LogInformation($"特殊核算组-{group.AccountingUnit},sumValue:{sumValue},预算比例:{dept?.BasicFactor ?? -100}"); logger.LogInformation($"特殊核算组-{group.AccountingUnit},sumValue:{sumValue},预算比例:{dept?.BasicFactor ?? -100}");
res.ResultsTotalFee = Math.Round((sumValue * (dept?.BasicFactor ?? 1m)) ?? 0); res.ResultsTotalFee = Math.Round((sumValue * (dept?.BasicFactor ?? 1m)) ?? 0, MidpointRounding.AwayFromZero);
res.PerforTotal = res.ResultsTotalFee + res.AssessBeforeOtherFee; res.PerforTotal = res.ResultsTotalFee + res.AssessBeforeOtherFee;
res.GiveFee = Math.Round((res.PerforTotal * res.ScoringAverage + res.MedicineExtra + res.MaterialsExtra + res.Punishment + res.AssessLaterOtherFee) ?? 0); res.GiveFee = Math.Round((res.PerforTotal * res.ScoringAverage + res.MedicineExtra + res.MaterialsExtra + res.Punishment + res.AssessLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero);
res.RealGiveFee = Math.Round(res.GiveFee * res.Adjust + res.AdjustLaterOtherFee ?? 0); res.RealGiveFee = Math.Round(res.GiveFee * res.Adjust + res.AdjustLaterOtherFee ?? 0, MidpointRounding.AwayFromZero);
res.Avg = Math.Round((res.Number != 0 ? res.PerforTotal / res.Number : null) ?? 0); res.Avg = Math.Round((res.Number != 0 ? res.PerforTotal / res.Number : null) ?? 0, MidpointRounding.AwayFromZero);
resDataList.Add(res); resDataList.Add(res);
...@@ -276,17 +276,17 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -276,17 +276,17 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance; compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance;
// 考核前管理绩效 // 考核前管理绩效
compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0); compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0, MidpointRounding.AwayFromZero);
// 考核后管理绩效 // 考核后管理绩效
compute.AssessLaterManagementFee = Math.Round(compute.ShouldGiveFee * compute.ScoreAverageRate * compute.Attendance + compute.Punishment ?? 0); compute.AssessLaterManagementFee = Math.Round(compute.ShouldGiveFee * compute.ScoreAverageRate * compute.Attendance + compute.Punishment ?? 0, MidpointRounding.AwayFromZero);
// 考核前绩效 // 考核前绩效
compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0); compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0, MidpointRounding.AwayFromZero) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0, MidpointRounding.AwayFromZero);
// 考核后绩效 // 考核后绩效
compute.GiveFee = Math.Round(compute.Avg + compute.AssessLaterManagementFee ?? 0); compute.GiveFee = Math.Round(compute.Avg + compute.AssessLaterManagementFee ?? 0, MidpointRounding.AwayFromZero);
// 参考基数专用绩效合计 // 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.PerforSumFee; compute.BaiscNormPerforTotal = compute.PerforSumFee;
// 实发绩效 // 实发绩效
compute.RealGiveFee = Math.Round((compute.Avg + compute.AssessLaterManagementFee) * compute.Adjust + compute.AdjustLaterOtherFee ?? 0); compute.RealGiveFee = Math.Round((compute.Avg + compute.AssessLaterManagementFee) * compute.Adjust + compute.AdjustLaterOtherFee ?? 0, MidpointRounding.AwayFromZero);
//compute.Efficiency = compute.Avg * (empolyee.Efficiency ?? 1); //compute.Efficiency = compute.Avg * (empolyee.Efficiency ?? 1);
//compute.Scale = compute.PerforTotal * (empolyee.Scale ?? 1); //compute.Scale = compute.PerforTotal * (empolyee.Scale ?? 1);
......
...@@ -407,17 +407,17 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS ...@@ -407,17 +407,17 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance; compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance;
compute.Punishment = (empolyee?.Punishment ?? 0); compute.Punishment = (empolyee?.Punishment ?? 0);
// 考核前管理绩效 // 考核前管理绩效
compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0); compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0, MidpointRounding.AwayFromZero);
// 考核后管理绩效 // 考核后管理绩效
compute.AssessLaterManagementFee = Math.Round(compute.ShouldGiveFee * compute.ScoreAverageRate * compute.Attendance + compute.Punishment ?? 0); compute.AssessLaterManagementFee = Math.Round(compute.ShouldGiveFee * compute.ScoreAverageRate * compute.Attendance + compute.Punishment ?? 0, MidpointRounding.AwayFromZero);
// 考核前绩效 // 考核前绩效
compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0); compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0, MidpointRounding.AwayFromZero) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0, MidpointRounding.AwayFromZero);
// 考核后绩效 // 考核后绩效
compute.GiveFee = Math.Round((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0)); compute.GiveFee = Math.Round((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0), MidpointRounding.AwayFromZero);
// 参考基数专用绩效合计 // 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.PerforSumFee; compute.BaiscNormPerforTotal = compute.PerforSumFee;
// 实发绩效 // 实发绩效
compute.RealGiveFee = Math.Round(((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0)) * compute.Adjust + (compute.AdjustLaterOtherFee ?? 0) ?? 0); compute.RealGiveFee = Math.Round(((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0)) * compute.Adjust + (compute.AdjustLaterOtherFee ?? 0) ?? 0, MidpointRounding.AwayFromZero);
////绩效合计 ////绩效合计
//compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee + compute.AssessBeforeOtherFee ?? 0); //compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee + compute.AssessBeforeOtherFee ?? 0);
...@@ -514,11 +514,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -514,11 +514,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
// 行政高层 行政中层 夜班费 // 行政高层 行政中层 夜班费
compute.NightWorkPerfor = item.NightWorkPerfor; compute.NightWorkPerfor = item.NightWorkPerfor;
//考核前绩效 //考核前绩效
compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.AssessBeforeOtherFee ?? 0); compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.AssessBeforeOtherFee ?? 0, MidpointRounding.AwayFromZero);
//考核后绩效 //考核后绩效
compute.GiveFee = Math.Round(compute.PerforTotal * compute.ScoreAverageRate + compute.Punishment ?? 0); compute.GiveFee = Math.Round(compute.PerforTotal * compute.ScoreAverageRate + compute.Punishment ?? 0, MidpointRounding.AwayFromZero);
//实发绩效 //实发绩效
compute.RealGiveFee = Math.Round((compute.GiveFee * compute.Adjust + compute.AdjustLaterOtherFee) ?? 0); compute.RealGiveFee = Math.Round((compute.GiveFee * compute.Adjust + compute.AdjustLaterOtherFee) ?? 0, MidpointRounding.AwayFromZero);
} }
else if (AccountUnitType.行政工勤.ToString() == involve) else if (AccountUnitType.行政工勤.ToString() == involve)
{ {
...@@ -534,11 +534,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -534,11 +534,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
} }
#endregion #endregion
//考核前绩效 //考核前绩效
compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0); compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0, MidpointRounding.AwayFromZero);
//考核后绩效 更加开关来控制显示 //考核后绩效 更加开关来控制显示
compute.GiveFee = compute.PerforTotal * compute.ScoreAverageRate; compute.GiveFee = compute.PerforTotal * compute.ScoreAverageRate;
//实发绩效 更加开关来控制显示 //实发绩效 更加开关来控制显示
compute.RealGiveFee = Math.Round(compute.GiveFee * compute.Adjust ?? 0); compute.RealGiveFee = Math.Round(compute.GiveFee * compute.Adjust ?? 0, MidpointRounding.AwayFromZero);
} }
computeList.Add(compute); computeList.Add(compute);
//// 行政高层 行政中层 夜班费 //// 行政高层 行政中层 夜班费
......
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