From 617634e5e18c7c02f689de40353da113907da9a8 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期六, 05 十月 2024 14:25:18 +0800 Subject: [PATCH] 工单同步接口更新,箱盒二维码更新 --- 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