Commit 96840303 by lcx

修改math.round取值

parent 9c409246
......@@ -19,8 +19,8 @@ public class PerSheetHeader
("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false, "FitPeople"),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
("参加工作时间", (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.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2, MidpointRounding.AwayFromZero) , 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (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.Workload, 1, 1, false, true, false, "Workload"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
......@@ -40,14 +40,14 @@ public class PerSheetHeader
("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false, "DoctorName"),
("职称", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"),
("岗位系数", (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.Scale.Value * 100, 2), 1, 1, false, true, true, "Scale"),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2), 1, 1, false, true, true, "Management"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2), 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"),
("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Efficiency"),
("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Scale"),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "Management"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2, MidpointRounding.AwayFromZero), 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (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.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
("量化指标", (t) => t.QuantitativeIndicators, 1, 1, false, true, false, "QuantitativeIndicators"),
("数量", (t) => t.Quantity, 1, 1, false, true, false, "Quantity"),
("量化指标绩效分值", (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.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
{
var value = ConvertHelper.To<decimal?>(cellValue);
if (value.HasValue && value.Value > 0)
return Math.Round(value.Value, 2);
return Math.Round(value.Value, 2, MidpointRounding.AwayFromZero);
return cellValue;
}
set
......
......@@ -37,7 +37,7 @@ public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<im
PositionName = EnumHelper.GetDescription(item.Reference),
TotelNumber = count,
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);
}
......@@ -108,7 +108,7 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li
}
if (result.HasValue)
result = Math.Round(result.Value, 4);
result = Math.Round(result.Value, 4, MidpointRounding.AwayFromZero);
return result;
}
......@@ -139,7 +139,7 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis
PositionName = EnumHelper.GetDescription(info.PerforType),
TotelNumber = groupData.Sum(t => t.Number),
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);
}
......
......@@ -323,8 +323,8 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
dept.Income = econDoctor?.CellValue ?? 0;
dept.WorkloadFee = dept.WorkSlopeFactor * (workDoctor?.CellValue ?? 0);
dept.PerforFee = dept.Income * (dept.BasicFactor + dept.SlopeFactor);
dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + (dept.MinimumFee ?? 0)) ?? 0);
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra + dept.OtherPerfor2) * dept.AdjustFactor) ?? 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, MidpointRounding.AwayFromZero);
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)
var dsv = drugData?.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;
cofs.Add(new CofDrugProp { AccoutingUnit = unit, Factor = fvalue, Prop = prop });
}
......
......@@ -211,9 +211,9 @@ public List<res_specialunit> GetSpecial(int allotId)
{
data.ForEach(t =>
{
t.GiveFee = Math.Round(t.GiveFee ?? 0);
t.RealGiveFee = Math.Round(t.RealGiveFee ?? 0);
t.ResultsTotalFee = Math.Round(t.ResultsTotalFee ?? 0);
t.GiveFee = Math.Round(t.GiveFee ?? 0, MidpointRounding.AwayFromZero);
t.RealGiveFee = Math.Round(t.RealGiveFee ?? 0, MidpointRounding.AwayFromZero);
t.ResultsTotalFee = Math.Round(t.ResultsTotalFee ?? 0, MidpointRounding.AwayFromZero);
});
}
return data;
......@@ -801,7 +801,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
ItemName = item.QuantitativeIndicators,
CellValue = item.Quantity,
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);
......
......@@ -54,7 +54,7 @@ public void WriteMsg(string tag, string message, int level, int allotId, string
/// <param name="success"></param>
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;
......
......@@ -388,15 +388,15 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
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 = 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 = Math.Round(compute.GiveFee * (compute.Adjust ?? 1m) ?? 0);
compute.RealGiveFee = Math.Round(compute.GiveFee * (compute.Adjust ?? 1m) ?? 0, MidpointRounding.AwayFromZero);
// 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.PerforSumFee;
......@@ -468,9 +468,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
compute.BaiscNormValue = (baiscnorm ?? 0) * (item.FitPeopleRatio ?? 0);
//应发绩效
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);
}
......
......@@ -220,7 +220,7 @@ public bool UpdatePerson(PerEmployeeResponse request)
// 出勤率
var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId);
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);
return peremployeeRepository.Update(employee);
......
......@@ -73,7 +73,7 @@ public dynamic Survey(int hospitalId)
{
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
......@@ -111,7 +111,7 @@ public List<PerReport> DoctorAvg(int hospitalId, int isIndex)
{
Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'),
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();
}
......@@ -143,7 +143,7 @@ public List<PerReport> NurseAvg(int hospitalId, int isIndex)
{
Y = a.Year + "-" + a.Month.ToString().PadLeft(2, '0'),
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();
}
......
......@@ -276,7 +276,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
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));
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