From 65dd14d46ed3764969be29e1a532743f355c0634 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Mon, 23 Oct 2023 17:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=20=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E4=B8=AD=E6=96=AD=E5=AE=8C=E6=88=90=E6=9A=82=E5=81=9C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/PrdMoTaskService.cs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 3c57b8fa..39856845 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1106,6 +1106,57 @@ namespace Tnb.ProductionMgr } } #endregion + + foreach (var item in prdTaskList) + { + switch (behavior) + { + // case PrdTaskBehavior.Release: + // if (item.mo_task_status == status) + // { + // throw Oops.Bah("已下发的不能再下发"); + // } + // break; + case PrdTaskBehavior.Start: + if (item.mo_task_status == status) + { + throw Oops.Bah("已开始的不能再开始"); + } + + if (item.mo_task_status!=DictConst.ToBeStartedEnCode || item.mo_task_status!=DictConst.MoStatusPauseCode) + { + throw Oops.Bah("状态错误无法开始"); + } + break; + case PrdTaskBehavior.Pause: + if (item.mo_task_status == status) + { + throw Oops.Bah("已暂停的不能再暂停"); + } + if (item.mo_task_status!=DictConst.InProgressEnCode) + { + throw Oops.Bah("状态错误无法暂停"); + } + break; + case PrdTaskBehavior.Compled: + if (item.mo_task_status == status) + { + throw Oops.Bah("已完成的不能再完成"); + } + if (item.mo_task_status!=DictConst.InProgressEnCode || item.mo_task_status!=DictConst.MoStatusPauseCode) + { + throw Oops.Bah("状态错误无法完成"); + } + break; + case PrdTaskBehavior.Closed: + if (item.mo_task_status == status) + { + throw Oops.Bah("已关闭的不能再关闭"); + } + break; + } + } + prdTaskList.ForEach(x => x.mo_task_status = status); if (behavior == PrdTaskBehavior.Start) {