From cd8182d8fefc55c245400936b6330a00e866adbd Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期二, 24 十二月 2024 21:25:06 +0800
Subject: [PATCH] 优化标准上下架

---
 Tiger.Api/Language.db                                          |    0 
 Tiger.Business.WMS/Transaction/In_Default.cs                   |  285 +++++++----
 Tiger.Model.Net/Tiger.Model.Net.csproj                         |    3 
 Tiger.IBusiness/Core/ApiConfig.cs                              |    2 
 Tiger.Model.Net/Entitys/WMS/Api/Output_Entitys.cs              |   40 +
 Tiger.Model.Net/Entitys/WMS/Api/Input_Entitys.cs               |   70 ++
 Tiger.Model.Net/Entitys/MES/MES_ROUTE_ACT_VAR.cs               |  156 ++++++
 Tiger.Model.Net/Entitys/MES/MES_WO_ACT_VAR.cs                  |  166 +++++++
 Tiger.Controllers.WMS/Controllers/WMSController.Out_Default.cs |   82 +-
 Tiger.Controllers.WMS/Controllers/WMSController.In_Default.cs  |   82 +-
 Tiger.Model.Net/Entitys/MES/MES_WIP_ACT.cs                     |    5 
 Tiger.Business.WMS/Transaction/Out_Default.cs                  |   51 +
 Tiger.IBusiness.WMS/Transaction/IIn_Default.cs                 |    9 
 Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs                   |   49 --
 Tiger.Model.Net/Entitys/MES/MES_WIP_ACT_VAR.cs                 |  276 ++++++++++++
 Tiger.Business.WMS/Transaction/WMSTransactionBase.cs           |   59 ++
 Tiger.IBusiness.WMS/Transaction/IOut_Default.cs                |    8 
 17 files changed, 1,058 insertions(+), 285 deletions(-)

diff --git a/Tiger.Api/Language.db b/Tiger.Api/Language.db
index da6c80a..88b1413 100644
--- a/Tiger.Api/Language.db
+++ b/Tiger.Api/Language.db
Binary files differ
diff --git a/Tiger.Business.WMS/Transaction/In_Default.cs b/Tiger.Business.WMS/Transaction/In_Default.cs
index c7aebea..f83e6fb 100644
--- a/Tiger.Business.WMS/Transaction/In_Default.cs
+++ b/Tiger.Business.WMS/Transaction/In_Default.cs
@@ -12,6 +12,9 @@
 using Tiger.Model.Sharetronic.Shelf;
 using Tiger.Business.WMS.Sharetronic.Shelf;
 using Microsoft.IdentityModel.Tokens;
+using Apache.NMS.ActiveMQ.Commands;
+using Tiger.Model.MES.Yada;
+using Tiger.Model.Entitys.MES.Position;
 
 namespace Tiger.Business.WMS.Transaction
 {
@@ -36,15 +39,16 @@
         public string OrgCode { get; set; }
         public Inventory CurInvItem { get; set; }
         public ScanShelfInfo CurScanShelf { get; set; }
+        public string Command { get; set; } = "Normal";
         #endregion
 
         #region Functions
         /// <summary>
-        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鐗╂枡宸茬粡瀹屾垚绉诲簱鍒欒揣鏋朵笂浜伅鎻愰啋鍌ㄤ綅
+        /// 鎵弿鍏ュ彛
         /// </summary>
-        public async Task<ApiAction> ScanItem(BaseInput input)
+        public async Task<ApiAction<ScanOutput>> Scan(BaseInput input)
         {
-            var action = new ApiAction();
+            var action = new ApiAction<ScanOutput>();
             try
             {
                 if (input.SN.IsNullOrEmpty())
@@ -52,115 +56,173 @@
                     action.IsSuccessed = false;
                     //action.LocaleMsg = Biz.L("鏉$爜涓嶈兘涓虹┖");
                     action.LocaleMsg = Biz.L("WMS.Default.ScanItem.SnEmptyFailure");
-                    return action;
+                    return SetOutPutMqttMsg(action, input.Locale);
                 }
                 //璐ф灦涓虹┖鍒欐壂鎻忕殑璁や负鏄揣鏋�
-                if (string.IsNullOrEmpty(CurScanShelf?.RackCode))
+                if (string.IsNullOrEmpty(CurScanShelf?.ShelfCode))
                 {
-                    var _action = await ScanShelf(input.SN);
-                    action.LocaleMsg = _action.LocaleMsg;
-                    action.IsSuccessed = _action.IsSuccessed;
-                    action.Data = _action.Data;
-                    return action;
+                    action = await ScanShelf(input.SN);
                 }
+                //鎵弿鐗╂枡骞跺鏍�
+                {
+                    action = await ScanItem(input);
+                }
+            }
+            catch (Exception ex)
+            {
+                //鍙栨秷褰撳墠鎿嶄綔
+                ResetInfo();
+                //action.CatchExceptionWithLog(ex, $"鎵弿[{input.SN}]寮傚父");
+                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.Scan.ScanException", input.SN));
+            }
+            return SetOutPutMqttMsg(action, input.Locale);
+        }
 
