From cd6e1780b21f01990cec27a10fe65769bcf84dcc Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期二, 25 十一月 2025 14:16:22 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs |   11 +++++------
 1 files changed, 5 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 5ff38f2..e550934 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"
@@ -201,12 +201,9 @@
             if (!string.IsNullOrEmpty(supplyCode))
             {
                 query = query.Where(x => x.Details.Any(d => d.SupplyCode == supplyCode));
-            }
+            }           
 
-            var stocks = query.ToList();
-
-            return stocks.OrderBy(x => x.Details.Where(d => d.MaterielCode == materielCode && (string.IsNullOrEmpty(supplyCode) || d.SupplyCode == supplyCode) &&
-                           (string.IsNullOrEmpty(lotNo) || d.BatchNo == lotNo)).Min(d => d.CreateDate)).ToList();  
+            return query.OrderBy(x => x.CreateDate).ToList();  
             //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode));
             //ISugarQueryable<Dt_StockInfo> sugarQueryable1 = Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode));
             //return sugarQueryable.InnerJoin(sugarQueryable1, (a, b) => a.LocationCode == b.LocationCode).Select((a, b) => b).OrderBy(a => a.CreateDate).Includes(a => a.Details).ToList();
@@ -227,7 +224,7 @@
 
         public List<Dt_StockInfo> GetStockInfosByPalletCodes(List<string> palletCodes)
         {
-            return Db.Queryable<Dt_StockInfo>().Where(x => palletCodes.Contains(x.PalletCode)).Includes(x => x.Details).ToList();
+            return Db.Queryable<Dt_StockInfo>().Where(x => palletCodes.Contains(x.PalletCode)).Includes(x => x.Details).OrderBy(x => x.CreateDate).ToList();
         }
 
  
@@ -254,6 +251,7 @@
                     LocationCode = a.LocationCode,
                     MaterielCode = b.MaterielCode,
                     MaterielName = b.MaterielName,
+                    Barcode=b.Barcode,
                     PalletCode = a.PalletCode,
                     UseableQuantity = b.StockQuantity - b.OutboundQuantity
                 }, a => locationCodes.Contains(a.LocationCode), b => b.StockQuantity > b.OutboundQuantity && b.MaterielCode == materielCode, x => true).GroupBy(x => x.PalletCode).Select(x => new StockSelectViewDTO
@@ -261,6 +259,7 @@
                     LocationCode = x.FirstOrDefault()?.LocationCode ?? "",
                     MaterielCode = x.FirstOrDefault()?.MaterielCode ?? "",
                     MaterielName = x.FirstOrDefault()?.MaterielName ?? "",
+                    Barcode=x.FirstOrDefault()?.Barcode??"",
                     PalletCode = x.Key,
                     UseableQuantity = x.Sum(x => x.UseableQuantity)
                 }).ToList();

--
Gitblit v1.9.3