工位只能有一个进行中的任务单

This commit is contained in:
2023-11-07 10:15:47 +08:00
parent 1a194cd2db
commit eb3037385e

View File

@@ -1114,6 +1114,11 @@ namespace Tnb.ProductionMgr
throw Oops.Bah("已开始的不能再开始");
}
if (await db.Queryable<PrdMoTask>().AnyAsync(x => x.workstation_id == item.workstation_id && x.mo_task_status == DictConst.InProgressEnCode && x.id != item.id))
{
throw Oops.Bah("该工位已有生产中的任务单");
}
if (item.mo_task_status is not DictConst.ToBeStartedEnCode and not DictConst.MoStatusPauseCode)
{
throw Oops.Bah("状态错误无法开始");