From 9984bb1eb673f4ea6d952e191040a674583d2f20 Mon Sep 17 00:00:00 2001
From: YangYuGang <1378265336@qq.com>
Date: 星期五, 21 三月 2025 15:53:52 +0800
Subject: [PATCH] 添加声音

---
 Tiger.Business.WMS/Transaction/In_Default.cs |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/Tiger.Business.WMS/Transaction/In_Default.cs b/Tiger.Business.WMS/Transaction/In_Default.cs
index 9f0f1cd..a5ad68b 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
 {
@@ -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,7 +98,7 @@
                         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")
@@ -104,7 +106,7 @@
                         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;
+                        return SetOutPutMqttMsg(action, input.Locale);
                     }
 
                     if (inv.Items.Count == 0)
@@ -194,7 +196,7 @@
                         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);
                     }
                 }
 
@@ -208,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
                     {
@@ -235,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>();
 
@@ -245,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())
@@ -253,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;
                 }
@@ -264,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();
@@ -277,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);
                 }
 
                 //鎵ц涓婃灦鏁版嵁澶勭悊
@@ -292,7 +294,7 @@
                     action.IsSuccessed = false;
                     action.LocaleMsg = putonResult.LocaleMsg;
                     ResetScan();
-                    return action;
+                    return SetOutPutMqttMsg(action, input.Locale);
                 }
 
                 //瀹屾垚鎵�鏈夊鐞嗗悗浣跨敤浜嬪姟淇濆瓨鏁版嵁
@@ -305,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>
@@ -429,7 +431,7 @@
 
             //閲嶇疆鎵爜淇℃伅
             ResetScanInfo();
-            return action;
+            return SetOutPutMqttMsg(action, locale);
         }
 
         #endregion

--
Gitblit v1.9.3