-                Result<IInventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true);
-                if (!result.IsSuccessed)
+        /// <summary>
+        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鐗╂枡宸茬粡瀹屾垚绉诲簱鍒欒揣鏋朵笂浜伅鎻愰啋鍌ㄤ綅
+        /// </summary>
+        public async Task<ApiAction<ScanOutput>> ScanItem(BaseInput input)
+        {
+            var action = new ApiAction<ScanOutput>(new ScanOutput() { Command = Command });
+            try
+            {
+                if (CurInvItem.IsNullOrEmpty())
                 {
-                    action.IsSuccessed = false;
-                    action.LocaleMsg = result.LocaleMsg;
-                    return action;
-                }
-                var inv = result.Data as Inventory;
+	                Result<IInventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true);
+	                if (!result.IsSuccessed)
+	                {
+	                    action.IsSuccessed = false;
+	                    action.LocaleMsg = result.LocaleMsg;
+	                    return action;
+	                }
+	                CurInvItem = result.Data as Inventory;
 
-                //楠岃瘉鏉$爜鏄惁姝g‘!inv.isNormalStatus || inv.Status.GetValue() != WMS_ITEM.STATUSs.NotExists.GetValue() && 
-                if (inv.Status.GetValue() == WMS_ITEM.STATUSs.InStore.GetValue())
-                {
-                    action.IsSuccessed = false;
-                    //action.LocaleMsg = Biz.L("鐘舵�乕{0}]寮傚父锛岃閲嶆柊鎵弿");
-                    action.LocaleMsg = Biz.L("WMS.Default.ScanItem.StatusException", string.Join(',', inv.StatusList.Select(q => q.GetDesc())));
-                    return action;
-                }
-                //鐗╂枡楠岃瘉
-                if (inv.ItemInfo.IsNullOrEmpty() || inv.ItemInfo.IS_ACTIVE == "N")
-                {
-                    action.IsSuccessed = false;
-                    //action.LocaleMsg = Biz.L("鐗╂枡缂栫爜[{0}]涓嶅瓨鍦ㄦ垨鑰呰鐗╂枡鏈惎鐢�");
-                    action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ItemCodeNotExistsOrNotActive", inv.ItemInfo.ITEM_CODE.IsNullOrEmpty(inv.Barcode.ItemCode));
-                    return action;
-                }
-
-                if (!inv.IsNullOrEmpty())
-                {
-                    if (inv.Items.Count == 0)
+                    //楠岃瘉鏉$爜鏄惁姝g‘
+                    if (new[] { WMS_ITEM.STATUSs.InStore, WMS_ITEM.STATUSs.Loaded, WMS_ITEM.STATUSs.UseUp }.Contains(CurInvItem.Status))
                     {
-                        List<WMS_ITEM_HIS> ItemHistorys = new List<WMS_ITEM_HIS>();
-                        WMS_ITEM Item;
-                        WMS_ITEM_PKG ItemPkgs;
+                        action.IsSuccessed = false;
+                        //action.LocaleMsg = Biz.L("鐘舵�乕{0}]寮傚父锛岃閲嶆柊鎵弿");
+                        action.LocaleMsg = Biz.L("WMS.Default.ScanItem.StatusException", string.Join(',', CurInvItem.StatusList.Select(q => q.GetDesc())));
+                        return action;
+                    }
+                    //鐗╂枡楠岃瘉
+                    if (CurInvItem.ItemInfo.IsNullOrEmpty() || CurInvItem.ItemInfo.IS_ACTIVE == "N")
+                    {
+                        action.IsSuccessed = false;
+                        //action.LocaleMsg = Biz.L("鐗╂枡缂栫爜[{0}]涓嶅瓨鍦ㄦ垨鑰呰鐗╂枡鏈惎鐢�");
+                        action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ItemCodeNotExistsOrNotActive", CurInvItem.ItemInfo.ITEM_CODE.IsNullOrEmpty(CurInvItem.Barcode.ItemCode));
+                        return action;
+                    }
 
-                        Item = new()
+                    //妫�鏌ョ墿鏂欐暟閲忥紝濡傛灉娌℃湁鍒欐煡璇㈤泤杈炬潯鐮佷富妗o紝鎶婃暟閲忚繑鍥炲墠绔‘璁�
+                    if (CurInvItem.Items.Any(q => q.QTY <= 0))
+                    {
+                        var qtyList = Biz.DataSource["YadaU9C"].Client.Queryable<mes_MaterialBarCode>().Where(q => CurInvItem.Items.Select(q => q.SN).Contains(q.Code)).ToList();
+                        foreach (var qty in qtyList)
                         {
-                            SN = inv.Barcode.SN,
-                            ITEM_CODE = inv.Barcode.ItemCode,
-                            AUTH_ORG = input.AuthOption.CurOrg,
-                            STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(),
-                            QTY = inv.Barcode.Qty.ToDecimal(),
-                            PROD_DATE = inv.Barcode.DateCode.ToDateTime(),
-                            ERP_WH = CurScanShelf.WarehouseCode,
-                            UNIT = inv.Barcode.Unit,
-                        };
-
-                        WMS_ITEM_HIS his = new(Item, $"鏍囧噯涓婃灦鍏ュ簱");
-                        ItemHistorys.Add(his);
-                        ItemPkgs = new()
-                        {
-                            SN = inv.Barcode.SN,
-                            AUTH_ORG = input.AuthOption.CurOrg,
-                            ITEM_CODE = inv.Barcode.ItemCode,
-                            QTY = inv.Barcode.Qty.ToDecimal(),
-                            ERP_WH = CurScanShelf.WarehouseCode,
-                            UNIT = inv.Barcode.Unit,
-                        };
-
-                        var noExt = inv.Items.Where(q => !inv.ItemsExt.Any(s => s.SN == q.SN)).ToList();
-                        //鎵╁睍琛ㄤ笉瀛樺湪鏃舵柊寤�
-                        foreach (var item in noExt)
-                        {
-                            inv.ItemsExt.Add(new()
-                            {
-                                SN = item.SN,
-                                META_SN = inv.Barcode.MetaSn,
-                                QR_CODE = inv.Barcode.MetaSn
-                            });
+                            var item = CurInvItem.Items.First(q => q.SN == qty.Code);
+                            item.QTY = qty.WhQty;
                         }
-
-                        inv.Items.Add(Item);
-                        inv.History.Add(his);
-                        inv.Packages.Add(ItemPkgs);
+                        action.Data.Data = CurInvItem.Items.ToDictionary(k => k.SN, v => v.QTY);
+                        action.Data.Command = Command = "ComfirmQty";
+                        //action.LocaleMsg = Biz.L("璇风‘璁ゆ潯鐮乕{0}]鐨勬暟閲忔槸鍚︽纭�");
+                        action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ComfirmQty", input.SN);
+                        return action;
                     }
-                    else if (inv.Items.Count == 1)
+                }
+
+                //鏇存柊宸茬‘璁ょ墿鏂欐暟閲�
+                if (Command == "ComfirmQty")
+                {
+                    var qtyList = (input.Data ?? "").JsonToObject<Dictionary<string, decimal>>() ?? new Dictionary<string, decimal>();
+                    if (qtyList.Any(q => q.Value <= 0))
                     {
-                        inv.Items.First().QTY = inv.Barcode.Qty.ToDecimal();
-                        inv.Items.First().ERP_WH = CurScanShelf.WarehouseCode;
-                        inv.Items.First().AUTH_ORG = input.AuthOption.CurOrg;
-
-                        inv.Packages.First().QTY = inv.Barcode.Qty.ToDecimal();
-                        inv.Packages.First().ERP_WH = CurScanShelf.WarehouseCode;
-                        inv.Packages.First().AUTH_ORG = input.AuthOption.CurOrg;
-                    }
-                    //濡傛灉鎵弿澶栫鐨勪笉鑳芥洿鏂版暟閲�
+                        action.IsSuccessed = false;
+                        action.Data.Data = CurInvItem.Items.ToDictionary(k => k.SN, v => v.QTY);
+                        action.Data.Command = Command = "ComfirmQty";
+                        //action.LocaleMsg = Biz.L("鏁伴噺涓嶈兘灏忎簬绛変簬闆讹紝璇烽噸鏂扮‘璁ゆ潯鐮乕{0}]鐨勬暟閲�");
+                        action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ReComfirmQty", input.SN); 
+                        return action;
+                    } 
                     else
                     {
-                        foreach (var item in inv.Items)
+	                    foreach (var qty in qtyList)
+	                    {
+	                        var item = CurInvItem.Items.First(q => q.SN == qty.Key);
+	                        item.QTY = qty.Value;
+	                    }
+                        Command = "Normal";
+                    }
+                }
+
+                if (CurInvItem.Items.Count == 0)
+                {
+                    List<WMS_ITEM_HIS> ItemHistorys = new List<WMS_ITEM_HIS>();
+                    WMS_ITEM Item;
+                    WMS_ITEM_PKG ItemPkgs;
+
+                    Item = new()
+                    {
+                        SN = CurInvItem.Barcode.SN,
+                        ITEM_CODE = CurInvItem.Barcode.ItemCode,
+                        AUTH_ORG = input.AuthOption.CurOrg,
+                        STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(),
+                        QTY = CurInvItem.Barcode.Qty.ToDecimal(),
+                        PROD_DATE = CurInvItem.Barcode.DateCode.ToDateTime(),
+                        ERP_WH = CurScanShelf.WarehouseCode,
+                        UNIT = CurInvItem.Barcode.Unit,
+                    };
+
+                    WMS_ITEM_HIS his = new(Item, $"鏍囧噯涓婃灦鍏ュ簱");
+                    ItemHistorys.Add(his);
+                    ItemPkgs = new()
+                    {
+                        SN = CurInvItem.Barcode.SN,
+                        AUTH_ORG = input.AuthOption.CurOrg,
+                        ITEM_CODE = CurInvItem.Barcode.ItemCode,
+                        QTY = CurInvItem.Barcode.Qty.ToDecimal(),
+                        ERP_WH = CurScanShelf.WarehouseCode,
+                        UNIT = CurInvItem.Barcode.Unit,
+                    };
+
+                    var noExt = CurInvItem.Items.Where(q => !CurInvItem.ItemsExt.Any(s => s.SN == q.SN)).ToList();
+                    //鎵╁睍琛ㄤ笉瀛樺湪鏃舵柊寤�
+                    foreach (var item in noExt)
+                    {
+                        CurInvItem.ItemsExt.Add(new()
                         {
-                            item.ERP_WH = CurScanShelf.WarehouseCode;
-                            item.AUTH_ORG = input.AuthOption.CurOrg;
-                        }
-                        foreach (var item in inv.Packages)
-                        {
-                            item.ERP_WH = CurScanShelf.WarehouseCode;
-                            item.AUTH_ORG = input.AuthOption.CurOrg;
-                        }
+                            SN = item.SN,
+                            META_SN = CurInvItem.Barcode.MetaSn,
+                            QR_CODE = CurInvItem.Barcode.MetaSn
+                        });
+                    }
+
+                    CurInvItem.Items.Add(Item);
+                    CurInvItem.History.Add(his);
+                    CurInvItem.Packages.Add(ItemPkgs);
+                }
+                else if (CurInvItem.Items.Count == 1)
+                {
+                    CurInvItem.Items.First().QTY = CurInvItem.Barcode.Qty.ToDecimal();
+                    CurInvItem.Items.First().ERP_WH = CurScanShelf.WarehouseCode;
+                    CurInvItem.Items.First().AUTH_ORG = input.AuthOption.CurOrg;
+
+                    CurInvItem.Packages.First().QTY = CurInvItem.Barcode.Qty.ToDecimal();
+                    CurInvItem.Packages.First().ERP_WH = CurScanShelf.WarehouseCode;
+                    CurInvItem.Packages.First().AUTH_ORG = input.AuthOption.CurOrg;
+                }
+                //濡傛灉鎵弿澶栫鐨勪笉鑳芥洿鏂版暟閲�
+                else
+                {
+                    foreach (var item in CurInvItem.Items)
+                    {
+                        item.ERP_WH = CurScanShelf.WarehouseCode;
+                        item.AUTH_ORG = input.AuthOption.CurOrg;
+                    }
+                    foreach (var item in CurInvItem.Packages)
+                    {
+                        item.ERP_WH = CurScanShelf.WarehouseCode;
+                        item.AUTH_ORG = input.AuthOption.CurOrg;
                     }
                 }
 
