From 6f0a6b40e86e2024c218d1d38cbdc5515fb95209 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 22 九月 2024 19:03:57 +0800
Subject: [PATCH] 获取工单模板变量

---
 Tiger.Business/MES/Biz.WorkStep.cs |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/Tiger.Business/MES/Biz.WorkStep.cs b/Tiger.Business/MES/Biz.WorkStep.cs
index 467f105..769d1a7 100644
--- a/Tiger.Business/MES/Biz.WorkStep.cs
+++ b/Tiger.Business/MES/Biz.WorkStep.cs
@@ -30,6 +30,7 @@
 
             #region Propertys & Variables
             public string ID { get; set; } = Guid.NewGuid().ToString("N");
+            public string Name { get; set; }
             public IWorkStep.NodeTypes NodeType { get; set; }
             public MES_WO_NODE Node { get; set; }
             public MES_WO_OPER OperSetting { get; set; }
@@ -43,9 +44,19 @@
             private bool _IsFinished = false;
             public bool IsFinished
             {
-                get => NodeType == IWorkStep.NodeTypes.Action ? CurAction.IsFinished : _IsFinished; 
+                get => NodeType == IWorkStep.NodeTypes.Action ? CurAction.IsFinished : _IsFinished;
                 set { _IsFinished = value; }
             }
+            public StepStatus Status { get; set; } = StepStatus.Normal;
+            //public bool IsFinished => Status == StepStatus.Finished;
+            private Locale _Message;
+            public Locale Message
+            {
+                get => _Message;
+                set { _MsgHistory.Add(_Message = value); }
+            }
+            private List<Locale> _MsgHistory = new();
+            public List<Locale> MsgHistory => _MsgHistory;
             public Action DBSubmitAction { get; set; } = () => { };
             #endregion
 
@@ -93,19 +104,30 @@
             /// 缁撴潫宸ユ鎵ц
             /// </summary>
             /// <returns></returns>
-            public ApiAction<SubmitOutput> End()
+            public ApiAction<SubmitOutput> End(SubmitInput input)
             {
-                return CurAction.End();
+                return CurAction.End(input);
+            }
+
+            /// <summary>
+            /// 璁剧疆宸ユ鐘舵�佸拰娑堟伅
+            /// </summary>
+            /// <returns></returns>
+            public void SetStatusMessage(StepStatus status, Locale msg)
+            {
+                Message = msg;
+                Status = status;
             }
 
             /// <summary>
             /// 鑾峰彇褰撳墠宸ユ鐨勪俊鎭�
             /// </summary>
             /// <returns></returns>
-            public WorkStepInfo GetInfo()
+            public WorkStepInfo GetInfo(string locale)
             {
                 return new WorkStepInfo() { 
                     ID = ID,
+                    Name = Name,
                     Sequence = Sequence,
                     NodeID = NodeID,
                     NodeType = NodeType.ToString(),
@@ -113,7 +135,8 @@
                     OperSetting = OperSetting,
                     NodeAct = NodeAct,
                     ActSetting = ActSetting,
-                    IsFinished = IsFinished,
+                    Status = Status.ToString(),
+                    Message = Message.IsNullOrEmpty() ? "" : Biz.T(Message, locale),
                 };
             }
             #endregion

--
Gitblit v1.9.3