Commit 0042f9f3 by lcx

二次绩效根据实发绩效值发生改变

parent 597d3a99
......@@ -161,6 +161,46 @@ public List<SecondListResponse> GetSecondList(int userId)
};
newSecond.Add(second);
}
if (secondList != null && secondList.Any())
{
var fixatitems = new List<ag_fixatitem>();
foreach (var item in secondList.Select(t => t.AllotId.Value))
{
var allot = allotList.FirstOrDefault(t => t.ID == item);
if (allot == null) continue;
res_account account = null;
res_specialunit special = null;
if (role.Type == application.DirectorRole)
account = accountList?.FirstOrDefault(t => t.AllotID == item && (t.UnitType == (int)UnitType.医生组 || t.UnitType == (int)UnitType.医技组));
else if (role.Type == application.NurseRole)
account = accountList?.FirstOrDefault(t => t.AllotID == item && t.UnitType == (int)UnitType.护理组);
else if (role.Type == application.SpecialRole)
special = specialList?.FirstOrDefault(t => t.AllotID == item);
else if (role.Type == application.OfficeRole)
account = accountList?.FirstOrDefault(t => t.AllotID == item && t.UnitType == (int)UnitType.行政后勤);
if (account == null && special == null) continue;
// 医生组护理组特殊核算组
var realGiveFee = role.Type == application.SpecialRole ? special.RealGiveFee : account.RealGiveFee;
// 行政后勤则取考核前绩效
if (role.Type == application.OfficeRole)
realGiveFee = account.PerforTotal;
var second = secondList.FirstOrDefault(t => t.AllotId == item);
second.RealGiveFee = realGiveFee;
var fixatitem = perforAgfixatitemRepository.GetEntity(t => t.SecondId == second.Id && t.AllotId == second.AllotId && t.RowNumber == -1 && t.ItemName == "可分配绩效");
if (fixatitem != null)
{
fixatitem.ItemValue = realGiveFee.ToString();
fixatitems.Add(fixatitem);
}
}
perforAgsecondallotRepository.UpdateRange(secondList.ToArray());
perforAgfixatitemRepository.UpdateRange(fixatitems.ToArray());
}
#endregion
if (newSecond.Count > 0)
......@@ -582,7 +622,7 @@ private void FillData(ag_secondallot second, List<BodyItem> bodyItems)
foreach (var item in keyValue)
{
var header = bodyItems.FirstOrDefault(t => t.FiledName == item.Key);
if (header != null && (string.IsNullOrEmpty(header.Value) || header.Value == "0"))
if (header != null && (string.IsNullOrEmpty(header.Value) /*|| header.Value == "0"*/))
bodyItems.FirstOrDefault(t => t.FiledName == item.Key).Value = item.Value;
}
}
......
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