From efaf0b8aeb26aca6536a4b384c912cc3cac4d070 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 15 三月 2025 16:07:45 +0800
Subject: [PATCH] 成品代码,其他仓优化,前端优化界面增加

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
index 0d83d13..9861ce4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
@@ -1,9 +1,11 @@
-锘縰sing System;
+锘縰sing Microsoft.IdentityModel.Tokens;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.Helper;
 using WIDESEA_IStockRepository;
 using WIDESEA_Model.Models;
 
@@ -14,5 +16,24 @@
         public ProStockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
         {
         }
+        //鏍规嵁鏄庣粏鏁版嵁鏌ユ壘鍙敤搴撳瓨搴撳瓨
+        public List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos)
+        {
+            List<Dt_ProStockInfo>? proStockInfos = null;
+            bool isCanLot= !string.IsNullOrEmpty(proOutOrderDetail.PLot);
+            bool isCanDate = !string.IsNullOrEmpty(proOutOrderDetail.DateCode);
+            proStockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationInfos.Contains(x.LocationCode))
+                .Includes(x => x.proStockInfoDetails)
+                .Where(x => x.proStockInfoDetails
+                .Any(x => x.SaleOrder == proOutOrderDetail.SaleOrder
+                && x.ProductCode == proOutOrderDetail.PCode
+                && x.ProductVersion == proOutOrderDetail.PVer
+                && (isCanLot ? x.LotNumber == proOutOrderDetail.PLot : true)
+                && (isCanDate ? x.DateCode == proOutOrderDetail.DateCode : true)
+                ))
+            .ToList();
+            proStockInfos = proStockInfos.OrderBy(x => x.proStockInfoDetails.FirstOrDefault().DateCode).ToList();
+            return proStockInfos;
+        }
     }
 }

--
Gitblit v1.9.3