This commit is contained in:
2023-10-24 14:23:53 +08:00
40 changed files with 2559 additions and 200 deletions
@@ -893,11 +893,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++)
{
@@ -915,9 +923,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);
}
}
}
@@ -938,9 +946,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);
}
}
}