Commit 0ea12a2e by lcx

全院核算绩效发放 其他绩效

parent 1aec9af6
......@@ -356,6 +356,23 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result.AddRange(adminPerfor);
var aprAmounts = perapramountRepository.GetEntities(t => t.AllotId == allotId) ?? new List<per_apr_amount>();
var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId) ?? new List<per_employee>();
var otherPerformances = aprAmounts.Join(employees, outer => new { outer.AccountingUnit, outer.PersonnelNumber }, inner => new { inner.AccountingUnit, inner.PersonnelNumber }, (outer, inner) => new
{
AccountingUnit = outer.AccountingUnit,
UnitType = inner.UnitType,
PersonnelNumber = outer.PersonnelNumber,
PersonnelName = inner.DoctorName,
Amount = outer.Amount
})?.GroupBy(t => new { t.AccountingUnit, t.UnitType }).Select(t => new
{
AccountingUnit = t.Key.AccountingUnit,
UnitType = t.Key.UnitType,
Amount = t.Sum(s => s.Amount)
});
result = result.GroupBy(t => new { t.AccountingUnit, t.UnitName }).Select(t => new DeptResponse
{
UnitName = t.Key.UnitName,
......@@ -373,7 +390,9 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
PerforTotal = t.Sum(group => group.PerforTotal),
AssessLaterPerforTotal = t.Sum(group => group.AssessLaterPerforTotal),
AssessLaterManagementFee = t.Sum(group => group.AssessLaterManagementFee),
RealGiveFee = t.Sum(group => group.RealGiveFee) + t.Sum(group => group.AssessLaterManagementFee),
AprPerforAmount = otherPerformances?.FirstOrDefault(w => w.AccountingUnit == t.Key.AccountingUnit && w.UnitType == t.Key.UnitName)?.Amount ?? 0,
RealGiveFee = t.Sum(group => group.RealGiveFee) + t.Sum(group => group.AssessLaterManagementFee)
+ (otherPerformances?.FirstOrDefault(w => w.AccountingUnit == t.Key.AccountingUnit && w.UnitType == t.Key.UnitName)?.Amount ?? 0),
}).ToList();
var enumItems = EnumHelper.GetItems<AccountUnitType>();
......
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