From 93ec15196294abce031a86e24f4cee643b3b1c8a Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期四, 22 一月 2026 15:45:29 +0800
Subject: [PATCH] 1

---
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
index 39961d7..10355c2 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -47,7 +47,7 @@
                 if (stockInfo != null)
                 {
                     Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
-                    if (locationInfo==null)
+                    if (locationInfo == null)
                     {
                         throw new Exception("鏈壘鍒板嚭搴撳簱浣�");
                     }
@@ -116,7 +116,7 @@
                             }
                             tasks.Add(task);
                         }
-                        
+
                     }
                 }
 
@@ -152,7 +152,16 @@
             List<Dt_LocationInfo>? locationInfos = null;
             //if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
             {
-                (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails);
+                Dt_OutboundOrder dt_OutboundOrder = _outboundService.OutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.First().OrderId).First();
+                (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = new();
+                if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS"))
+                {
+                   result = _outboundService.OutboundOrderDetailService.DWANDYSAssignStockOutbound(outboundOrderDetails);
+                }
+                else
+                {
+                   result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails);
+                }
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
                     Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
@@ -163,7 +172,7 @@
                         (int)OrderTypeEnum.鍙嶆嫞鍑哄簱鍗� => TaskTypeEnum.ReverseOut,
                         _ => new TaskTypeEnum()
                     };
-                    tasks = GetTasks(result.Item1,typeEnum);
+                    tasks = GetTasks(result.Item1, typeEnum);
                     tasks.ForEach(x =>
                     {
                         x.OrderNo = outboundOrder.OrderNo;
@@ -316,7 +325,7 @@
                                 CreateDate = DateTime.Now,
                                 Remark = details.Remark,
                                 SupplierBatch = details.SupplierBatch,
-                                OrinalLocation=details.OrinalLocation,
+                                OrinalLocation = details.OrinalLocation,
                             };
                             _newOutboundOrderDetailRepository.AddData(outboundOrderDetail);
                             foreach (var item in orderAddDTO1.Details)
@@ -827,7 +836,7 @@
                 }
                 _unitOfWorkManage.CommitTran();
                 //灏嗕换鍔℃帹閫佸埌WCS
-               
+
                 if (tasks.FirstOrDefault().Roadway.Contains("SC01_BC"))
                 {
                     PushTasksToWCS(tasks);
@@ -1008,7 +1017,7 @@
                 foreach (int key in keys)
                 {
 
-                    (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys);
+                   (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys);
                     if (result.Item2 != null && result.Item2.Count > 0)
                     {
                         stockInfos.AddRange(result.Item2);
@@ -1019,17 +1028,27 @@
                     }
                     if (result.Item4 != null && result.Item4.Count > 0)
                     {
-                        outStockLockInfos.AddRange(result.Item4);
+                        outStockLockInfos.AddRange(result.Item4); 
                     }
                     if (result.Item5 != null && result.Item5.Count > 0)
                     {
-                        locationInfos.AddRange(result.Item5);
+                        if (locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
+                        {
+                            locationInfos.AddRange(result.Item5.Distinct());
+                        }
+                        else
+                        {
+                            locationInfos.AddRange(result.Item5);
+                        }
                     }
                     if (result.Item1 != null && result.Item1.Count > 0)
                     {
                         tasks.AddRange(result.Item1);
                     }
-
+                    if(locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
+                    {
+                        break;
+                    }
 
                 }
 
@@ -1157,6 +1176,10 @@
                     {
                         return content.Error($"鏈壘鍒皗item.PalletCode}搴撳瓨鏄庣粏鏁版嵁");
                     }
+                    if (item.System.Contains("SMOM"))
+                    {
+                        return content.Error($"SMOM绯荤粺搴撳瓨鏁版嵁涓嶅彲鎵嬪姩鐩樼偣锛屾墭鐩樺彿{item.PalletCode}");
+                    }
                     Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode);
                     if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && item.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
                     {

--
Gitblit v1.9.3