From c6494a547258df9180f181dc00d6e4dd1633ec36 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 13 二月 2025 19:03:15 +0800
Subject: [PATCH] 更新数据库配置和出货逻辑

---
 Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs |   73 +++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 7 deletions(-)

diff --git a/Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs b/Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs
index 82074a3..e375aff 100644
--- a/Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs
+++ b/Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs
@@ -46,9 +46,9 @@
         /// </summary>
         public string DFT_CODE { get; set; }
         /// <summary>
-        /// 褰撳墠鎿嶄綔闇�瑕佹彁浜ょ殑閫夐」
+        /// 褰撳墠鎿嶄綔鐨勮涓虹殑鍙橀噺瀛楀吀锛屽鏋滄槸涓嶆槸琛屼负锛屽惁鍒欑暀绌�
         /// </summary>
-        public Dictionary<string, string> Options { get; set; } = new Dictionary<string, string>();
+        public Dictionary<string, string> ActionDic { get; set; } = new Dictionary<string, string>();
         /// <summary>
         /// 褰撳墠鎿嶄綔闇�瑕佹彁浜ょ殑鏁版嵁
         /// </summary>
@@ -62,10 +62,6 @@
         /// </summary>
         public bool IsFinished { get; set; } = false;
         /// <summary>
-        /// 鐭秷鎭�
-        /// </summary>
-        public ShortMessage ShortMsg { get; set; }
-        /// <summary>
         /// 褰撳墠鎿嶄綔鐨勮妭鐐瑰悕绉�
         /// </summary>
         public string NodeName { get; set; }
@@ -78,9 +74,21 @@
         /// </summary>
         public string ActionType { get; set; }
         /// <summary>
+        /// 褰撳墠鎿嶄綔鐨勮涓虹殑鍙橀噺瀛楀吀锛屽鏋滄槸涓嶆槸琛屼负锛屽惁鍒欑暀绌�
+        /// </summary>
+        public Dictionary<string, string> ActionDic { get; set; }
+        /// <summary>
         /// 涓嬩竴涓搷浣滅殑宸ユID
         /// </summary>
         public string NextStepID { get; set; }
+        /// <summary>
+        /// 鐭秷鎭�
+        /// </summary>
+        public ShortMessage ShortMsg { get; set; }
+        /// <summary>
+        /// Mqtt娑堟伅
+        /// </summary>
+        public MQTT.Message MqttMsg { get; set; }
         /// <summary>
         /// 褰撳墠鎿嶄綔杩斿洖鐨勬暟鎹�
         /// </summary>
@@ -177,6 +185,7 @@
         public WeightInfo WeightInfo { get; set; } = new WeightInfo();
         public bool IsFinished => Item.IsFinished;
         public bool IsReachedEndNode { get; set; } = false;
+        public string InStoreActID { get; set; }
         public BAS_LABEL_TEMP InStoreLabel { get; set; }
     }
 
@@ -194,8 +203,48 @@
         public string SN { get; set; }
         public MES_WIP_PKG Package { get; set; }
         public bool IsFinished { get; set; } = false;
+        public bool PkgComplete => PKG_LEVEL == 1 || Items.Count(q => q.IsFinished) == PKG_QTY;
         public List<WipPkgItem> Items { get; set; } = new List<WipPkgItem>();
-        public int TotalQty => Items.Any() ? Items.Sum(q => q.TotalQty) : 1;
+        public Dictionary<string, string> WipSNs { get; set; } = new Dictionary<string, string>();
+        public double TotalQty => Items.Any() ? Items.Sum(q => q.TotalQty) : Package?.QTY ?? 0;
+
+        public List<MES_WIP_PKG> GetMinPackageList()
+        {
+            var list = new List<MES_WIP_PKG>();
+            if (Items.Any())
+            {
+                foreach (var item in Items)
+                {
+                    item.Package.PARENT_SN = Package?.SN;
+                    list.AddRange(item.GetMinPackageList());
+                }
+            }
+            else
+            {
+                if (Package != null)
+                {
+                    list.Add(Package);
+                }
+            }
+            return list;
+        }
+
+        public List<KeyValuePair<string, string>> GetWipSnList()
+        {
+            var list = new List<KeyValuePair<string, string>>();
+            if (Items.Any())
+            {
+                foreach (var item in Items)
+                {
+                    list.AddRange(item.GetWipSnList());
+                }
+            }
+            else
+            {
+                list.AddRange(WipSNs.ToList());
+            }
+            return list;
+        }
     }
 
     /// <summary>
@@ -281,4 +330,14 @@
         public string Message { get; set; }
     }
 
+    /// <summary>
+    /// 鍑鸿揣淇℃伅
+    /// </summary>
+    public class ShipingInfo
+    {
+        public bool IsPrintCustomerLabel { get; set; }
+        public int OldShipQty { get; set; }
+        public int ShipQty { get; set; }
+    }
+
 }

--
Gitblit v1.9.3