From 0fdb04b7c451d7c59b226c25425722afd3364916 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期三, 25 九月 2024 16:37:52 +0800 Subject: [PATCH] 优化工序和行为逻辑 --- Tiger.Business.MES/Transaction/Position.cs | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs index 2ae001a..11eba06 100644 --- a/Tiger.Business.MES/Transaction/Position.cs +++ b/Tiger.Business.MES/Transaction/Position.cs @@ -48,6 +48,9 @@ #region Propertys & Variables public string UserCode { get; set; } public string PostCode { get; set; } + protected DateTime BeginAt; + protected DateTime EndAt; + public TimeSpan ElapsedTime => EndAt - BeginAt; public MES_FACTORY CurFactory { get; set; } public MES_WORKSHOP CurWorkshop { get; set; } public MES_LINE CurLine { get; set; } @@ -415,6 +418,10 @@ action.Invoke(); } } + //璁板綍宸ュ簭鑰楁椂 + EndAt = DateTime.Now; + var ids = CurWipSNHiss.Select(q => q.ID).ToList(); + GetCommitDB().Updateable<MES_WIP_HIS>().SetColumns(q => q.ELAPSED_TIME == ElapsedTime.TotalMilliseconds.ToInt64()).Where(q => ids.Contains(q.ID)).ExecuteCommand(); }); if (dbTran.IsSuccess) { -- Gitblit v1.9.3