From 5e851678cc02257bbbd179446de36082430ca5bc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 13 四月 2026 15:12:04 +0800
Subject: [PATCH] feat(MES): 添加Mes_Log扩展逻辑

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
index 1d4292c..ec0c45e 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
@@ -7,7 +7,6 @@
 using WIDESEA_DTO.MES;
 using WIDESEA_IStockService;
 using WIDESEA_IBasicService;
-using WIDESEA_IMesService;
 using WIDESEA_ISystemService;
 using WIDESEA_Model.Models;
 using WIDESEA_Common.StockEnum;
@@ -82,28 +81,22 @@
                     return response.Error($"褰撳墠搴撳瓨鐘舵�佷笉鍏佽杩涚珯鎿嶄綔锛屽綋鍓嶇姸鎬侊細{stockInfo.StockStatus}");
                 }
 
-                // 4. 鑾峰彇绯荤粺閰嶇疆 - 鐩存帴浠庢暟鎹簱鏌ヨ
-                var configs = _sysDictionaryService.GetVueDictionary(new[] { "MES_EquipmentCode", "MES_ResourceCode" });
-
-                string equipmentCode = GetConfigValue(configs, "MES_EquipmentCode", "WCS_001");
-                string resourceCode = GetConfigValue(configs, "MES_ResourceCode", "RESOURCE_001");
-
-                // 5. 鏋勯�燤ES璇锋眰
+                // 4. 鏋勯�燤ES璇锋眰
                 var mesRequest = new InboundInContainerRequest
                 {
-                    EquipmentCode = equipmentCode,
-                    ResourceCode = resourceCode,
+                    EquipmentCode = "STK-GROUP-001",
+                    ResourceCode = "STK-GROUP-001",
                     LocalTime = DateTime.Now,
                     ContainerCode = dto.PalletCode
                 };
 
                 string requestJson = System.Text.Json.JsonSerializer.Serialize(mesRequest);
 
-                // 6. 璋冪敤MES鎺ュ彛锛堝悓姝ユ柟娉曪級
+                // 5. 璋冪敤MES鎺ュ彛锛堝悓姝ユ柟娉曪級
                 var mesResult = _mesService.InboundInContainer(mesRequest);
                 stopwatch.Stop();
 
-                // 7. 璁板綍鏃ュ織
+                // 6. 璁板綍鏃ュ織
                 await _mesLogService.LogAsync(new MesApiLogDto
                 {
                     ApiType = "InboundInContainer",
@@ -115,7 +108,7 @@
                     Creator = App.User.UserName
                 });
 
-                // 8. 杩斿洖缁撴灉
+                // 7. 杩斿洖缁撴灉
                 if (mesResult.IsSuccess)
                 {
                     return response.OK("鎵樼洏杩涚珯鎴愬姛");
@@ -182,17 +175,11 @@
                     return response.Error($"褰撳墠搴撳瓨鐘舵�佷笉鍏佽鍑虹珯鎿嶄綔锛屽綋鍓嶇姸鎬侊細{stockInfo.StockStatus}");
                 }
 
-                // 4. 鑾峰彇绯荤粺閰嶇疆
-                var configs = _sysDictionaryService.GetVueDictionary(new[] { "MES_EquipmentCode", "MES_ResourceCode" });
-
-                string equipmentCode = GetConfigValue(configs, "MES_EquipmentCode", "WCS_001");
-                string resourceCode = GetConfigValue(configs, "MES_ResourceCode", "RESOURCE_001");
-
-                // 5. 鏋勯�燤ES璇锋眰
+                // 4. 鏋勯�燤ES璇锋眰
                 var mesRequest = new OutboundInContainerRequest
                 {
-                    EquipmentCode = equipmentCode,
-                    ResourceCode = resourceCode,
+                    EquipmentCode = "STK-GROUP-001",
+                    ResourceCode = "STK-GROUP-001",
                     LocalTime = DateTime.Now,
                     ContainerCode = dto.PalletCode,
                     ParamList = dto.ParamList?.Select(p => new ParamItem
@@ -205,11 +192,11 @@
 
                 string requestJson = System.Text.Json.JsonSerializer.Serialize(mesRequest);
 
-                // 6. 璋冪敤MES鎺ュ彛锛堝悓姝ユ柟娉曪級
+                // 5. 璋冪敤MES鎺ュ彛锛堝悓姝ユ柟娉曪級
                 var mesResult = _mesService.OutboundInContainer(mesRequest);
                 stopwatch.Stop();
 
-                // 7. 璁板綍鏃ュ織
+                // 6. 璁板綍鏃ュ織
                 await _mesLogService.LogAsync(new MesApiLogDto
                 {
                     ApiType = "OutboundInContainer",
@@ -221,7 +208,7 @@
                     Creator = App.User.UserName
                 });
 
-                // 8. 杩斿洖缁撴灉
+                // 7. 杩斿洖缁撴灉
                 if (mesResult.IsSuccess)
                 {
                     return response.OK("鎵樼洏鍑虹珯鎴愬姛");

--
Gitblit v1.9.3