feat: 完善焊接质量检查和材料管理
补齐焊前专项审核和焊缝外观检测流程,统一质检查询、附件处理与材料明细导出,提升业务数据追溯和组件匹配使用效率。
This commit is contained in:
@@ -151,13 +151,26 @@ namespace BLL
|
||||
public static IEnumerable GetPrintListByOutputMasterIds(List<string> outputMasterIds)
|
||||
{
|
||||
var q = from x in Funs.DB.Tw_OutputDetail
|
||||
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
|
||||
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode into materials
|
||||
from y in materials.DefaultIfEmpty()
|
||||
join master in Funs.DB.Tw_OutputMaster on x.OutputMasterId equals master.Id
|
||||
join plan in Funs.DB.Tw_InOutPlanMaster on master.InOutPlanMasterId equals plan.Id into plans
|
||||
from plan in plans.DefaultIfEmpty()
|
||||
join warehouse in Funs.DB.Base_Warehouse on master.WarehouseId equals warehouse.WarehouseId into warehouses
|
||||
from warehouse in warehouses.DefaultIfEmpty()
|
||||
join person in Funs.DB.Person_Persons on master.CreateMan equals person.PersonId into persons
|
||||
from person in persons.DefaultIfEmpty()
|
||||
join unit in Funs.DB.Base_Unit on master.ReqUnitId equals unit.UnitId into units
|
||||
from unit in units.DefaultIfEmpty()
|
||||
where outputMasterIds.Contains(x.OutputMasterId)
|
||||
orderby master.CusBillCode
|
||||
select new
|
||||
{
|
||||
出库单编号 = master.CusBillCode,
|
||||
master.CusBillCode,
|
||||
WarehouseName = warehouse == null ? master.WarehouseCode : warehouse.WarehouseName,
|
||||
master.TypeInt,
|
||||
CreateManName = person == null ? master.CreateMan : person.PersonName,
|
||||
master.CreateDate,
|
||||
材料主编码 = x.MaterialCode,
|
||||
材料编码 = y.Code,
|
||||
炉号 = y.HeatNo,
|
||||
@@ -166,8 +179,30 @@ namespace BLL
|
||||
材料描述 = y.MaterialDef,
|
||||
计划数量 = x.PlanNum,
|
||||
实际数量 = x.ActNum,
|
||||
master.WarehouseDate,
|
||||
ReqUnitName = unit == null ? master.ReqUnitId : unit.UnitName,
|
||||
Remark = plan == null ? null : plan.Remark
|
||||
};
|
||||
return q;
|
||||
// 类型字典无法转换为 SQL,先完成数据库查询,再生成固定顺序的 Excel 列。
|
||||
return q.ToList().Select(x => new
|
||||
{
|
||||
编号 = x.CusBillCode,
|
||||
仓库 = x.WarehouseName,
|
||||
类型 = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key,
|
||||
发起人 = x.CreateManName,
|
||||
发起时间 = x.CreateDate,
|
||||
x.材料主编码,
|
||||
x.材料编码,
|
||||
x.炉号,
|
||||
x.批号,
|
||||
x.材料名称,
|
||||
x.材料描述,
|
||||
x.计划数量,
|
||||
x.实际数量,
|
||||
出库时间 = x.WarehouseDate,
|
||||
领用单位 = x.ReqUnitName,
|
||||
备注 = x.Remark
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user