@@ -168,7 +230,7 @@
                 // 鍒ゆ柇鏄惁鏅鸿兘璐ф灦
                 if (CurScanShelf.Shelf.IsLightShelf)
                 {
-                    ShelfApiResult shelfApiResult = await Share.Shelf.PutOn(TransID, CurScanShelf.Shelf, inv.Items[0]);
+                    ShelfApiResult shelfApiResult = await Share.Shelf.PutOn(TransID, CurScanShelf.Shelf, CurInvItem.Items[0]);
                     if (!shelfApiResult.IsSuccess)
                     {
                         action.IsSuccessed = false;
@@ -209,7 +271,7 @@
                 }
 
                 //鍒ゆ柇鍌ㄤ綅鏄惁鍗曟斁
-                if (nLocation.IS_SINGLE == "Y" && inv.Items.Count > 1)
+                if (nLocation.IS_SINGLE == "Y" && CurInvItem.Items.Count > 1)
                 {
                     action.IsSuccessed = false;
                     //action.LocaleMsg = Biz.L("鍌ㄤ綅[{0}]鍙兘瀛樻斁涓�涓墿鏂�");
@@ -218,12 +280,12 @@
                 }
 
                 //鎵ц涓婃灦
-                foreach (var item in inv.Items)
+                foreach (var item in CurInvItem.Items)
                 {
                     item.TRANS_CODE = "In_Default";
                     item.TRANS_NO = $"In_Default_{DateTime.Now:yyyyMMdd}";
                 }
-                Result<PutOnInfo> putonResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE);
+                Result<PutOnInfo> putonResult = WMS_ITEM_Biz.WmsItem.PutOn(CurInvItem, input.AuthOption, nLocation.LOCATION_CODE);
                 if (!putonResult.IsSuccessed)
                 {
                     action.IsSuccessed = false;
@@ -250,21 +312,21 @@
                     throw dbTran.ErrorException;
                 }
                 // 杩斿洖鍏朵粬鍏ュ簱瀵硅薄
-                action.Data = new DefaultInStoreOutput
+                action.Data.Data = new DefaultInStoreOutput
                 {
-                    Barcode = inv.SN,
-                    MaterialCode = inv.ItemInfo.ITEM_CODE,
-                    MaterialName = inv.ItemInfo.ITEM_NAME,
-                    CurrentQty = inv.Items[0].QTY,
-                    Unit = inv.Items[0].UNIT,
-                    DateCode = inv.Items[0].PROD_DATE,
+                    Barcode = CurInvItem.SN,
+                    MaterialCode = CurInvItem.ItemInfo.ITEM_CODE,
+                    MaterialName = CurInvItem.ItemInfo.ITEM_NAME,
+                    CurrentQty = CurInvItem.Items[0].QTY,
+                    Unit = CurInvItem.Items[0].UNIT,
+                    DateCode = CurInvItem.Items[0].PROD_DATE,
                     WarehouseCode = putOnInfo.Warehouse.WH_CODE,
                     RegionCode = putOnInfo.Region.REGION_CODE,
                     ShelfCode = putOnInfo.Shelf.SHELF_CODE,
                     LocationCode = putOnInfo.Location.LOCATION_CODE,
                 };
                 //action.LocaleMsg = Biz.L($"鎵弿鏉$爜[{0}]涓婃灦鍒板偍浣峓{1}]鎴愬姛");
-                action.LocaleMsg = Biz.L("WMS.Default.ScanItem.PutOnSucceeded", inv.SN, putOnInfo.Location.LOCATION_CODE);
+                action.LocaleMsg = Biz.L("WMS.Default.ScanItem.PutOnSucceeded", CurInvItem.SN, putOnInfo.Location.LOCATION_CODE);
             }
             catch (Exception ex)
             {
@@ -279,9 +341,9 @@
         /// <summary>
         /// 鎵弿璐ф灦鎴栬�呭偍浣�
         /// </summary>
-        public async Task<ApiAction<ScanShelfInfo>> ScanShelf(string Code)
+        public async Task<ApiAction<ScanOutput>> ScanShelf(string Code)
         {
-            var action = new ApiAction<ScanShelfInfo>();
+            var action = new ApiAction<ScanOutput>();
             try
             {
                 if (Code.IsNullOrEmpty())
@@ -348,7 +410,7 @@
                 CurScanShelf.IsScanShelf = true;
                 //action.LocaleMsg = Biz.L("鎵弿璐ф灦/鍌ㄤ綅[{0}]鎴愬姛");
                 action.LocaleMsg = Biz.L("WMS.Default.ScanShelf.ScanSucceeded", Code);
-                action.Data = CurScanShelf;
+                action.Data.Data = CurScanShelf;
             }
             catch (Exception ex)
             {
@@ -368,6 +430,7 @@
         public override void ResetInfo()
         {
             base.ResetInfo();
+            Command = null;
             CurInvItem = null;
             CurScanShelf = null;
         }
diff --git a/Tiger.Business.WMS/Transaction/Out_Default.cs b/Tiger.Business.WMS/Transaction/Out_Default.cs
index 88d5500..cd5dfb3 100644
--- a/Tiger.Business.WMS/Transaction/Out_Default.cs
+++ b/Tiger.Business.WMS/Transaction/Out_Default.cs
@@ -35,15 +35,16 @@
         public string OrgCode { get; set; }
         public Inventory CurInvItem { get; set; }
         public ScanShelfInfo CurScanShelf { get; set; }
+        public string Command { get; set; } = "Normal";
         #endregion
 
         #region Functions
         /// <summary>
-        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鏄櫤鑳借揣鏋跺垯浜伅鎻愰啋鍌ㄤ綅
+        /// 鎵弿鍏ュ彛
         /// </summary>
-        public async Task<ApiAction<DefaultScanItemOutput>> ScanItem(BaseInput input)
+        public async Task<ApiAction<ScanOutput>> Scan(BaseInput input)
         {
-            var action = new ApiAction<DefaultScanItemOutput>();
+            var action = new ApiAction<ScanOutput>();
             try
             {
                 if (input.SN.IsNullOrEmpty())
@@ -51,9 +52,31 @@
                     action.IsSuccessed = false;
                     //action.LocaleMsg = Biz.L("鏉$爜涓嶈兘涓虹┖");
                     action.LocaleMsg = Biz.L("WMS.Default.ScanItem.SnEmptyFailure");
-                    return action;
+                    return SetOutPutMqttMsg(action, input.Locale);
                 }
+                //鎵弿鐗╂枡骞跺鏍�
+                {
+                    action = await ScanItem(input);
+                }
+            }
+            catch (Exception ex)
+            {
+                //鍙栨秷褰撳墠鎿嶄綔
+                ResetInfo();
+                //action.CatchExceptionWithLog(ex, $"鎵弿[{input.SN}]寮傚父");
+                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.Scan.ScanException", input.SN));
+            }
+            return SetOutPutMqttMsg(action, input.Locale);
+        }
 
+        /// <summary>
+        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鏄櫤鑳借揣鏋跺垯浜伅鎻愰啋鍌ㄤ綅
+        /// </summary>
+        public async Task<ApiAction<ScanOutput>> ScanItem(BaseInput input)
+        {
+            var action = new ApiAction<ScanOutput>(new ScanOutput() { Command = Command });
+            try
+            {
                 //瑙f瀽鏉$爜
                 Result<IInventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true);
                 if (!result.IsSuccessed)
@@ -125,7 +148,7 @@
                     throw dbTran.ErrorException;
                 }
 
-                action.Data = new DefaultScanItemOutput()
+                action.Data.Data = new DefaultScanItemOutput()
                 {
                     SN = CurInvItem.SN,
                     ItemCode = CurInvItem.ItemInfo.ITEM_CODE,
@@ -138,13 +161,13 @@
                     ScanAfCut = CurInvItem.Warehouse.SCAN_AF_CUT
                 };
                 //action.LocaleMsg = Biz.L($"鎵弿鏉$爜[{0}]浠庡偍浣峓{1}]涓嬫灦鎴愬姛");
-                action.LocaleMsg = Biz.L("WMS.Default.ScanItem.TakeDownSucceeded", action.Data.SN, action.Data.locationCode);
+                action.LocaleMsg = Biz.L("WMS.Default.ScanItem.TakeDownSucceeded", CurInvItem.SN, CurInvItem.Location?.LOCATION_CODE);
             }
             catch (Exception ex)
             {
                 ResetInfo();
                 //action.CatchExceptionWithLog(ex, $"鎵弿鏉$爜[{input.SN}]澶嶆牳寮傚父");
-                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", action.Data.SN));
+                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", input.SN));
             }
             return action;
         }
@@ -152,9 +175,9 @@
         /// <summary>
         /// 鎵弿璐ф灦鎴栬�呭偍浣�(渚涗寒鐏揣鏋朵娇鐢�)
         /// </summary>
