This commit is contained in:
2023-09-20 17:13:24 +08:00
parent f636b12517
commit 9f21a1986e
2 changed files with 18 additions and 4 deletions

View File

@@ -85,5 +85,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
public string process_name { get; set; }
public string mbom_process_id { get; set; }
public string equip_id { get; set; }
public string equip_code { get; set; }
public string equip_name { get; set; }
public string mold_id { get; set; }
public string mold_code { get; set; }
public string mold_name { get; set; }
}
}

View File

@@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entities;
using Tnb.EquipMgr.Entities;
using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
using Tnb.ProductionMgr.Interfaces;
@@ -253,11 +254,12 @@ namespace Tnb.ProductionMgr
var result = await _db.Queryable<PrdMoTask>()
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
.LeftJoin<BasProcess>((a, b, c) => a.process_id == c.id)
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workline_id == d.Id)
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
.LeftJoin<DictionaryDataEntity>((a, b, c, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
.LeftJoin<EqpEquipment>((a,b,c,e,f)=>a.eqp_id==f.id)
.LeftJoin<ToolMolds>((a,b,c,e,f,g)=>a.mold_id==g.id)
.Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==1)
.OrderByDescending((a, b) => a.create_time)
.Select((a, b, c, d, e) => new PADPackageTaskPageOutput
.Select((a, b, c, e,f,g) => new PADPackageTaskPageOutput
{
id = a.id,
mo_task_code = a.mo_task_code,
@@ -266,7 +268,7 @@ namespace Tnb.ProductionMgr
material_code = b.code,
material_name = b.name,
workline_id = a.workline_id,
workline_name = d.FullName,
// workline_name = d.FullName,
bom_id = a.bom_id,
mo_task_status = e.FullName,
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
@@ -279,6 +281,12 @@ namespace Tnb.ProductionMgr
process_id = a.process_id,
process_name = c.process_name,
mbom_process_id = a.mbom_process_id,
equip_id = a.eqp_id,
equip_code = f.code,
equip_name = f.name,
mold_id = a.mold_id,
mold_code = g.mold_code,
mold_name = g.mold_name,
}).ToPagedListAsync(input.currentPage, input.pageSize);
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);