diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index b3129bd7..d15877e2 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1114,6 +1114,11 @@ namespace Tnb.ProductionMgr throw Oops.Bah("已开始的不能再开始"); } + if (await db.Queryable().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("状态错误无法开始");