Commit 799b76cb by ruyun.zhang@suvalue.com

Merge branch 'fixed/jsonbug' into v2020calculate

parents 9c7c862b 6190df07
...@@ -542,11 +542,27 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co ...@@ -542,11 +542,27 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
if (list == null || !list.Any()) if (list == null || !list.Any())
return computes; return computes;
foreach (var emp in computes) foreach (var item in computes.GroupBy(w => new { w.AccountingUnit, w.JobNumber }))
{ {
var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit && !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim()); // 补充过一次就不在补充了
emp.OthePerfor = apramount?.Sum(w => w.Amount); var emp = computes.Where(w => w.AccountingUnit == item.Key.AccountingUnit && w.JobNumber == item.Key.JobNumber)
.OrderByDescending(w => w.Source).FirstOrDefault();
var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
&& !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
//foreach (var emp in computes)
//{
// if (!emp.OthePerfor.HasValue || emp.OthePerfor == 0)
// {
// var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
// && !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
// emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
// }
//}
} }
return computes; return computes;
} }
......
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