From 4b483d9d06bead231b88ca212fd799196668a057 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 28 四月 2026 22:58:27 +0800
Subject: [PATCH] fix(任务服务): 修复出库任务选择逻辑和货位分配问题

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
index 3f0f31d..48d5b2a 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
@@ -85,9 +85,24 @@
                 WebResponseContent content = new WebResponseContent();
                 return await _unitOfWorkManage.BeginTranAsync(async () =>
                 {
+                    if (task.TaskType == (int)TaskOutboundTypeEnum.OutEmpty)
+                    {
+                        location.LocationStatus = LocationStatusEnum.Free.GetHashCode();
+
+                        var updateResult = await _locationInfoService.UpdateLocationInfoAsync(location);
+                        var deleteResult = _stockInfoService.DeleteData(stockInfo).Status;
+                        if (!updateResult && !deleteResult)
+                            return content.Error("浠诲姟瀹屾垚澶辫触");
+
+                        var completeResult1 = await CompleteTaskAsync(task, "鍑哄簱瀹屾垚");
+                        return content.OK();
+
+                    }
+
                     stockInfo.LocationId = 0;
                     stockInfo.LocationCode = string.Empty;
                     stockInfo.OutboundDate = DateTime.Now;
+                    stockInfo.StockStatus = (int)StockStatusEmun.鍑哄簱瀹屾垚;
 
                     location.LocationStatus = LocationStatusEnum.Free.GetHashCode();
 
@@ -105,12 +120,12 @@
                             TaskNum = await BaseDal.GetTaskNo(),
                             PalletCode = task.PalletCode,
                             PalletType = task.PalletType,
-                            Roadway = "CW1",
+                            Roadway = "CWSC1",
                             TaskType = TaskInboundTypeEnum.Inbound.GetHashCode(),
                             TaskStatus = TaskInStatusEnum.InNew.GetHashCode(),
-                            SourceAddress = task.TargetAddress,
+                            SourceAddress = "11042",
                             TargetAddress = task.TargetAddress,
-                            CurrentAddress = task.TargetAddress,
+                            CurrentAddress = "11042",
                             NextAddress = task.TargetAddress,
                             WarehouseId = (int)WarehouseEnum.CW1,
                             Grade = 1,
@@ -153,7 +168,8 @@
                             return (
                                 result?.Data?.IsSuccess ?? false,
                                 Newtonsoft.Json.JsonConvert.SerializeObject(result),
-                                result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒"
+                                result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+                                _mesService.BuildConfig(token ?? string.Empty).ToJson()
                             );
                         });
 

--
Gitblit v1.9.3