From 263ab84e301627a0dd5a4ade1822a3072b2106dc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 30 三月 2026 11:22:14 +0800
Subject: [PATCH] feat(TaskService): OutboundFinishTaskAsync添加MES出站调用

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index 0464857..7b1437a 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -273,6 +273,7 @@
                 var stockInfo = await _stockInfoService.GetStockInfoAsync(taskDto.PalletCode);
                 if (stockInfo == null) return WebResponseContent.Instance.Error("鏈壘鍒板搴斿簱瀛樹俊鎭�");
 
+                WebResponseContent content = new WebResponseContent();
                 return await ExecuteWithinTransactionAsync(async () =>
                 {
                     stockInfo.LocationId = 0;
@@ -285,6 +286,22 @@
                     var updateStockResult = await _stockInfoService.UpdateStockAsync(stockInfo);
                     if (!updateLocationResult || !updateStockResult)
                         return WebResponseContent.Instance.Error("浠诲姟瀹屾垚澶辫触");
+
+                    // 璋冪敤MES鎵樼洏鍑虹珯
+                    var outboundRequest = new OutboundInContainerRequest
+                    {
+                        EquipmentCode = "STK-GROUP-001",
+                        ResourceCode = "STK-GROUP-001",
+                        LocalTime = DateTime.Now,
+                        ContainerCode = taskDto.PalletCode,
+                        ParamList = new List<ParamItem>()
+                    };
+                    var outboundResult = _mesService.OutboundInContainer(outboundRequest);
+                    if (outboundResult == null || outboundResult.Data == null || !outboundResult.Data.IsSuccess)
+                    {
+                        return content.Error($"浠诲姟瀹屾垚澶辫触锛歁ES鍑虹珯澶辫触: {outboundResult?.Data?.Msg ?? outboundResult?.ErrorMessage ?? "鏈煡閿欒"}");
+                    }
+
                     return await CompleteTaskAsync(task);
                 });
             }

--
Gitblit v1.9.3