Commit b29d413d by lcx

二次绩效审核列表

parent 6a0b80a3
......@@ -1181,8 +1181,27 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
if (allot == null)
throw new PerformanceException("所选绩效不存在!");
var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allotId && !new int[] { (int)UnitType.行政高层, (int)UnitType.行政中层 }.Contains(t.UnitType.Value));
if (accountUnit == null || !accountUnit.Any()) return new List<ag_secondallot>();
var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month && t.Status == 2);
return secondList;
var result = accountUnit.Select(t =>
{
var second = secondList?.FirstOrDefault(f => f.UnitType == ((UnitType)t.UnitType).ToString() && f.Department == t.AccountingUnit);
if (second != null) return second;
return new ag_secondallot
{
AllotId = allotId,
Year = allot.Year,
Month = allot.Month,
UnitType = ((UnitType)t.UnitType).ToString(),
Department = t.AccountingUnit,
RealGiveFee = t.RealGiveFee,
Status = 1,
};
});
var enums = EnumHelper.GetItems<UnitType>();
return result.OrderBy(t => enums.FirstOrDefault(f => f.Name == t.UnitType)?.Value).ThenBy(t => t.Department).ToList();
}
/// <summary>
......
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