-        public async Task<ApiAction<ScanShelfInfo>> ScanShelf(string Code)
+        public async Task<ApiAction<ScanOutput>> ScanShelf(string Code)
         {
-            var action = new ApiAction<ScanShelfInfo>();
+            var action = new ApiAction<ScanOutput>();
             try
             {
                 if (Code.IsNullOrEmpty())
@@ -177,14 +200,13 @@
                     CurScanShelf.WarehouseCode = whUnit.WH_CODE;
                     CurScanShelf.RegionCode = whUnit.REGION_CODE;
                     CurScanShelf.ShelfCode = whUnit.SHELF_CODE;
-                    CurScanShelf.LocationCode = whUnit.LOCATION_CODE;
                     CurScanShelf.ShelfType = whUnit.SHELF_TYPE;
                     CurScanShelf.IsSmartRack = true;
                 }
-                // 鎵弿鍌ㄤ綅浠g爜
+                // 鎵弿搴撲綅浠g爜
                 else
                 {
-                    var nLocation = await Biz.Db.Queryable<V_WH_UNIT>().Where(t => t.LOCATION_CODE.ToUpper() == Code.ToUpper() && t.AUTH_ORG == OrgCode).FirstAsync();
+                    var nLocation = await Biz.Db.Queryable<V_WH_UNIT>().Where(t => t.LOCATION_CODE.ToUpper() == Code.ToUpper() && t.AUTH_ORG == OrgCode).IncludesAllFirstLayer().FirstAsync();
                     if (nLocation == null)
                     {
                         action.IsSuccessed = false;
@@ -210,7 +232,7 @@
                     //        return action;
                     //    }
                     //}
-
+                    CurScanShelf.Shelf = nLocation.Shelf;
                     CurScanShelf.Location = nLocation.Location;
                     CurScanShelf.WarehouseCode = nLocation.WH_CODE;
                     CurScanShelf.RegionCode = nLocation.REGION_CODE;
@@ -222,7 +244,7 @@
                 CurScanShelf.IsScanShelf = true;
                 //action.LocaleMsg = Biz.L("鎵弿璐ф灦/鍌ㄤ綅[{0}]鎴愬姛");
                 action.LocaleMsg = Biz.L("WMS.Default.ScanShelf.ScanSucceeded", Code);
-                action.Data = CurScanShelf;
+                action.Data.Data = CurScanShelf;
             }
             catch (Exception ex)
             {
@@ -242,6 +264,7 @@
         public override void ResetInfo()
         {
             base.ResetInfo();
+            Command = null;
             CurInvItem = null;
             CurScanShelf = null;
         }
diff --git a/Tiger.Business.WMS/Transaction/WMSTransactionBase.cs b/Tiger.Business.WMS/Transaction/WMSTransactionBase.cs
index b985a25..186c7ad 100644
--- a/Tiger.Business.WMS/Transaction/WMSTransactionBase.cs
+++ b/Tiger.Business.WMS/Transaction/WMSTransactionBase.cs
@@ -13,6 +13,7 @@
 using Newtonsoft.Json;
 using Tiger.Business.WMS.Seastone;
 using Tiger.IBusiness;
+using Tiger.Model.Entitys.MES.Position;
 
 namespace Tiger.Business.WMS.Transaction
 {
@@ -87,8 +88,64 @@
         #endregion
 
         #region MQTT
+        /// <summary>
+        /// 璁剧疆褰撳墠鏉$爜鐨勫伐搴忎俊鎭�
+        /// </summary>
+        public ApiAction<ScanOutput> SetOutPutMqttMsg(ApiAction<ScanOutput> action, string locale = null)
+        {
+            MQTT.Message msg = new()
+            {
+                IsSuccessed = action.IsSuccessed,
+                Content = Biz.T(action.LocaleMsg, locale),
+            };
+            switch (action.Status)
+            {
+                case ApiAction.StatusCodes.Success:
+                    msg.Voice = MQTT.Voice.Success;
+                    msg.Color = "#FF1E90FF";
+                    break;
+                case ApiAction.StatusCodes.Warning:
+                    msg.Voice = MQTT.Voice.Warning;
+                    msg.Color = "#FFB8860B";
+                    break;
+                case ApiAction.StatusCodes.Error:
+                case ApiAction.StatusCodes.Failed:
+                    msg.Voice = MQTT.Voice.Fail;
+                    msg.Color = "#FFFF0000";
+                    break;
+                case ApiAction.StatusCodes.Exception:
+                    msg.Voice = MQTT.Voice.Fail;
+                    msg.Color = "#FF8B0000";
+                    break;
+                case ApiAction.StatusCodes.Normal:
+                case ApiAction.StatusCodes.NeedConfrim:
+                case ApiAction.StatusCodes.Confrimed:
+                default:
+                    msg.Voice = MQTT.Voice.Silent;
+                    msg.Color = "#FF000000";
+                    break;
+            }
+            if (action.IsSuccessed)
+            {
+                msg.Voice = MQTT.Voice.Success;
+                msg.Color = "#FF228B22";
+            }
+            else if (!action.IsSuccessed)
+            {
+                msg.Voice = MQTT.Voice.Fail;
+                msg.Color = "#FFFF0000";
+            }
+            else
+            {
+                msg.Voice = MQTT.Voice.Silent;
+                msg.Color = "#FF000000";
+            }
+            action.Data.MqttMsg = msg;
+            return action;
+        }
+
         private Thread MQTTThread;
-        private void MQTT()
+        private void Mqtt()
         {
             try
             {
diff --git a/Tiger.Controllers.WMS/Controllers/WMSController.In_Default.cs b/Tiger.Controllers.WMS/Controllers/WMSController.In_Default.cs
index d99a6ac..2ea9da2 100644
--- a/Tiger.Controllers.WMS/Controllers/WMSController.In_Default.cs
+++ b/Tiger.Controllers.WMS/Controllers/WMSController.In_Default.cs
@@ -112,11 +112,11 @@
                     {
                         if (action.IsAsync)
                         {
-                            response = action.GetResponse(await trans.ScanItem(action.Data));
+                            response = action.GetResponse(await trans.Scan(action.Data));
                         }
                         else
                         {
-                            lock (trans.TransLock) { response = action.GetResponse(trans.ScanItem(action.Data).Result); }
+                            lock (trans.TransLock) { response = action.GetResponse(trans.Scan(action.Data).Result); }
                         }
                     }
                     else
@@ -141,45 +141,45 @@
         /// </summary>
         /// <param name="action"></param>
         /// <returns></returns>
-        [HttpPost]
-        [Route("api/[controller]/In_Default/ScanShelf")]
-        public async Task<IActionResult> In_Default_ScanShelfAsync([FromBody] ApiAction action)
-        {
-            ApiAction response;
-            IIn_Default trans = null;
-            try
-            {
-                if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID))
-                {
-                    trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IIn_Default;
-                    if (!trans.IsFinished)
-                    {
-                        if (action.IsAsync)
-                        {
-                            response = action.GetResponse(await trans.ScanShelf(action.Data?.ToString()));
-                        }
-                        else
-                        {
-                            lock (trans.TransLock) { response = action.GetResponse(trans.ScanShelf(action.Data?.ToString()).Result); }
-                        }
-                    }
-                    else
-                    {
-                        response = action.GetResponse($"Transaction Error: 鏍囧噯涓婃灦浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑涓婃灦鍔熻兘", false);
-                    }
-                }
-                else
-                {
-                    response = action.GetResponse($"Transaction Error: 鏍囧噯涓婃灦浜嬪姟[ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑涓婃灦鍔熻兘", false);
-                }
-            }
-            catch (System.Exception ex)
-            {
-                response = action.GetResponse().CatchExceptionWithLog(ex);
-            }
-            trans?.AddHistory(Request, action);
-            return Ok(response);
-        }
+        //[HttpPost]
+        //[Route("api/[controller]/In_Default/ScanShelf")]
+        //public async Task<IActionResult> In_Default_ScanShelfAsync([FromBody] ApiAction action)
+        //{
+        //    ApiAction response;
+        //    IIn_Default trans = null;
+        //    try
+        //    {
+        //        if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID))
+        //        {
+        //            trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IIn_Default;
+        //            if (!trans.IsFinished)
+        //            {
+        //                if (action.IsAsync)
+        //                {
+        //                    response = action.GetResponse(await trans.ScanShelf(action.Data?.ToString()));
+        //                }
+        //                else
+        //                {
+        //                    lock (trans.TransLock) { response = action.GetResponse(trans.ScanShelf(action.Data?.ToString()).Result); }
+        //                }
+        //            }
+        //            else
+        //            {
+        //                response = action.GetResponse($"Transaction Error: 鏍囧噯涓婃灦浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑涓婃灦鍔熻兘", false);
+        //            }
+        //        }
+        //        else
+        //        {
+        //            response = action.GetResponse($"Transaction Error: 鏍囧噯涓婃灦浜嬪姟[ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑涓婃灦鍔熻兘", false);
+        //        }
+        //    }
+        //    catch (System.Exception ex)
+        //    {
+        //        response = action.GetResponse().CatchExceptionWithLog(ex);
+        //    }
+        //    trans?.AddHistory(Request, action);
+        //    return Ok(response);
+        //}
 
     }
 }
\ No newline at end of file
diff --git a/Tiger.Controllers.WMS/Controllers/WMSController.Out_Default.cs b/Tiger.Controllers.WMS/Controllers/WMSController.Out_Default.cs
index a5de80e..845d36b 100644
--- a/Tiger.Controllers.WMS/Controllers/WMSController.Out_Default.cs
+++ b/Tiger.Controllers.WMS/Controllers/WMSController.Out_Default.cs
@@ -112,11 +112,11 @@
                     {
                         if (action.IsAsync)
                         {
-                            response = action.GetResponse(await trans.ScanItem(action.Data));
+                            response = action.GetResponse(await trans.Scan(action.Data));
                         }
                         else
                         {
-                            lock (trans.TransLock) { response = action.GetResponse(trans.ScanItem(action.Data).Result); }
+                            lock (trans.TransLock) { response = action.GetResponse(trans.Scan(action.Data).Result); }
                         }
                     }
                     else
@@ -142,45 +142,45 @@
         /// </summary>
         /// <param name="action"></param>
         /// <returns></returns>
-        [HttpPost]
-        [Route("api/[controller]/Out_Default/ScanShelf")]
-        public async Task<IActionResult> Out_Default_ScanShelfAsync([FromBody] ApiAction action)
-        {
-            ApiAction response;
-            IOut_Default trans = null;
-            try
-            {
-                if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID))
-                {
-                    trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IOut_Default;
-                    if (!trans.IsFinished)
-                    {
-                        if (action.IsAsync)
-                        {
-                            response = action.GetResponse(await trans.ScanShelf(action.Data?.ToString()));
-                        }
-                        else
-                        {
-                            lock (trans.TransLock) { response = action.GetResponse(trans.ScanShelf(action.Data?.ToString()).Result); }
-                        }
-                    }
-                    else
-                    {
-                        response = action.GetResponse($"Transaction Error: 鏍囧噯涓嬫灦浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑鏍囧噯涓嬫灦鍔熻兘", false);
-                    }
-                }
-                else
-                {
-                    response = action.GetResponse($"Transaction Error: 鏍囧噯涓嬫灦浜嬪姟[ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑鏍囧噯涓嬫灦鍔熻兘", false);
-                }
-            }
-            catch (System.Exception ex)
-            {
-                response = action.GetResponse().CatchExceptionWithLog(ex);
-            }
-            trans?.AddHistory(Request, action);
-            return Ok(response);
-        }
+        //[HttpPost]
+        //[Route("api/[controller]/Out_Default/ScanShelf")]
+        //public async Task<IActionResult> Out_Default_ScanShelfAsync([FromBody] ApiAction action)
+        //{
+        //    ApiAction response;
+        //    IOut_Default trans = null;
+        //    try
+        //    {
+        //        if (iBiz.WMS.Context.GetTransDic().ContainsKey(action.ID))
+        //        {
+        //            trans = iBiz.WMS.Context.GetTransDic()[action.ID] as IOut_Default;
+        //            if (!trans.IsFinished)
+        //            {
+        //                if (action.IsAsync)
+        //                {
+        //                    response = action.GetResponse(await trans.ScanShelf(action.Data?.ToString()));
+        //                }
+        //                else
+        //                {
+        //                    lock (trans.TransLock) { response = action.GetResponse(trans.ScanShelf(action.Data?.ToString()).Result); }
+        //                }
+        //            }
+        //            else
+        //            {
+        //                response = action.GetResponse($"Transaction Error: 鏍囧噯涓嬫灦浜嬪姟[ID:{action.ID}]宸茬粡鍏抽棴锛岃閲嶆柊鎵撳紑鏍囧噯涓嬫灦鍔熻兘", false);
+        //            }
+        //        }
+        //        else
+        //        {
+        //            response = action.GetResponse($"Transaction Error: 鏍囧噯涓嬫灦浜嬪姟[ID:{action.ID}]鏁版嵁涓㈠け锛岃閲嶆柊鎵撳紑鏍囧噯涓嬫灦鍔熻兘", false);
+        //        }
+        //    }
+        //    catch (System.Exception ex)
+        //    {
+        //        response = action.GetResponse().CatchExceptionWithLog(ex);
+        //    }
+        //    trans?.AddHistory(Request, action);
+        //    return Ok(response);
+        //}
 
     }
 }
