This commit is contained in:
2024-05-16 16:37:30 +08:00
parent 5f2a6bcdda
commit 5debdf1a07
8 changed files with 119 additions and 3 deletions

View File

@@ -417,7 +417,7 @@ namespace Tnb.ProductionMgr
.LeftJoin<EqpEquipment>((a, b, c, d, e, f) => a.eqp_id == f.id)
.LeftJoin<ToolMolds>((a, b, c, d, e, f, g) => a.mold_id == g.id)
.LeftJoin<PerProcessStandardsH>((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1)
.LeftJoin<BasStandardTime>((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1)
.LeftJoin<BasStandardTime>((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1 && a.schedule_type==1)
.LeftJoin<PrdMo>((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id)
.LeftJoin<BasMaterialUnit>((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg")
.LeftJoin<EqpDaq>((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "注塑空满箱请求")
@@ -469,11 +469,32 @@ namespace Tnb.ProductionMgr
deputy_num = k.number_of_auxiliary_unit,
third_equip_code = l.equip_code,
weight_name = l.label_name,
category_id = b.category_id
category_id = b.category_id,
as_location_id = f.as_location_id
})
.MergeTable()
.OrderBy($"{input.sidx} {input.sort}")
.ToPagedListAsync(input.currentPage, input.pageSize);
if (!result.list.IsEmpty())
{
foreach (var item in result.list)
{
if (item.as_location_id!=null && !item.as_location_id.IsEmpty())
{
BasLocation basLocation = await _db.Queryable<BasLocation>().SingleAsync(x => x.id == item.as_location_id);
item.as_location_code = basLocation.location_code;
}
if (item.schedule_type == 2)
{
PerProcessStandardsH processStandardsH = await _db.Queryable<PerProcessStandardsH>()
.Where(x => x.equip_id == item.equip_id && x.molds_id == item.mold_id &&
x.output_material_id == item.material_id && x.enabled == 1)
.OrderByDescending(x => x.create_time).FirstAsync();
item.standard_time = processStandardsH?.moulding_cycle?.ToString();
}
}
}
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);