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_AutoOutbound.cs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_AutoOutbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_AutoOutbound.cs
index bf5137d..dab5322 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_AutoOutbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_AutoOutbound.cs
@@ -23,7 +23,7 @@
                 // 1. 鏌ヨ鍒版湡搴撳瓨
                 var expiredStocks = await _stockInfoService.Repository
                     .QueryDataNavAsync(s => s.OutboundDate <= DateTime.Now
-                        && s.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode());
+                        && s.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode() && s.WarehouseId != 3);
 
                 if (expiredStocks == null || !expiredStocks.Any())
                 {
@@ -33,7 +33,8 @@
                 // 杩囨护鏈変綅缃笖浣嶇疆鏈夊簱瀛樼殑璁板綍
                 expiredStocks = expiredStocks
                     .Where(s => s.LocationDetails != null
-                        && s.LocationDetails.LocationStatus == LocationStatusEnum.InStock.GetHashCode())
+                        && s.LocationDetails.LocationStatus == LocationStatusEnum.InStock.GetHashCode()
+                        && s.LocationDetails.EnableStatus != EnableStatusEnum.Disable.GetHashCode())
                     .ToList();
 
                 if (!expiredStocks.Any())

--
Gitblit v1.9.3