Commit c372460a by ruyun.zhang

工作量CMI药占比计算错误问题修复

parent 274357b6
......@@ -228,9 +228,9 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
var type = TypeConversion(account.UnitType);
var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == allotId);
var medicineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadMedicineProp);
var cmiFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadCMI);
var inclineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadIncline);
var baseMedicineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadMedicineProp);
var baseCmiFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadCMI);
var baseInclineFactor = GetFactors(persheet, basicData, type, SheetType.WorkloadIncline);
var items = new List<Dictionary<string, object>>();
......@@ -247,9 +247,6 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
foreach (var post in postDatas.GroupBy(t => new { t.TypeName }))
{
if (ignore.Contains(post.Key.TypeName)) continue;
var itemValue = post.Sum(group => group.IsFactor == 1 ? (group.CellValue * (group.FactorValue ?? 0)) : group.CellValue);
itemValue = itemValue * (medicineFactor ?? 1) * (cmiFactor ?? 1) * (inclineFactor ?? 1);
var row = new Dictionary<string, object>
{
{ "项目", post.Key.TypeName },
......@@ -258,15 +255,29 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
{ "药占比系数", "" },
{ "CMI系数", "" },
{ "工作量倾斜", "" },
{ "金额", ValueFormating(itemValue, "") }
{ "金额", "" }
};
decimal medicineFactor = 1m, cmiFactor = 1m, inclineFactor = 1m;
if (workitems != null && workitems.Any(a => a.Type == 1 && a.Item == post.Key.TypeName) && medicineFactor != null)
if (workitems != null && workitems.Any(a => a.Type == 1 && a.Item == post.Key.TypeName) && baseMedicineFactor != null)
{
medicineFactor = baseMedicineFactor.Value;
row.AddOrUpdate("药占比系数", ValueFormating(medicineFactor, ""));
if (workitems != null && workitems.Any(a => a.Type == 2 && a.Item == post.Key.TypeName) && cmiFactor != null)
}
if (workitems != null && workitems.Any(a => a.Type == 2 && a.Item == post.Key.TypeName) && baseCmiFactor != null)
{
cmiFactor = baseCmiFactor.Value;
row.AddOrUpdate("CMI系数", ValueFormating(cmiFactor, ""));
if (workitems != null && workitems.Any(a => a.Type == 3 && a.Item == post.Key.TypeName) && inclineFactor != null)
}
if (workitems != null && workitems.Any(a => a.Type == 3 && a.Item == post.Key.TypeName) && baseInclineFactor != null)
{
inclineFactor = baseInclineFactor.Value;
row.AddOrUpdate("工作量倾斜", ValueFormating(inclineFactor, ""));
}
var itemValue = post.Sum(group => group.IsFactor == 1 ? (group.CellValue * (group.FactorValue ?? 0)) : group.CellValue);
itemValue = itemValue * medicineFactor * cmiFactor * inclineFactor;
row.AddOrUpdate("金额", ValueFormating(itemValue, ""));
items.Add(row);
}
......
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