fix:焊接任务单打印材料匹配率显示问题修改
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
using Model;
|
using Model;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -125,9 +126,7 @@ namespace BLL
|
|||||||
{
|
{
|
||||||
var twPipeMatMatchOutputs = new List<Tw_PipeMatMatchOutput>();
|
var twPipeMatMatchOutputs = new List<Tw_PipeMatMatchOutput>();
|
||||||
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipelineId);
|
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipelineId);
|
||||||
string warehouseCode = PipelineService
|
string warehouseCode = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(PipelineService.GetPipelineByPipelineId(pipelineModel.PipelineId).WarehouseId).WarehouseName;
|
||||||
.GetPipeArea().FirstOrDefault(x => x.Value == pipelineModel.PipeArea.ToString())
|
|
||||||
?.Text;
|
|
||||||
// 获取所需材料列表
|
// 获取所需材料列表
|
||||||
var requiredMaterials = (from x in db.HJGL_PipeLineMat
|
var requiredMaterials = (from x in db.HJGL_PipeLineMat
|
||||||
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
|
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
|
||||||
@@ -152,7 +151,9 @@ namespace BLL
|
|||||||
).ToList();
|
).ToList();
|
||||||
|
|
||||||
twPipeMatMatchOutputs = GetMatMatchOutput(requiredMaterials, warehouseCode, pipelineModel.ProjectId);
|
twPipeMatMatchOutputs = GetMatMatchOutput(requiredMaterials, warehouseCode, pipelineModel.ProjectId);
|
||||||
var result = twPipeMatMatchOutputs.Count == 0 ? 0 : twPipeMatMatchOutputs.Sum(x => x.MatchRate) / twPipeMatMatchOutputs.Count;
|
var result = twPipeMatMatchOutputs.Any()
|
||||||
|
? twPipeMatMatchOutputs.Average(x => x.MatchRate)
|
||||||
|
: 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user