From 37c4128d884e46d1f50c0a003c34a1749cda5841 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 15 十月 2024 08:45:40 +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