排产加模具状态 工单加物料清单版本
This commit is contained in:
@@ -164,6 +164,7 @@ namespace Tnb.ProductionMgr
|
||||
plan_qty = a.plan_qty,
|
||||
unit_id = d.FullName,
|
||||
mo_status = e.FullName,
|
||||
ebom_version = a.ebom_version,
|
||||
remark = a.remark,
|
||||
children = SqlFunc.Subqueryable<PrdMo>()
|
||||
.LeftJoin<BasMaterial>((aa, bb) => aa.material_id == bb.id)
|
||||
@@ -240,8 +241,12 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
throw new ArgumentException($"{nameof(input.Behavior)},not be null or empty");
|
||||
}
|
||||
|
||||
|
||||
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
|
||||
|
||||
//获取同组工单的Id,一起下发
|
||||
List<string?> combineMoCodes = await db.Queryable<PrdMo>().Where(it => input.WorkOrderIds.Contains(it.id)).Select(it => it.combine_mo_code).ToListAsync();
|
||||
if (combineMoCodes?.Count > 0)
|
||||
@@ -250,6 +255,16 @@ namespace Tnb.ProductionMgr
|
||||
input.WorkOrderIds = input.WorkOrderIds.Concat(moIds).ToList();
|
||||
}
|
||||
|
||||
List<PrdMo> prdMos = await db.Queryable<PrdMo>().Where(x => input.WorkOrderIds.Contains(x.id)).ToListAsync();
|
||||
|
||||
foreach (var item in prdMos)
|
||||
{
|
||||
if (!await db.Queryable<BasEbomH>().AnyAsync(x => x.material_id == item.material_id && x.version == item.ebom_version))
|
||||
{
|
||||
throw Oops.Bah($"系统中无法找到{item.ebom_version}版本");
|
||||
}
|
||||
}
|
||||
|
||||
static string getMoStatus(MoBehavior behavior)
|
||||
{
|
||||
string status = "";
|
||||
|
||||
Reference in New Issue
Block a user