From 661370ec981cb639e1345b007ad7e908f1cd36db Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 30 四月 2026 11:01:34 +0800
Subject: [PATCH] 导出及PP出库优化

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockViewService.cs |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockViewService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockViewService.cs"
index f8c78c5..9cc3061 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockViewService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockViewService.cs"
@@ -130,7 +130,7 @@
 
                 EntityProperties.ValidatePageOptions(options, ref sugarQueryable);
 
-                ISugarQueryable<ProStockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a)
+                ISugarQueryable<ProStockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).OrderByDescending(b => b.CreateDate).Select((b, a)
                     => new ProStockViewDTO
                     {
                         ProStockAttribute=b.ProStockAttribute,
@@ -254,6 +254,14 @@
                             }
 
                             {
+                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.LotNumber).FirstLetterToLower());
+                                if (searchParameters != null)
+                                {
+                                    sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.LotNumber.Contains(searchParameters.Value)));
+                                }
+                            }
+
+                            {
                                 SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.ProductVersion).FirstLetterToLower());
                                 if (searchParameters != null)
                                 {
@@ -274,7 +282,6 @@
                 ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>().Where(whereLo);
 
                 EntityProperties.ValidatePageOptions(options, ref sugarQueryable);
-
                 ISugarQueryable<ProStockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a)
                     => new ProStockViewDTO
                     {
@@ -327,7 +334,11 @@
                 //stockViewDTOs.AddRange(pklist.ToList());
                 stockViewDTOs.ForEach(x =>
                 {
-                    x.ProductCode = string.Join(",", x.Details.Select(x => x.ProductCode).Distinct());
+                    x.ProductCode = string.Join(",", 
+                        x.Details
+                            .GroupBy(d => d.ProductCode)
+                            .Select(g => $"锛堝瀷鍙穥g.Key}锛屾暟閲弡g.Sum(s=>s.StockPcsQty)}锛�")
+                    );
                     x.ProductVersion = string.Join(",", x.Details.Select(x => x.ProductVersion).Distinct());
                     x.SpecifyVer = string.Join(",", x.Details.Select(x => x.SpecifyVer).Distinct());
                     x.DateCode = x.Details.FirstOrDefault()?.DateCode ?? "";

--
Gitblit v1.9.3