From 561c40186ee1a0134c5f671cf4ed24badcdcd6a3 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 01 十二月 2025 09:56:32 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index e52e206..13e5c02 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -186,7 +186,7 @@
         public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes)
         {
             var query = Db.Queryable<Dt_StockInfo>()
-             .Where(x => locationCodes.Contains(x.LocationCode)
+             .Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus==StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()
              //  && x.StockStatus == (int)StockStatusEmun.姝e父)
              ).Includes(x => x.Details);
 
@@ -311,9 +311,9 @@
                 // 鎵ц鏌ヨ骞舵寜鍏堣繘鍏堝嚭鎺掑簭
                 var stocks = stockQuery.ToList()
                     .Where(x => x.Details.Any(d =>
-                        d.MaterielCode == materielCode &&
-                        d.BatchNo == orderDetail.BatchNo &&
-                        d.SupplyCode == orderDetail.SupplyCode &&
+                        d.MaterielCode == materielCode && 
+                        string.IsNullOrEmpty(orderDetail.BatchNo)?true: d.BatchNo == orderDetail.BatchNo&&
+                        string.IsNullOrEmpty(orderDetail.BatchNo)?true:d.SupplyCode == orderDetail.SupplyCode &&
                         d.StockQuantity > d.OutboundQuantity
                     ))
                     .OrderBy(x => x.CreateDate)
@@ -323,8 +323,8 @@
                 {
                     var relevantDetails = stock.Details
                         .Where(d => d.MaterielCode == materielCode &&
-                                   d.BatchNo == orderDetail.BatchNo &&
-                                   d.SupplyCode == orderDetail.SupplyCode &&
+                                   string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.BatchNo == orderDetail.BatchNo &&
+                                   string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.SupplyCode == orderDetail.SupplyCode &&
                                    d.StockQuantity > d.OutboundQuantity)
                         .ToList();
 

--
Gitblit v1.9.3