From c5c41deac02df2ac552f7eb51e8b9b5f5dcc5472 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 28 十月 2024 12:51:38 +0800 Subject: [PATCH] 计划任务更新 --- Tiger.Business.MES/Common/WorkStep.cs | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/Tiger.Business.MES/Common/WorkStep.cs b/Tiger.Business.MES/Common/WorkStep.cs index 3ca316e..6b790d7 100644 --- a/Tiger.Business.MES/Common/WorkStep.cs +++ b/Tiger.Business.MES/Common/WorkStep.cs @@ -41,6 +41,12 @@ public int Sequence { get; set; } public List<string> PrepNodeIDs { get; set; } = new(); public string NodeID => NodeType == IWorkStep.NodeTypes.Action ? NodeAct.ID : Node.ID; + private bool _IsActive = true; + public bool IsActive + { + get => NodeType == IWorkStep.NodeTypes.Action ? ActSetting.IS_ACTIVE == "Y" : _IsActive; + set { _IsActive = value; } + } private bool _IsFinished = false; public bool IsFinished { @@ -79,7 +85,23 @@ public ApiAction<SubmitOutput> TryBegin(SubmitInput input) { BeginAt = DateTime.Now; - return CurAction.TryBegin(input); + //宸ユ琛屼负鍚敤鍒欐甯告墽琛� + if (IsActive) + { + return CurAction.TryBegin(input); + } + //宸ユ琛屼负涓嶅惎鐢紝鍚﹀垯宸ユ榛樿瀹屾垚 + else + { + CurAction.IsFinished = true; + var action = new ApiAction<SubmitOutput>(new SubmitOutput()); + this.Message = Biz.L($"琛屼负鏈惎鐢�"); + this.Status = StepStatus.InActive; + action.Data.ShortMsg = new($"琛屼负鏈惎鐢�", ShortMessage.Types.Success); + //action.LocaleMsg = new($"{0}琛屼负鏈惎鐢�"); + action.LocaleMsg = new("MES.WorkAction.NotActive", NodeAct.ACT_NAME); + return action; + } } /// <summary> -- Gitblit v1.9.3