From eec9f268552af1d0ce8c95312930770669f1cc18 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 16 八月 2024 22:40:16 +0800
Subject: [PATCH] 增加客户端需要的工序信息和短消息

---
 Tiger.Business.MES/Transaction/Position.cs |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs
index 757ae4e..eb431bf 100644
--- a/Tiger.Business.MES/Transaction/Position.cs
+++ b/Tiger.Business.MES/Transaction/Position.cs
@@ -56,7 +56,7 @@
         public WorkBatch CurBatch { get; set; }
         public IWorkBatch WorkBatch => CurBatch;
         public List<MES_WIP_DATA> CurWipSNs { get; set; } = new();
-        public string CurSN => CurWipSNs.Any() ? (CurWipSNs.First().TRAY_SN.IsNullOrEmpty() ? CurWipSNs.First().SN : CurWipSNs.First().TRAY_SN) : "";
+        public string CurSN => (CurWipSNs.Any() ? (CurWipSNs.First().TRAY_SN.IsNullOrEmpty() ? CurWipSNs.First().SN : CurWipSNs.First().TRAY_SN) : "");
         public List<MES_WIP_HIS> CurWipSNHiss { get; set; } = new();
         public List<MES_WIP_DFT> CurDefects { get; set; } = new();
         public Dictionary<string, object> Context { get; set; } = new();
@@ -73,7 +73,8 @@
         public bool NeedTemporaryStoreDBCommitAction { get; set; } = false;
         protected List<Action> DBCommitList { get; set; } = new();
         protected List<Position> NodeCommitList { get; set; } = new();
-
+        protected Dictionary<string, OperInfo> OperInfoDic { get; set; } = new();
+        protected OperInfo CurOperInfo { get; set; }
         #endregion Propertys & Variables
 
         #region Functions
@@ -125,6 +126,7 @@
                     WoContext.WoBatchDic.Add(wb.Batch.BATCH_NO, wb);
                 }
                 CurBatch = WoContext.GetBatch(input.OrderNo, CurLine.LINE_CODE);
+                OperInfoDic.Add(CurBatch.Batch.BATCH_NO, new());
                 action.Data = new { WorkOrder = CurBatch.WO, Bacth = CurBatch.Batch };
             }
             catch (Exception ex)
@@ -184,6 +186,24 @@
         }
 
         /// <summary>
+        /// 璁剧疆褰撳墠鏉$爜鐨勫伐搴忎俊鎭�
+        /// </summary>
+        public OperInfo SetOperNodeInfo(OperInfo info)
+        {
+            if (CurWipSNs.Any())
+            {
+                info.CurNode = CurWipSNs.First().NODE_NAME;
+                info.NextNode = string.Join(",", CurBatch.GetNextNodes(CurWipSNs.First()).Select(q => q.NODE_NAME));
+            }
+            else
+            {
+                info.CurNode = "   鈥�   ";
+                info.NextNode = "   鈥�   ";
+            }
+            return info;
+        }
+
+        /// <summary>
         /// 鐢熸垚浼犲叆宸ユ鍚庣画鐨勮涓哄埌宸ユ鍒楄〃
         /// </summary>
         /// <param name="parent"></param>

--
Gitblit v1.9.3