From 5be086f36d5fbcde9aaa6f775961f292aaae6ec1 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期日, 22 十二月 2024 22:53:31 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
index de0c465..67d7666 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs"
@@ -67,7 +67,14 @@
 
         public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, List<string> locationCodes)
         {
-            return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == lotNo)).ToList();
+            if (!string.IsNullOrEmpty(lotNo))
+            {
+                return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == lotNo)).ToList();
+            }
+            else
+            {
+                return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList();
+            }
 
 
             //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode));

--
Gitblit v1.9.3