增加月工效和项目工效

This commit is contained in:
2023-10-20 14:34:35 +08:00
parent 2abb426abe
commit 88c39643fa
18 changed files with 1565 additions and 113 deletions
@@ -838,11 +838,19 @@ namespace BLL
row[7] = item.Id;
if (workEfficiencys.Count() > 0)
{
var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id);
if (we != null)
var we = (from x in workEfficiencys
where x.ContractTrackId == item.Id
select new { x.ConstructionLogId, x.ContractTrackId, x.PhysicalCompletionQuantity, x.MaterialConsumption }).Distinct().ToList();
decimal physicalCompletionQuantity = 0, materialConsumption = 0;
if (we.Count() > 0)
{
row[5] = we.PhysicalCompletionQuantity;
row[6] = we.MaterialConsumption;
foreach (var w in we)
{
physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0;
materialConsumption += w.MaterialConsumption ?? 0;
}
row[5] = physicalCompletionQuantity;
row[6] = materialConsumption;
}
for (int i = 0; i < workPostIds.Count; i++)
{
@@ -860,9 +868,9 @@ namespace BLL
if (d > 0)
{
row[8 + i * 2] = decimal.Round(d, 2);
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
if (physicalCompletionQuantity > 0)
{
row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2);
row[9 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2);
}
}
}
@@ -883,9 +891,9 @@ namespace BLL
if (d > 0)
{
row[48 + i * 2] = decimal.Round(d, 2);
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
if (physicalCompletionQuantity > 0)
{
row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2);
row[49 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2);
}
}
}