优化
This commit is contained in:
@@ -558,6 +558,7 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
// string location_code = "ZCR01";//todo <20>̹ܼ<CCB9><DCBC><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>λ֮<CEBB><D6AE><EFBFBD><EFBFBD>
|
||||
//todo <20><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD>
|
||||
string warehouse_id = "2";
|
||||
|
||||
PrdInstockH? prdInstockH = null;
|
||||
|
||||
@@ -261,7 +261,12 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
if (!await db.Queryable<BasEbomH>().AnyAsync(x => x.material_id == item.material_id && x.version == item.ebom_version))
|
||||
{
|
||||
throw Oops.Bah($"系统中无法找到{item.ebom_version}版本");
|
||||
throw Oops.Bah($"系统中无法找到物料清单{item.ebom_version}版本");
|
||||
}
|
||||
|
||||
if (!await db.Queryable<BasMbom>().LeftJoin<BasEbomH>((a, b) => a.ebom_id == b.id).Where((a, b) => a.material_id == item.material_id && b.version == item.ebom_version).AnyAsync())
|
||||
{
|
||||
throw Oops.Bah($"系统中无法找到物料清单对应的生产bom{item.ebom_version}版本");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1151,6 +1151,8 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
throw Oops.Bah("状态错误无法暂停");
|
||||
}
|
||||
|
||||
item.pause_reason = input.PauseReeson;
|
||||
break;
|
||||
case PrdTaskBehavior.Compled:
|
||||
if (item.mo_task_status == status)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user