\ No newline at end of file
diff --git a/Tiger.IBusiness.WMS/Transaction/IIn_Default.cs b/Tiger.IBusiness.WMS/Transaction/IIn_Default.cs
index 587a466..9a31726 100644
--- a/Tiger.IBusiness.WMS/Transaction/IIn_Default.cs
+++ b/Tiger.IBusiness.WMS/Transaction/IIn_Default.cs
@@ -13,14 +13,9 @@
         public IIn_Default Init(string id, string userCode, string apiHost, string orgCode);
 
         /// <summary>
-        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鐗╂枡宸茬粡瀹屾垚绉诲簱鍒欒揣鏋朵笂浜伅鎻愰啋鍌ㄤ綅
+        /// 鎵弿鍏ュ彛
         /// </summary>
-        public Task<ApiAction> ScanItem(BaseInput input);
-
-        /// <summary>
-        /// 鎵弿璐ф灦鎴栬�呭偍浣�
-        /// </summary>
-        public Task<ApiAction<ScanShelfInfo>> ScanShelf(string Code);
+        public Task<ApiAction<ScanOutput>> Scan(BaseInput input);
 
         public bool Close(bool needSaveHistoryLog = false);
     }
diff --git a/Tiger.IBusiness.WMS/Transaction/IOut_Default.cs b/Tiger.IBusiness.WMS/Transaction/IOut_Default.cs
index 69f9384..8685a03 100644
--- a/Tiger.IBusiness.WMS/Transaction/IOut_Default.cs
+++ b/Tiger.IBusiness.WMS/Transaction/IOut_Default.cs
@@ -11,15 +11,11 @@
     public interface IOut_Default : IWMSTransaction
     {
         public IOut_Default Init(string id, string userCode, string apiHost, string orgCode);
-        /// <summary>
-        /// 鎵弿鐗╂枡骞跺鏍革紝濡傛灉鐗╂枡宸茬粡瀹屾垚绉诲簱鍒欒揣鏋朵笂浜伅鎻愰啋鍌ㄤ綅
-        /// </summary>
-        public Task<ApiAction<DefaultScanItemOutput>> ScanItem(BaseInput input);
 
         /// <summary>
-        /// 鎵弿璐ф灦鎴栬�呭偍浣�
+        /// 鎵弿鍏ュ彛
         /// </summary>
-        public Task<ApiAction<ScanShelfInfo>> ScanShelf(string Code);
+        public Task<ApiAction<ScanOutput>> Scan(BaseInput input);
 
         public bool Close(bool needSaveHistoryLog = false);
     }
