bug,生产bom工序添加排序和是否最后一道工序字段

This commit is contained in:
2023-06-25 15:18:51 +08:00
parent 586d0e1ffc
commit ab238d4f3c
4 changed files with 33 additions and 4 deletions

View File

@@ -1263,7 +1263,22 @@ namespace Tnb.ProductionMgr
.SetColumns(x => x.reported_work_qty == x.reported_work_qty + input.reported_qty)
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
}
var mbomProcess = await db.Queryable<BasMbomProcess>().SingleAsync(x => x.id == prdMoTask.mbom_process_id);
if (mbomProcess.is_last==1 && prdMoTask != null && !string.IsNullOrEmpty(prdMoTask.parent_id))
{
var parentMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == prdMoTask.parent_id);
if (parentMoTask?.last_process_complete_qty == null)
{
await db.Updateable<PrdMoTask>()
.SetColumns(x => x.last_process_complete_qty == input.reported_qty)
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
}else if (parentMoTask?.last_process_complete_qty != null)
{
await db.Updateable<PrdMoTask>()
.SetColumns(x => x.last_process_complete_qty == x.last_process_complete_qty + input.reported_qty)
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
}
}
var master = await db.Queryable<PrdReportRecord>().FirstAsync(it => it.mo_task_id == input.mo_task_id);
if (master != null)