This commit is contained in:
2024-06-17 14:42:06 +08:00
parent 97ccf2c082
commit a945d5db15

View File

@@ -1159,13 +1159,21 @@ namespace Tnb.ProductionMgr
throw Oops.Bah("已开始的不能再开始"); throw Oops.Bah("已开始的不能再开始");
} }
// if (item.schedule_type == 2) if (item.schedule_type == 2)
// { {
if (await db.Queryable<PrdMoTask>().AnyAsync(x => x.workline_id == item.workline_id && x.mo_task_status == DictConst.InProgressEnCode && x.id != item.id)) if (await db.Queryable<PrdMoTask>().AnyAsync(x => x.workline_id == item.workline_id && x.mo_task_status == DictConst.InProgressEnCode && x.id != item.id))
{ {
throw Oops.Bah("该产线已有生产中的任务单"); throw Oops.Bah("该产线已有生产中的任务单");
} }
// } }
if (item.schedule_type == 1)
{
if (await db.Queryable<PrdMoTask>().AnyAsync(x => x.eqp_id == item.eqp_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) if (item.mo_task_status is not DictConst.ToBeStartedEnCode and not DictConst.MoStatusPauseCode)
{ {