From 9e69f34c93e7193d80dc207db7b6ce22743dcafc Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 09 十月 2024 23:22:27 +0800
Subject: [PATCH] 工单未配置工艺路线不能下发,YadaU9C数据连接

---
 Tiger.Business.MES/Common/WorkStep.cs |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Tiger.Business.MES/Common/WorkStep.cs b/Tiger.Business.MES/Common/WorkStep.cs
index 581fbd3..3ca316e 100644
--- a/Tiger.Business.MES/Common/WorkStep.cs
+++ b/Tiger.Business.MES/Common/WorkStep.cs
@@ -28,6 +28,9 @@
         #region Propertys & Variables
         public string ID { get; set; } = Guid.NewGuid().ToString("N");
         public string Name { get; set; }
+        private DateTime BeginAt;
+        private DateTime EndAt;
+        public TimeSpan ElapsedTime => EndAt - BeginAt;
         public IWorkStep.NodeTypes NodeType { get; set; }
         public MES_WO_NODE Node { get; set; }
         public MES_WO_OPER OperSetting { get; set; }
@@ -75,6 +78,7 @@
         /// <returns></returns>
         public ApiAction<SubmitOutput> TryBegin(SubmitInput input)
         {
+            BeginAt = DateTime.Now;
             return CurAction.TryBegin(input);
         }
 
@@ -103,7 +107,18 @@
         /// <returns></returns>
         public ApiAction<SubmitOutput> End(SubmitInput input)
         {
-            return CurAction.End(input);
+            var result = CurAction.End(input);
+            EndAt = DateTime.Now;
+            return result;
+        }
+
+        /// <summary>
+        /// 鑾峰彇宸ユ褰撳墠鑰楁椂
+        /// </summary>
+        /// <returns></returns>
+        public TimeSpan GetElapsedTime()
+        {
+            return DateTime.Now - BeginAt;
         }
 
         /// <summary>

--
Gitblit v1.9.3