diff --git a/Tiger.IBusiness/Core/ApiConfig.cs b/Tiger.IBusiness/Core/ApiConfig.cs
index 3e4d6d7..0d50b5c 100644
--- a/Tiger.IBusiness/Core/ApiConfig.cs
+++ b/Tiger.IBusiness/Core/ApiConfig.cs
@@ -180,7 +180,7 @@
     {
         public static IConfiguration Configuration => RheaConfig.Configuration;
         public static string DB_ModelAssembly => RheaConfig.DB_ModelAssembly;
-        public static string DefaultLanguage => Configuration?["DefaultLanguage"] ?? "en-us";
+        public static string DefaultLanguage => Configuration?["DefaultLanguage"] ?? "zh-cn";
         public static void InitConfig(IConfiguration _configuration, Dictionary<string, Dictionary<string, string>> language)
         {
             //Init Rhea
diff --git a/Tiger.Model.Net/Entitys/MES/MES_ROUTE_ACT_VAR.cs b/Tiger.Model.Net/Entitys/MES/MES_ROUTE_ACT_VAR.cs
new file mode 100644
index 0000000..54a100e
--- /dev/null
+++ b/Tiger.Model.Net/Entitys/MES/MES_ROUTE_ACT_VAR.cs
@@ -0,0 +1,156 @@
+using System;
+using SqlSugar;
+using System.Linq;
+using System.ComponentModel;
+using System.Collections.Generic;
+
+namespace Tiger.Model
+{
+	/// <summary>
+	/// 实体:工序行为变量
+	/// </summary>
+	[Description("Primary:ID")]
+	[DisplayName("工序行为变量")]
+	[Serializable]
+	[SugarTable("MES_ROUTE_ACT_VAR")]
+	public class MES_ROUTE_ACT_VAR : DbEntityWithAuth
+	{
+		#region 构造函数
+		/// <summary>
+		/// 实体:工序行为变量
+		/// </summary>
+		public MES_ROUTE_ACT_VAR() {}
+		#endregion
+
+		#region 公共属性
+		/// <summary>
+		/// 工艺路线ID
+		/// </summary>
+		[DisplayName("工艺路线ID")]
+		public string ROT_ID { get; set; }
+		/// <summary>
+		/// 工艺工序行为ID
+		/// </summary>
+		[DisplayName("工艺工序行为ID")]
+		public string ACT_ID { get; set; }
+		/// <summary>
+		/// 行为变量编码
+		/// </summary>
+		[DisplayName("行为变量编码")]
+		public string VAR_CODE { get; set; }
+		/// <summary>
+		/// 行为变量名称
+		/// </summary>
+		[DisplayName("行为变量名称")]
+		public string VAR_NAME { get; set; }
+		/// <summary>
+		/// 变量的控件
+		/// </summary>
+		[DisplayName("变量的控件")]
+		public string VAR_CONTROL { get; set; }
+		/// <summary>
+		/// 变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		[DisplayName("变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)")]
+		public int VALUE_TYPE { get; set; }
+		/// <summary>
+		/// 是否只读(Y/N)
+		/// </summary>
+		[DisplayName("是否只读(Y/N)")]
+		public string READONLY { get; set; }
+		/// <summary>
+		/// 是否显示(Y/N)
+		/// </summary>
+		[DisplayName("是否显示(Y/N)")]
+		public string VISIABLE { get; set; }
+		/// <summary>
+		/// 默认值
+		/// </summary>
+		[DisplayName("默认值")]
+		public string DEFAULT { get; set; }
+		/// <summary>
+		/// 设置值1
+		/// </summary>
+		[DisplayName("设置值1")]
+		public string OPTION_1 { get; set; }
+		/// <summary>
+		/// 设置值2
+		/// </summary>
+		[DisplayName("设置值2")]
+		public string OPTION_2 { get; set; }
+		/// <summary>
+		/// 设置值3
+		/// </summary>
+		[DisplayName("设置值3")]
+		public string OPTION_3 { get; set; }
+		/// <summary>
+		/// 设置值4
+		/// </summary>
+		[DisplayName("设置值4")]
+		public string OPTION_4 { get; set; }
+		/// <summary>
+		/// 设置值5
+		/// </summary>
+		[DisplayName("设置值5")]
+		public string OPTION_5 { get; set; }
+		/// <summary>
+		/// 备注
+		/// </summary>
+		[DisplayName("备注")]
+		public string REMARK { get; set; }
+		#endregion
+
+		#region 虚拟属性
+		/*例子
+		[SugarColumn(IsIgnore = true)]
+		public string FieldName { get; set; }
+		*/
+		#endregion
+
+		#region 外键属性
+		/*例子
+		//一对一外键导航
+		[Navigate(NavigateType.OneToOne, nameof(ClassAId))]//一对一 ClassAId是MES_ROUTE_ACT_VAR类里面的外键ID字段
+		public ClassA ClassA { get; set; } //注意禁止手动赋值,只能是null
+		//一对多外键导航
+		[Navigate(NavigateType.OneToMany, nameof(ClassA.MES_ROUTE_ACT_VARId))]//ClassA表中的MES_ROUTE_ACT_VARId
+		public List<ClassA> ClassAList { get; set; }//注意禁止手动赋值,只能是null
+		//多对多外键导航
+		[Navigate(typeof(MappingClass), nameof(MappingClass.MES_ROUTE_ACT_VARId), nameof(MappingClass.ClassAId))]//注意顺序
+		public List<ClassA> ClassAList { get; set; } //注意禁止手动赋值,只能是null
+		*/
+		#endregion
+
+		#region 枚举变量
+		/*例子
+		public enum FieldNames
+		{
+			[Description("枚举描述0")]
+			Enum0,
+			[Description("枚举描述1")]
+			Enum1,
+		}
+		*/
+
+		/// <summary>
+		/// 枚举:变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		public enum VALUE_TYPEs
+		{
+			[Description("字符串")]
+			String = 0,
+			[Description("整形")]
+			Integer = 1,
+			[Description("浮点型")]
+			Float = 2,
+			[Description("日期时间")]
+			DateTime = 3,
+		}
+		#endregion
+
+		#region 公共方法
+
+		#endregion
+
+	}//endClass
+}
\ No newline at end of file
diff --git a/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT.cs b/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT.cs
index a5be763..9ef3162 100644
--- a/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT.cs
+++ b/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT.cs
@@ -194,6 +194,11 @@
         [DisplayName("琛屼负鎿嶄綔鍊�5")]
         public string ACT_VALUE_5 { get; set; }
         /// <summary>
+		/// 琛屼负鍙橀噺瀛楀吀
+		/// </summary>
+		[DisplayName("琛屼负鍙橀噺瀛楀吀")]
+        public string ACT_VAR_DIC { get; set; }
+        /// <summary>
         /// 琛屼负鏄惁鎴愬姛(Y/N)
         /// </summary>
         [DisplayName("琛屼负鏄惁鎴愬姛(Y/N)")]
diff --git a/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT_VAR.cs b/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT_VAR.cs
new file mode 100644
index 0000000..3bcdd5b
--- /dev/null
+++ b/Tiger.Model.Net/Entitys/MES/MES_WIP_ACT_VAR.cs
@@ -0,0 +1,276 @@
+using System;
+using SqlSugar;
+using System.Linq;
+using System.ComponentModel;
+using System.Collections.Generic;
+
+namespace Tiger.Model
+{
+	/// <summary>
+	/// 实体:生产行为变量
+	/// </summary>
+	[Description("Primary:ID")]
+	[DisplayName("生产行为变量")]
+	[Serializable]
+	[SugarTable("MES_WIP_ACT_VAR")]
+	public class MES_WIP_ACT_VAR : DbEntityWithAuth
+	{
+		#region 构造函数
+		/// <summary>
+		/// 实体:生产行为变量
+		/// </summary>
+		public MES_WIP_ACT_VAR() {}
+		#endregion
+
+		#region 公共属性
+		/// <summary>
+		/// 在制品ID
+		/// </summary>
+		[DisplayName("在制品ID")]
+		public string WIP_ID { get; set; }
+		/// <summary>
+		/// 生产过程记录ID
+		/// </summary>
+		[DisplayName("生产过程记录ID")]
+		public string HIS_ID { get; set; }
+		/// <summary>
+		/// 过站条码
+		/// </summary>
+		[DisplayName("过站条码")]
+		public string SN { get; set; }
+		/// <summary>
+		/// 物料编码
+		/// </summary>
+		[DisplayName("物料编码")]
+		public string ITEM_CODE { get; set; }
+		/// <summary>
+		/// 工单号
+		/// </summary>
+		[DisplayName("工单号")]
+		public string WORK_ORDER { get; set; }
+		/// <summary>
+		/// 工单批次号
+		/// </summary>
+		[DisplayName("工单批次号")]
+		public string BATCH_NO { get; set; }
+		/// <summary>
+		/// 客户编码
+		/// </summary>
+		[DisplayName("客户编码")]
+		public string CUST_CODE { get; set; }
+		/// <summary>
+		/// 工艺路线编码
+		/// </summary>
+		[DisplayName("工艺路线编码")]
+		public string ROT_CODE { get; set; }
+		/// <summary>
+		/// 工艺路线节点ID
+		/// </summary>
+		[DisplayName("工艺路线节点ID")]
+		public string NODE_ID { get; set; }
+		/// <summary>
+		/// 工艺路线节点名称
+		/// </summary>
+		[DisplayName("工艺路线节点名称")]
+		public string NODE_NAME { get; set; }
+		/// <summary>
+		/// 工单行为节点ID
+		/// </summary>
+		[DisplayName("工单行为节点ID")]
+		public string ACT_ID { get; set; }
+		/// <summary>
+		/// 行为名称
+		/// </summary>
+		[DisplayName("行为名称")]
+		public string ACT_NAME { get; set; }
+		/// <summary>
+		/// 工厂编码
+		/// </summary>
+		[DisplayName("工厂编码")]
+		public string FTY_CODE { get; set; }
+		/// <summary>
+		/// 车间编码
+		/// </summary>
+		[DisplayName("车间编码")]
+		public string WS_CODE { get; set; }
+		/// <summary>
+		/// 产线编码
+		/// </summary>
+		[DisplayName("产线编码")]
+		public string LINE_CODE { get; set; }
+		/// <summary>
+		/// 岗位编码
+		/// </summary>
+		[DisplayName("岗位编码")]
+		public string POST_CODE { get; set; }
+		/// <summary>
+		/// 工序编码
+		/// </summary>
+		[DisplayName("工序编码")]
+		public string OPER_CODE { get; set; }
+		/// <summary>
+		/// 加工段
+		/// </summary>
+		[DisplayName("加工段")]
+		public string SEGMENT { get; set; }
+		/// <summary>
+		/// 厂内流转条码
+		/// </summary>
+		[DisplayName("厂内流转条码")]
+		public string FLOW_SN { get; set; }
+		/// <summary>
+		/// 托盘/载具条码
+		/// </summary>
+		[DisplayName("托盘/载具条码")]
+		public string TRAY_SN { get; set; }
+		/// <summary>
+		/// 内包装条码
+		/// </summary>
+		[DisplayName("内包装条码")]
+		public string INNER_SN { get; set; }
+		/// <summary>
+		/// 外箱条码
+		/// </summary>
+		[DisplayName("外箱条码")]
+		public string CARTON_SN { get; set; }
+		/// <summary>
+		/// 栈板条码
+		/// </summary>
+		[DisplayName("栈板条码")]
+		public string PALLET_SN { get; set; }
+		/// <summary>
+		/// 当前操作时间
+		/// </summary>
+		[DisplayName("当前操作时间")]
+		public DateTime OPERATION_TIME { get; set; } = DateTime.MinValue;
+		/// <summary>
+		/// 班制编码
+		/// </summary>
+		[DisplayName("班制编码")]
+		public string SFTS_CODE { get; set; }
+		/// <summary>
+		/// 班次编码
+		/// </summary>
+		[DisplayName("班次编码")]
+		public string SFT_CODE { get; set; }
+		/// <summary>
+		/// 时段编码
+		/// </summary>
+		[DisplayName("时段编码")]
+		public string PRD_CODE { get; set; }
+		/// <summary>
+		/// 行为变量编码
+		/// </summary>
+		[DisplayName("行为变量编码")]
+		public string VAR_CODE { get; set; }
+		/// <summary>
+		/// 行为变量名称
+		/// </summary>
+		[DisplayName("行为变量名称")]
+		public string VAR_NAME { get; set; }
+		/// <summary>
+		/// 变量的控件
+		/// </summary>
+		[DisplayName("变量的控件")]
+		public string VAR_CONTROL { get; set; }
+		/// <summary>
+		/// 变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		[DisplayName("变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)")]
+		public int VALUE_TYPE { get; set; }
+		/// <summary>
+		/// 输入值
+		/// </summary>
+		[DisplayName("输入值")]
+		public string INPUT_VALUE { get; set; }
+		/// <summary>
+		/// 操作值1
+		/// </summary>
+		[DisplayName("操作值1")]
+		public string VALUE_1 { get; set; }
+		/// <summary>
+		/// 操作值2
+		/// </summary>
+		[DisplayName("操作值2")]
+		public string VALUE_2 { get; set; }
+		/// <summary>
+		/// 操作值3
+		/// </summary>
+		[DisplayName("操作值3")]
+		public string VALUE_3 { get; set; }
+		/// <summary>
+		/// 操作值4
+		/// </summary>
+		[DisplayName("操作值4")]
+		public string VALUE_4 { get; set; }
+		/// <summary>
+		/// 操作值5
+		/// </summary>
+		[DisplayName("操作值5")]
+		public string VALUE_5 { get; set; }
+		/// <summary>
+		/// 备注
+		/// </summary>
+		[DisplayName("备注")]
+		public string REMARK { get; set; }
+		/// <summary>
+		/// 追溯信息
+		/// </summary>
+		[DisplayName("追溯信息")]
+		public string TRACE_INFO { get; set; }
+		#endregion
+
+		#region 虚拟属性
+		/*例子
+		[SugarColumn(IsIgnore = true)]
+		public string FieldName { get; set; }
+		*/
+		#endregion
+
+		#region 外键属性
+		/*例子
+		//一对一外键导航
+		[Navigate(NavigateType.OneToOne, nameof(ClassAId))]//一对一 ClassAId是MES_WIP_ACT_VAR类里面的外键ID字段
+		public ClassA ClassA { get; set; } //注意禁止手动赋值,只能是null
+		//一对多外键导航
+		[Navigate(NavigateType.OneToMany, nameof(ClassA.MES_WIP_ACT_VARId))]//ClassA表中的MES_WIP_ACT_VARId
+		public List<ClassA> ClassAList { get; set; }//注意禁止手动赋值,只能是null
+		//多对多外键导航
+		[Navigate(typeof(MappingClass), nameof(MappingClass.MES_WIP_ACT_VARId), nameof(MappingClass.ClassAId))]//注意顺序
+		public List<ClassA> ClassAList { get; set; } //注意禁止手动赋值,只能是null
+		*/
+		#endregion
+
+		#region 枚举变量
+		/*例子
+		public enum FieldNames
+		{
+			[Description("枚举描述0")]
+			Enum0,
+			[Description("枚举描述1")]
+			Enum1,
+		}
+		*/
+
+		/// <summary>
+		/// 枚举:变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		public enum VALUE_TYPEs
+		{
+			[Description("字符串")]
+			String = 0,
+			[Description("整形")]
+			Integer = 1,
+			[Description("浮点型")]
+			Float = 2,
+			[Description("日期时间")]
+			DateTime = 3,
+		}
+		#endregion
+
+		#region 公共方法
+
+		#endregion
+
+	}//endClass
+}
\ No newline at end of file
diff --git a/Tiger.Model.Net/Entitys/MES/MES_WO_ACT_VAR.cs b/Tiger.Model.Net/Entitys/MES/MES_WO_ACT_VAR.cs
new file mode 100644
index 0000000..76a746b
--- /dev/null
+++ b/Tiger.Model.Net/Entitys/MES/MES_WO_ACT_VAR.cs
@@ -0,0 +1,166 @@
+using System;
+using SqlSugar;
+using System.Linq;
+using System.ComponentModel;
+using System.Collections.Generic;
+
+namespace Tiger.Model
+{
+	/// <summary>
+	/// 实体:工单行为变量
+	/// </summary>
+	[Description("Primary:ID")]
+	[DisplayName("工单行为变量")]
+	[Serializable]
+	[SugarTable("MES_WO_ACT_VAR")]
+	public class MES_WO_ACT_VAR : DbEntityWithAuth
+	{
+		#region 构造函数
+		/// <summary>
+		/// 实体:工单行为变量
+		/// </summary>
+		public MES_WO_ACT_VAR() {}
+		#endregion
+
+		#region 公共属性
+		/// <summary>
+		/// 关联工单号
+		/// </summary>
+		[DisplayName("关联工单号")]
+		public string WORK_ORDER { get; set; }
+		/// <summary>
+		/// 产品编码
+		/// </summary>
+		[DisplayName("产品编码")]
+		public string PROD_CODE { get; set; }
+		/// <summary>
+		/// 客户编码
+		/// </summary>
+		[DisplayName("客户编码")]
+		public string CUST_CODE { get; set; }
+		/// <summary>
+		/// 工单行为节点ID
+		/// </summary>
+		[DisplayName("工单行为节点ID")]
+		public string ACT_ID { get; set; }
+		/// <summary>
+		/// 行为变量编码
+		/// </summary>
+		[DisplayName("行为变量编码")]
+		public string VAR_CODE { get; set; }
+		/// <summary>
+		/// 行为变量名称
+		/// </summary>
+		[DisplayName("行为变量名称")]
+		public string VAR_NAME { get; set; }
+		/// <summary>
+		/// 变量的控件
+		/// </summary>
+		[DisplayName("变量的控件")]
+		public string VAR_CONTROL { get; set; }
+		/// <summary>
+		/// 变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		[DisplayName("变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)")]
+		public int VALUE_TYPE { get; set; }
+		/// <summary>
+		/// 是否只读(Y/N)
+		/// </summary>
+		[DisplayName("是否只读(Y/N)")]
+		public string READONLY { get; set; }
+		/// <summary>
+		/// 是否显示(Y/N)
+		/// </summary>
+		[DisplayName("是否显示(Y/N)")]
+		public string VISIABLE { get; set; }
+		/// <summary>
+		/// 默认值
+		/// </summary>
+		[DisplayName("默认值")]
+		public string DEFAULT { get; set; }
+		/// <summary>
+		/// 设置值1
+		/// </summary>
+		[DisplayName("设置值1")]
+		public string OPTION_1 { get; set; }
+		/// <summary>
+		/// 设置值2
+		/// </summary>
+		[DisplayName("设置值2")]
+		public string OPTION_2 { get; set; }
+		/// <summary>
+		/// 设置值3
+		/// </summary>
+		[DisplayName("设置值3")]
+		public string OPTION_3 { get; set; }
+		/// <summary>
+		/// 设置值4
+		/// </summary>
+		[DisplayName("设置值4")]
+		public string OPTION_4 { get; set; }
+		/// <summary>
+		/// 设置值5
+		/// </summary>
+		[DisplayName("设置值5")]
+		public string OPTION_5 { get; set; }
+		/// <summary>
+		/// 备注
+		/// </summary>
+		[DisplayName("备注")]
+		public string REMARK { get; set; }
+		#endregion
+
+		#region 虚拟属性
+		/*例子
+		[SugarColumn(IsIgnore = true)]
+		public string FieldName { get; set; }
+		*/
+		#endregion
+
+		#region 外键属性
+		/*例子
+		//一对一外键导航
+		[Navigate(NavigateType.OneToOne, nameof(ClassAId))]//一对一 ClassAId是MES_WO_ACT_VAR类里面的外键ID字段
+		public ClassA ClassA { get; set; } //注意禁止手动赋值,只能是null
+		//一对多外键导航
+		[Navigate(NavigateType.OneToMany, nameof(ClassA.MES_WO_ACT_VARId))]//ClassA表中的MES_WO_ACT_VARId
+		public List<ClassA> ClassAList { get; set; }//注意禁止手动赋值,只能是null
+		//多对多外键导航
+		[Navigate(typeof(MappingClass), nameof(MappingClass.MES_WO_ACT_VARId), nameof(MappingClass.ClassAId))]//注意顺序
+		public List<ClassA> ClassAList { get; set; } //注意禁止手动赋值,只能是null
+		*/
+		#endregion
+
+		#region 枚举变量
+		/*例子
+		public enum FieldNames
+		{
+			[Description("枚举描述0")]
+			Enum0,
+			[Description("枚举描述1")]
+			Enum1,
+		}
+		*/
+
+		/// <summary>
+		/// 枚举:变量值类型(0String字符串|1Integer整形|2Float浮点型|3DateTime日期时间)
+		/// </summary>
+		public enum VALUE_TYPEs
+		{
+			[Description("字符串")]
+			String = 0,
+			[Description("整形")]
+			Integer = 1,
+			[Description("浮点型")]
+			Float = 2,
+			[Description("日期时间")]
+			DateTime = 3,
+		}
+		#endregion
+
+		#region 公共方法
+
+		#endregion
+
+	}//endClass
+}
\ No newline at end of file
diff --git a/Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs b/Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs
index f4e0ff9..dae0755 100644
--- a/Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs
+++ b/Tiger.Model.Net/Entitys/WMS/Api/BaseInput.cs
@@ -2,53 +2,6 @@
 
 namespace Tiger.Model
 {
-    public class BaseInput
-    {
-        /// <summary>
-        ///
-        /// </summary>
-        public AuthOption AuthOption { get; set; }
-
-        /// <summary>
-        /// 鏉$爜
-        /// </summary>
-        public string SN { get; set; }
-
-        /// <summary>
-        /// 娴峰叧鍗曞彿
-        /// </summary>
-        public string CustomsNo { get; set; }
-    }
-
-    public class BasePageInput
-    {
-        public AuthOption AuthOption { get; set; }
-        public int pageIndex { get; set; }
-        public int pageSize { get; set; }
-        public int total { get; set; }
-        public string Code { get; set; }
-    }
-
-    public class BasePageOutput<T>
-    {
-        public List<T> data { get; set; }
-        public int total { get; set; }
-    }
-
-    public class BaseCodeInput
-    {
-        public AuthOption AuthOption { get; set; }
-        public string Code { get; set; }
-    }
-
-    public class OutOthDtlInput : BasePageInput
-    {
-        public bool IsItemCodeList { get; set; }
-    }
-
-    public class OutWoDtlInput : BasePageInput
-    {
-        public bool IsItemCodeList { get; set; }
-    }
+ 
 
 }
\ No newline at end of file
diff --git a/Tiger.Model.Net/Entitys/WMS/Api/Input_Entitys.cs b/Tiger.Model.Net/Entitys/WMS/Api/Input_Entitys.cs
index 4a67ea9..95f9041 100644
--- a/Tiger.Model.Net/Entitys/WMS/Api/Input_Entitys.cs
+++ b/Tiger.Model.Net/Entitys/WMS/Api/Input_Entitys.cs
@@ -8,20 +8,62 @@
 
 namespace Tiger.Model
 {
-    public class ScanShelfInfo
+    public class BaseInput
     {
-        public string WarehouseCode { get; set; }
-        public string RegionCode { get; set; }
-        public string ShelfCode { get; set; }
-        public string LocationCode { get; set; }
-        public string RackCode => ShelfCode;
-        public bool IsSmartRack { get; set; }
-        public decimal Capacity { get; set; }
-        public int LotCount { get; set; }
-        public decimal MaxSize { get; set; }
-        public int ShelfType { get; set; }
-        public bool IsScanShelf { get; set; }
-        public WMS_SHELF Shelf { get; set; }
-        public WMS_LOCATION Location { get; set; }
+        /// <summary>
+        /// 鏁版嵁搴撴巿鏉冩煡璇㈤�夐」
+        /// </summary>
+        public AuthOption AuthOption { get; set; }
+        /// <summary>
+        /// 瀹㈡埛绔樉绀虹殑璇█
+        /// </summary>
+        public string Locale { get; set; }
+        /// <summary>
+        /// 鎿嶄綔鎸囦护
+        /// </summary>
+        public string Command { get; set; }
+        /// <summary>
+        /// 鏉$爜
+        /// </summary>
+        public string SN { get; set; }
+        /// <summary>
+        /// 褰撳墠鎿嶄綔闇�瑕佹彁浜ょ殑閫夐」
+        /// </summary>
+        public Dictionary<string, string> Options { get; set; } = new Dictionary<string, string>();
+        /// <summary>
+        /// 褰撳墠鎿嶄綔闇�瑕佹彁浜ょ殑鏁版嵁
+        /// </summary>
+        public string Data { get; set; }
+    }
+
+    public class BasePageInput
+    {
+        public AuthOption AuthOption { get; set; }
+        public int pageIndex { get; set; }
+        public int pageSize { get; set; }
+        public int total { get; set; }
+        public string Code { get; set; }
+    }
+
+    public class BasePageOutput<T>
+    {
+        public List<T> data { get; set; }
+        public int total { get; set; }
+    }
+
+    public class BaseCodeInput
+    {
+        public AuthOption AuthOption { get; set; }
+        public string Code { get; set; }
+    }
+
+    public class OutOthDtlInput : BasePageInput
+    {
+        public bool IsItemCodeList { get; set; }
+    }
+
+    public class OutWoDtlInput : BasePageInput
+    {
+        public bool IsItemCodeList { get; set; }
     }
 }
diff --git a/Tiger.Model.Net/Entitys/WMS/Api/Output_Entitys.cs b/Tiger.Model.Net/Entitys/WMS/Api/Output_Entitys.cs
index 27566f0..5750149 100644
--- a/Tiger.Model.Net/Entitys/WMS/Api/Output_Entitys.cs
+++ b/Tiger.Model.Net/Entitys/WMS/Api/Output_Entitys.cs
@@ -4,10 +4,49 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Tiger.Model.Entitys.MES.Position;
 using Tiger.Model.Minsun;
 
 namespace Tiger.Model
 {
+    public class ScanOutput<T>
+    {
+        /// <summary>
+        /// 鎿嶄綔鎸囦护
+        /// </summary>
+        public string Command { get; set; }
+        /// <summary>
+        /// Mqtt娑堟伅
+        /// </summary>
+        public MQTT.Message MqttMsg { get; set; }
+        /// <summary>
+        /// 褰撳墠鎿嶄綔杩斿洖鐨勬暟鎹�
+        /// </summary>
+        public T Data { get; set; }
+    }
+
+    public class ScanOutput : ScanOutput<object>
+    {
+
+    }
+
+    public class ScanShelfInfo
+    {
+        public string WarehouseCode { get; set; }
+        public string RegionCode { get; set; }
+        public string ShelfCode { get; set; }
+        public string LocationCode { get; set; }
+        public string RackCode => ShelfCode;
+        public bool IsSmartRack { get; set; }
+        public decimal Capacity { get; set; }
+        public int LotCount { get; set; }
+        public decimal MaxSize { get; set; }
+        public int ShelfType { get; set; }
+        public bool IsScanShelf { get; set; }
+        public WMS_SHELF Shelf { get; set; }
+        public WMS_LOCATION Location { get; set; }
+    }
+
     public class DefaultScanItemOutput
     {
         public int ReqType { get; set; }
@@ -24,7 +63,6 @@
         public string ScanAfCut { get; set; }
         public string Unit { get; set; }
         public DateTime DateCode { get; set; }
-        public string Message { get; set; }
     }
 
     public class DefaultInStoreOutput
diff --git a/Tiger.Model.Net/Tiger.Model.Net.csproj b/Tiger.Model.Net/Tiger.Model.Net.csproj
index f42e92d..d01b24d 100644
--- a/Tiger.Model.Net/Tiger.Model.Net.csproj
+++ b/Tiger.Model.Net/Tiger.Model.Net.csproj
@@ -80,6 +80,9 @@
     <Compile Include="DTO\MESDTO.cs" />
     <Compile Include="Entitys\MES\ParameterEntity\BizPrintInstoreDocParameter.cs" />
     <Compile Include="Entitys\BAS\BAS_ITEM_DOC.cs" />
+    <Compile Include="Entitys\MES\YadaU9\mes_Bin.cs" />
+    <Compile Include="Entitys\MES\YadaU9\mes_MaterialBarCode.cs" />
+    <Compile Include="Entitys\MES\YadaU9\mes_Wh.cs" />
     <Compile Include="Entitys\MQTTEntity.cs" />
     <Compile Include="Entitys\Api\Base.cs" />
     <Compile Include="Entitys\Automate\SNInfo.cs" />

--
Gitblit v1.9.3