Commit 96840303 by lcx

修改math.round取值

parent 9c409246
...@@ -19,8 +19,8 @@ public class PerSheetHeader ...@@ -19,8 +19,8 @@ public class PerSheetHeader
("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false, "FitPeople"), ("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false, "FitPeople"),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"), ("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"), ("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2) , 1, 1, false, true, true, "ScoreAverageRate"), ("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2, MidpointRounding.AwayFromZero) , 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"), ("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Attendance"),
("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"), ("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"),
("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"), ("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), ("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
...@@ -40,14 +40,14 @@ public class PerSheetHeader ...@@ -40,14 +40,14 @@ public class PerSheetHeader
("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false, "DoctorName"), ("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false, "DoctorName"),
("职称", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"), ("职称", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"), ("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2), 1, 1, false, true, true, "Efficiency"), ("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Efficiency"),
("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2), 1, 1, false, true, true, "Scale"), ("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Scale"),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2), 1, 1, false, true, true, "Management"), ("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Management"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2), 1, 1, false, true, true, "ScoreAverageRate"), ("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"), ("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Attendance"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), ("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"), ("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true, "Adjust"), ("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Adjust"),
}; };
...@@ -61,10 +61,10 @@ public class PerSheetHeader ...@@ -61,10 +61,10 @@ public class PerSheetHeader
("量化指标", (t) => t.QuantitativeIndicators, 1, 1, false, true, false, "QuantitativeIndicators"), ("量化指标", (t) => t.QuantitativeIndicators, 1, 1, false, true, false, "QuantitativeIndicators"),
("数量", (t) => t.Quantity, 1, 1, false, true, false, "Quantity"), ("数量", (t) => t.Quantity, 1, 1, false, true, false, "Quantity"),
("量化指标绩效分值", (t) => t.QuantitativeIndicatorsValue, 1, 1, false, true, false, "QuantitativeIndicatorsValue"), ("量化指标绩效分值", (t) => t.QuantitativeIndicatorsValue, 1, 1, false, true, false, "QuantitativeIndicatorsValue"),
("考核得分率", (t) => Math.Round(t.ScoringAverage.Value * 100, 2), 1, 1, false, true, true, "ScoringAverage"), ("考核得分率", (t) => Math.Round(t.ScoringAverage.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "ScoringAverage"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), ("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"), ("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true, "Adjust"), ("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Adjust"),
}; };
} }
} }
...@@ -76,7 +76,7 @@ public object CellValue ...@@ -76,7 +76,7 @@ public object CellValue
{ {
var value = ConvertHelper.To<decimal?>(cellValue); var value = ConvertHelper.To<decimal?>(cellValue);
if (value.HasValue && value.Value > 0) if (value.HasValue && value.Value > 0)
return Math.Round(value.Value, 2); return Math.Round(value.Value, 2, MidpointRounding.AwayFromZero);
return cellValue; return cellValue;
} }
set set
......
...@@ -37,7 +37,7 @@ public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<im ...@@ -37,7 +37,7 @@ public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<im
PositionName = EnumHelper.GetDescription(item.Reference), PositionName = EnumHelper.GetDescription(item.Reference),
TotelNumber = count, TotelNumber = count,
TotelValue = dataList?.Sum(t => t.BaiscNormPerforTotal), TotelValue = dataList?.Sum(t => t.BaiscNormPerforTotal),
AvgValue = Math.Round((dataList?.Sum(t => t.BaiscNormPerforTotal) / count) ?? 0) AvgValue = Math.Round((dataList?.Sum(t => t.BaiscNormPerforTotal) / count) ?? 0, MidpointRounding.AwayFromZero)
}; };
baiscnormList.Add(baiscnorm); baiscnormList.Add(baiscnorm);
} }
...@@ -108,7 +108,7 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li ...@@ -108,7 +108,7 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li
} }
if (result.HasValue) if (result.HasValue)
result = Math.Round(result.Value, 4); result = Math.Round(result.Value, 4, MidpointRounding.AwayFromZero);
return result; return result;
} }
...@@ -139,7 +139,7 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis ...@@ -139,7 +139,7 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis
PositionName = EnumHelper.GetDescription(info.PerforType), PositionName = EnumHelper.GetDescription(info.PerforType),
TotelNumber = groupData.Sum(t => t.Number), TotelNumber = groupData.Sum(t => t.Number),
TotelValue = groupData.Sum(t => t.PerforTotal), TotelValue = groupData.Sum(t => t.PerforTotal),
AvgValue = Math.Round(groupData.Sum(t => t.PerforTotal) / groupData.Sum(t => t.Number) ?? 0) AvgValue = Math.Round(groupData.Sum(t => t.PerforTotal) / groupData.Sum(t => t.Number) ?? 0, MidpointRounding.AwayFromZero)
}; };
baiscnormList.Add(baiscnorm); baiscnormList.Add(baiscnorm);
} }
......
...@@ -323,8 +323,8 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_ ...@@ -323,8 +323,8 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
dept.Income = econDoctor?.CellValue ?? 0; dept.Income = econDoctor?.CellValue ?? 0;
dept.WorkloadFee = dept.WorkSlopeFactor * (workDoctor?.CellValue ?? 0); dept.WorkloadFee = dept.WorkSlopeFactor * (workDoctor?.CellValue ?? 0);
dept.PerforFee = dept.Income * (dept.BasicFactor + dept.SlopeFactor); dept.PerforFee = dept.Income * (dept.BasicFactor + dept.SlopeFactor);
dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + (dept.MinimumFee ?? 0)) ?? 0); dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + (dept.MinimumFee ?? 0)) ?? 0, MidpointRounding.AwayFromZero);
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra + dept.OtherPerfor2) * dept.AdjustFactor) ?? 0); dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra + dept.OtherPerfor2) * dept.AdjustFactor) ?? 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);
} }
...@@ -549,7 +549,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid) ...@@ -549,7 +549,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var dsv = drugData?.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue; var dsv = drugData?.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
var asv = allData.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue; var asv = allData.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
var prop = asv.HasValue && asv.Value > 0 ? Math.Round((dsv ?? 0) / asv.Value, 2) : 0; var prop = asv.HasValue && asv.Value > 0 ? Math.Round((dsv ?? 0) / asv.Value, 4, MidpointRounding.AwayFromZero) : 0;
var fvalue = cofList.FirstOrDefault(t => prop > t.MinRange && prop <= t.MaxRange)?.Value ?? 0; var fvalue = cofList.FirstOrDefault(t => prop > t.MinRange && prop <= t.MaxRange)?.Value ?? 0;
cofs.Add(new CofDrugProp { AccoutingUnit = unit, Factor = fvalue, Prop = prop }); cofs.Add(new CofDrugProp { AccoutingUnit = unit, Factor = fvalue, Prop = prop });
} }
......
...@@ -211,9 +211,9 @@ public List<res_specialunit> GetSpecial(int allotId) ...@@ -211,9 +211,9 @@ public List<res_specialunit> GetSpecial(int allotId)
{ {
data.ForEach(t => data.ForEach(t =>
{ {
t.GiveFee = Math.Round(t.GiveFee ?? 0); t.GiveFee = Math.Round(t.GiveFee ?? 0, MidpointRounding.AwayFromZero);
t.RealGiveFee = Math.Round(t.RealGiveFee ?? 0); t.RealGiveFee = Math.Round(t.RealGiveFee ?? 0, MidpointRounding.AwayFromZero);
t.ResultsTotalFee = Math.Round(t.ResultsTotalFee ?? 0); t.ResultsTotalFee = Math.Round(t.ResultsTotalFee ?? 0, MidpointRounding.AwayFromZero);
}); });
} }
return data; return data;
...@@ -801,7 +801,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second) ...@@ -801,7 +801,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
ItemName = item.QuantitativeIndicators, ItemName = item.QuantitativeIndicators,
CellValue = item.Quantity, CellValue = item.Quantity,
Factor = item.QuantitativeIndicatorsValue, Factor = item.QuantitativeIndicatorsValue,
ItemValue = Math.Round(item.Quantity * item.QuantitativeIndicatorsValue ?? 0, 2) ItemValue = Math.Round(item.Quantity * item.QuantitativeIndicatorsValue ?? 0, 2, MidpointRounding.AwayFromZero)
}); });
} }
deptDetails.Detail.Add(detail); deptDetails.Detail.Add(detail);
......
...@@ -54,7 +54,7 @@ public void WriteMsg(string tag, string message, int level, int allotId, string ...@@ -54,7 +54,7 @@ public void WriteMsg(string tag, string message, int level, int allotId, string
/// <param name="success"></param> /// <param name="success"></param>
public void Schedule(string groupName, decimal ratio, int level) public void Schedule(string groupName, decimal ratio, int level)
{ {
ratio = Math.Round(ratio); ratio = Math.Round(ratio, MidpointRounding.AwayFromZero);
if (level != 5 && ratio > 100) ratio = 99; if (level != 5 && ratio > 100) ratio = 99;
......
...@@ -388,15 +388,15 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a ...@@ -388,15 +388,15 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
Attendance = empolyee.Attendance Attendance = empolyee.Attendance
}; };
//应发管理绩效 //应发管理绩效
compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * (compute.Grant ?? 0) ?? 0); compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * (compute.Grant ?? 0) ?? 0, MidpointRounding.AwayFromZero);
//绩效合计 //绩效合计
compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee ?? 0); compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee ?? 0, MidpointRounding.AwayFromZero);
//应发绩效 //应发绩效
//compute.GiveFee = compute.PerforSumFee; //compute.GiveFee = compute.PerforSumFee;
compute.GiveFee = Math.Round(compute.PerforSumFee * compute.ScoreAverageRate * (compute.Attendance ?? 0) + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0) ?? 0); compute.GiveFee = Math.Round(compute.PerforSumFee * compute.ScoreAverageRate * (compute.Attendance ?? 0) + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0) ?? 0, MidpointRounding.AwayFromZero);
//实发绩效 //实发绩效
//compute.RealGiveFee = (compute.GiveFee * compute.ScoreAverageRate * (compute.Attendance ?? 0) + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0)) * (compute.Adjust ?? 1m); //compute.RealGiveFee = (compute.GiveFee * compute.ScoreAverageRate * (compute.Attendance ?? 0) + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0)) * (compute.Adjust ?? 1m);
compute.RealGiveFee = Math.Round(compute.GiveFee * (compute.Adjust ?? 1m) ?? 0); compute.RealGiveFee = Math.Round(compute.GiveFee * (compute.Adjust ?? 1m) ?? 0, MidpointRounding.AwayFromZero);
// 参考基数专用绩效合计 // 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.PerforSumFee; compute.BaiscNormPerforTotal = compute.PerforSumFee;
...@@ -468,9 +468,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -468,9 +468,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
compute.BaiscNormValue = (baiscnorm ?? 0) * (item.FitPeopleRatio ?? 0); compute.BaiscNormValue = (baiscnorm ?? 0) * (item.FitPeopleRatio ?? 0);
//应发绩效 //应发绩效
compute.GiveFee = Math.Round((compute.BaiscNormValue * compute.PostCoefficient * (compute.WorkYear ?? 1) * compute.Attendance * compute.ScoreAverageRate compute.GiveFee = Math.Round((compute.BaiscNormValue * compute.PostCoefficient * (compute.WorkYear ?? 1) * compute.Attendance * compute.ScoreAverageRate
+ (compute.OtherPerfor ?? 0) + (compute.Punishment ?? 0)) ?? 0); + (compute.OtherPerfor ?? 0) + (compute.Punishment ?? 0)) ?? 0, MidpointRounding.AwayFromZero);
//实发绩效 //实发绩效
compute.RealGiveFee = Math.Round((compute.GiveFee * (itemAdjust ?? 1)) ?? 0); compute.RealGiveFee = Math.Round((compute.GiveFee * (itemAdjust ?? 1)) ?? 0, MidpointRounding.AwayFromZero);
computeList.Add(compute); computeList.Add(compute);
} }
......
...@@ -220,7 +220,7 @@ public bool UpdatePerson(PerEmployeeResponse request) ...@@ -220,7 +220,7 @@ public bool UpdatePerson(PerEmployeeResponse request)
// 出勤率 // 出勤率
var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId); var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId);
var day = (decimal)DateTime.DaysInMonth(allot.Year, allot.Month); var day = (decimal)DateTime.DaysInMonth(allot.Year, allot.Month);
employee.Attendance = Math.Round((request.AttendanceDay ?? 0) / day, 4); employee.Attendance = Math.Round((request.AttendanceDay ?? 0) / day, 4, MidpointRounding.AwayFromZero);
//CheckAccountingDept(request.HospitalId.Value, request.AccountingUnit, request.Department); //CheckAccountingDept(request.HospitalId.Value, request.AccountingUnit, request.Department);
return peremployeeRepository.Update(employee); return peremployeeRepository.Update(employee);
......
...@@ -73,7 +73,7 @@ public dynamic Survey(int hospitalId) ...@@ -73,7 +73,7 @@ public dynamic Survey(int hospitalId)
{ {
foreach (var basic in basicList) foreach (var basic in basicList)
{ {
keyvalue.Add(basic.PositionName, Math.Round(basic.AvgValue.Value, 2)); keyvalue.Add(basic.PositionName, Math.Round(basic.AvgValue.Value, 2, MidpointRounding.AwayFromZero));
} }
} }
return new return new
...@@ -111,7 +111,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex) ...@@ -111,7 +111,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex)
{ {
Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'), Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'),
X = t.AccountingUnit, X = t.AccountingUnit,
Value = Math.Round(t.Avg.Value, 2) Value = Math.Round(t.Avg.Value, 2, MidpointRounding.AwayFromZero)
}; };
return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList(); return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList();
} }
...@@ -143,7 +143,7 @@ public List<PerReport> NurseAvg(int hospitalId, int isIndex) ...@@ -143,7 +143,7 @@ public List<PerReport> NurseAvg(int hospitalId, int isIndex)
{ {
Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'), Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'),
X = t.AccountingUnit, X = t.AccountingUnit,
Value = Math.Round(t.Avg.Value, 2) Value = Math.Round(t.Avg.Value, 2, MidpointRounding.AwayFromZero)
}; };
return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList(); return s.OrderBy(t => t.Y).ThenByDescending(t => t.Value).ToList();
} }
......
...@@ -276,7 +276,7 @@ private void CommonExport(int sheetID, SheetExportResponse response) ...@@ -276,7 +276,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
if (!percentparam.Contains(head.CellValue)) if (!percentparam.Contains(head.CellValue))
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation, data.ID, head.CellValue)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation, data.ID, head.CellValue));
else else
rowbody.Data.Add(new Cell(head.PointCell.Value, Math.Round(value.Value * 100, 2) + "%", 1, 1, data.IsTotal == 1, true, data.Annotation, data.ID, head.CellValue)); rowbody.Data.Add(new Cell(head.PointCell.Value, Math.Round(value.Value * 100, 2, MidpointRounding.AwayFromZero) + "%", 1, 1, data.IsTotal == 1, true, data.Annotation, data.ID, head.CellValue));
} }
} }
} }
......
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