From 80bb008e7a765a69bd4259ff494fdc47d2be4e2f Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期一, 24 三月 2025 20:24:16 +0800 Subject: [PATCH] 增加物料信息导航 --- Tiger.Business.WMS/Transaction/In_Default.cs | 53 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Tiger.Business.WMS/Transaction/In_Default.cs b/Tiger.Business.WMS/Transaction/In_Default.cs index 2e04e35..2b7aee8 100644 --- a/Tiger.Business.WMS/Transaction/In_Default.cs +++ b/Tiger.Business.WMS/Transaction/In_Default.cs @@ -13,6 +13,8 @@ using Tiger.Business.WMS.Sharetronic.Shelf; //using Microsoft.IdentityModel.Tokens; using Tiger.Model.MES.Yada; +using static IronPython.Modules.PythonThread; +using Tiger.Model.Entitys.MES.Position; namespace Tiger.Business.WMS.Transaction { @@ -23,7 +25,7 @@ { public IIn_Default Init(string id, string userCode, string apiHost, string orgCode) { - base.Init(id, apiHost, userCode, orgCode); + base.Init(id, userCode, apiHost, orgCode); Logger.Console.Info($"Start {this.GetType().Name} Transaction[ID: {TransID}]"); return this; } @@ -86,8 +88,8 @@ { action.IsSuccessed = false; action.LocaleMsg = result.LocaleMsg; - return action; - } + return SetOutPutMqttMsg(action, input.Locale); + } var inv = result.Data as Inventory; //楠岃瘉鏉$爜鏄惁姝g‘ @@ -96,15 +98,15 @@ 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; + return SetOutPutMqttMsg(action, input.Locale); } //鐗╂枡楠岃瘉 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; + action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ItemCodeNotExistsOrNotActive", inv.ItemInfo?.ITEM_CODE.IsNullOrEmpty(inv.Barcode.ItemCode)); + return SetOutPutMqttMsg(action, input.Locale); } if (inv.Items.Count == 0) @@ -181,19 +183,20 @@ CurInvItem = inv; //妫�鏌ョ墿鏂欐暟閲忥紝濡傛灉娌℃湁鍒欐煡璇㈤泤杈炬潯鐮佷富妗o紝鎶婃暟閲忚繑鍥炲墠绔‘璁� - if (CurInvItem.Items.Any(q => q.QTY <= 0)) + //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) { var item = CurInvItem.Items.First(q => q.SN == qty.Code); item.QTY = qty.WhQty; + item.SUPP_LOTNO = CurInvItem.Barcode.LotNo; } action.Data.Data = CurInvItem.Items.Select(q => new { q.SN, q.QTY }); action.Data.Command = Command = "ComfirmQty"; //action.LocaleMsg = Biz.L("璇风‘璁ゆ潯鐮乕{0}]鐨勬暟閲忔槸鍚︽纭�"); action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ComfirmQty", input.SN); - return action; + return SetOutPutMqttMsg(action, input.Locale); } } @@ -207,8 +210,8 @@ action.Data.Data = CurInvItem.Items.Select(q => new { q.SN, q.QTY }); action.Data.Command = Command = "ComfirmQty"; //action.LocaleMsg = Biz.L("鏁伴噺涓嶈兘灏忎簬绛変簬闆讹紝璇烽噸鏂扮‘璁ゆ潯鐮乕{0}]鐨勬暟閲�"); - action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ReComfirmQty", input.SN); - return action; + action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ReComfirmQty", input.SN); + return SetOutPutMqttMsg(action, input.Locale); } else { @@ -234,7 +237,7 @@ { action.IsSuccessed = false; action.LocaleMsg = Biz.L(shelfApiResult.GetData<string>()); - return action; + return SetOutPutMqttMsg(action, input.Locale); } var reaultShelf = shelfApiResult.GetData<ShelfChangeModel>(); @@ -244,7 +247,7 @@ action.IsSuccessed = false; //action.LocaleMsg = Biz.L($"璐ф灦[{0}]涓笉瀛樺湪id涓篬{1}]鐨勫偍浣嶏紝璇峰厛缁存姢璐ф灦淇℃伅"); action.LocaleMsg = Biz.L("WMS.Default.ScanItem.LocationNotExistsInShelf", CurScanShelf.Shelf.SHELF_CODE, reaultShelf.ledAddr); - return action; + return SetOutPutMqttMsg(action, input.Locale); } var locationData = MainDB.Queryable<WMS_ITEM>().Where(q => q.LOCATION_ID == nLocation.ID).First(); if (!locationData.IsNullOrEmpty()) @@ -252,7 +255,7 @@ action.IsSuccessed = false; //action.LocaleMsg = Biz.L("鍌ㄤ綅[{0}]宸插瓨鏈夌墿鏂橻{1}]锛岃妫�鏌ョ郴缁熷簱瀛樹俊鎭�"); action.LocaleMsg = Biz.L($"WMS.Default.ScanShelf.ItemAlreadyExistsInLocation", nLocation.LOCATION_CODE, locationData.SN); - return action; + return SetOutPutMqttMsg(action, input.Locale); } CurScanShelf.LocationCode = nLocation.LOCATION_CODE; } @@ -263,7 +266,7 @@ action.IsSuccessed = false; //action.LocaleMsg = Biz.L("璇疯緭鍏ユ垨鎵弿鏈夋晥鐨勮揣鏋�/鍌ㄤ綅鐮�"); action.LocaleMsg = Biz.L("WMS.Default.ScanShelf.ShelfCanNotEmpty"); - return action; + return SetOutPutMqttMsg(action, input.Locale); } nLocation = await MainDB.Queryable<WMS_LOCATION>().Where(t => t.LOCATION_CODE == CurScanShelf.LocationCode && t.AUTH_ORG == OrgCode).FirstAsync(); @@ -276,7 +279,7 @@ //action.LocaleMsg = Biz.L("鍌ㄤ綅[{0}]鍙兘瀛樻斁涓�涓墿鏂�"); action.LocaleMsg = Biz.L("WMS.Default.ScanItem.LocationSingleFailure", nLocation.LOCATION_CODE); ResetScan(); - return action; + return SetOutPutMqttMsg(action, input.Locale); } //鎵ц涓婃灦鏁版嵁澶勭悊 @@ -291,7 +294,7 @@ action.IsSuccessed = false; action.LocaleMsg = putonResult.LocaleMsg; ResetScan(); - return action; + return SetOutPutMqttMsg(action, input.Locale); } //瀹屾垚鎵�鏈夊鐞嗗悗浣跨敤浜嬪姟淇濆瓨鏁版嵁 @@ -304,7 +307,7 @@ //action.CatchExceptionWithLog(ex, $"鎵弿鏉$爜[{input.SN}]澶嶆牳寮傚父"); action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", input.SN)); } - return action; + return SetOutPutMqttMsg(action, input.Locale); } /// <summary> @@ -426,9 +429,9 @@ //action.LocaleMsg = Biz.L($"鎵弿鏉$爜[{0}]涓婃灦鍒板偍浣峓{1}]鎴愬姛"); action.LocaleMsg = Biz.L("WMS.Default.ScanItem.PutOnSucceeded", CurInvItem.SN, CurInvItem.Location.LOCATION_CODE); - //閲嶇疆宸ュ簭 - ResetScan(); - return action; + //閲嶇疆鎵爜淇℃伅 + ResetScanInfo(); + return SetOutPutMqttMsg(action, locale); } #endregion @@ -439,9 +442,17 @@ public override void ResetScan() { base.ResetScan(); + ResetScanInfo(); + CurScanShelf = null; + } + + /// <summary> + /// 閲嶇疆鎵爜淇℃伅 + /// </summary> + public void ResetScanInfo() + { Command = null; CurInvItem = null; - CurScanShelf = null; } public override bool Close(bool needSaveHistoryLog = false) -- Gitblit v1.9.3