From fbc6fae6c793220d0b67ac603ce9bbf22837de79 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 19 六月 2025 17:50:47 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs"
index 56e6f14..0451a32 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs"
@@ -26,6 +26,10 @@
 {
     public partial class OutboundOrderDetailService : ServiceBase<Dt_OutboundOrderDetail, IOutboundOrderDetailRepository>, IOutboundOrderDetailService
     {
+        public override PageGridData<Dt_OutboundOrderDetail> GetPageData(PageDataOptions options)
+        {
+            return base.GetPageData(options);
+        }
         public WebResponseContent LockOutboundStock(int orderDetailId)
         {
             Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
@@ -126,7 +130,30 @@
             }
             return (true, "鎴愬姛");
         }
+        public (List<Dt_StockInfo>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrder outboundOrder, List<StockSelectViewDTO> stockSelectViews)
+        {
+            var PalletCodes = string.Join("", stockSelectViews.Select(x => x.PalletCode).ToList());
+            List<Dt_StockInfo> outStocks = _stockService.StockInfoService.Repository.QueryData(x => PalletCodes.Contains(x.PalletCode) && x.LocationCode != null);
 
+            outStocks.ForEach(x =>
+            {
+                x.StockStatus = StockStatusEmun.鍑哄簱涓�.ObjToInt();
+            });
+
+            List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
+            foreach (var item in stockSelectViews)
+            {
+                var outstocks = outStocks.Where(x => item.PalletCode.Contains(x.PalletCode)).ToList();
+                outStockLockInfos.AddRange(_outStockLockInfoService.GetOutStockLockInfo(outboundOrder, outboundOrder.Details.First(), outstocks, BatchNo: item.BatchNo));
+            }
+
+            List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(stockSelectViews.Select(x => x.LocationCode).ToList());
+            locationInfos.ForEach(x =>
+            {
+                x.LocationStatus = LocationStatusEnum.Outbounding.ObjToInt();
+            });
+            return (outStocks, outStockLockInfos, locationInfos);
+        }
         /// <summary>
         /// 鍒嗛厤鍑哄簱搴撳瓨
         /// </summary>
@@ -309,7 +336,7 @@
         /// <param name="locationStatus"></param>
         /// <param name="tasks"></param>
         /// <returns></returns>
-        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null)
+        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.OutLock, List<Dt_Task>? tasks = null)
         {
             try
             {

--
Gitblit v1.9.3