feat(hjgl):新增防腐管理
This commit is contained in:
@@ -1525,7 +1525,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
keyValuePairs.Add("Code", weldTask?.TaskCode ?? weldTask_CreateName?.TaskCode ?? string.Empty);
|
||||
keyValuePairs.Add("TaskDate", string.Format("{0:yyyy-MM-dd}", taskTime.Value));
|
||||
keyValuePairs.Add("UnitName", UnitService.GetUnitNameByUnitId(tvControlItem.SelectedNodeID.Split('|')[1]));
|
||||
keyValuePairs.Add("UnitWorkName", UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]).UnitWorkName);
|
||||
var unitWorkModel = UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID.Split('|')[0]);
|
||||
keyValuePairs.Add("UnitWorkName", unitWorkModel?.UnitWorkName ?? string.Empty);
|
||||
// 创建一个新的DataTable
|
||||
DataTable dataTable = new DataTable();
|
||||
dataTable.TableName = "Data";
|
||||
@@ -1541,13 +1542,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
DataRow dr = dataTable.NewRow();
|
||||
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipeline);
|
||||
List<string> list = new List<string> { pipeline };
|
||||
if (pipelineModel == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
dr["PipelineCode"] = pipelineModel.PipelineCode;
|
||||
dr["FlowingSection"] = pipelineModel.FlowingSection;
|
||||
dr["MaterialCode"] = Base_MaterialService.GetMaterialByMaterialId(pipelineModel.MaterialId).MaterialCode;
|
||||
// 管线基础资料可能未维护材质,打印时保留空值,避免整张任务单打印失败。
|
||||
var materialModel = string.IsNullOrEmpty(pipelineModel.MaterialId) ? null : Base_MaterialService.GetMaterialByMaterialId(pipelineModel.MaterialId);
|
||||
dr["MaterialCode"] = materialModel?.MaterialCode ?? string.Empty;
|
||||
dr["MaterialSpec"] = string.Join(",", weldTaskList.Select(x => x.Specification).Distinct().ToList());
|
||||
dr["MatchRate"] = Math.Round((decimal)TwArrivalStatisticsService.GetPipeMatch(pipeline) * 100, 2).ToString() + "%";
|
||||
// 匹配率计算依赖管线仓库,未维护仓库时按0显示,避免基础资料缺项阻断打印。
|
||||
var warehouseModel = string.IsNullOrEmpty(pipelineModel.WarehouseId) ? null : Base_WarehouseService.GetWarehouseByWarehouseId(pipelineModel.WarehouseId);
|
||||
var matchRate = warehouseModel == null ? 0 : TwArrivalStatisticsService.GetPipeMatch(pipeline) ?? 0;
|
||||
dr["MatchRate"] = Math.Round(matchRate * 100, 2).ToString() + "%";
|
||||
dr["Dia"] = weldTaskList.Where(x => x.PipelineId == pipeline).Sum(x => x.Size ?? 0)
|
||||
.ToString();
|
||||
dataTable.Rows.Add(dr);
|
||||
|
||||
Reference in New Issue
Block a user