From e4a391c581aaca1fa7b0239bc96375d0c0cb8de6 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 04 二月 2026 08:55:49 +0800
Subject: [PATCH] 1

---
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs |   41 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
index ea0c35f..c3db79c 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -177,10 +177,24 @@
                     {
                         x.OrderNo = outboundOrder.OrderNo;
                     });
-                    result.Item2.ForEach(x =>
+                    if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS"))
                     {
-                        x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
-                    });
+                        result.Item2.ForEach(x =>
+                        {
+                            if (x.LockQuantity == x.OrderQuantity)
+                            {
+                                x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+                            }
+                        });
+                    }
+                    else
+                    {
+                        result.Item2.ForEach(x =>
+                        {
+                            x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+                        });
+                    }
+
                     result.Item3.ForEach(x =>
                     {
 
@@ -297,7 +311,7 @@
                 }
                 if (warehouse.WarehouseCode.Contains("CP"))
                 {
-
+                    
                     Dt_Production production1 = new Dt_Production();
                     OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
                     orderAddDTO1.OrderNo = orderAddDTO.No;
@@ -319,6 +333,16 @@
                     inboundOrder.CreateDate = DateTime.Now;
                     inboundOrder.CreateType = CreateType.UpperSystemPush.ObjToInt();
                     _unitOfWorkManage.BeginTran();
+
+                    Dt_NewOutboundOrder dt_NewOutboundOrder = BaseDal.Db.Queryable<Dt_NewOutboundOrder>().Where(x => x.OrderNo == inboundOrder.OrderNo).Includes(x => x.Details).First();
+                    if(dt_NewOutboundOrder != null)
+                    {
+                        if (dt_NewOutboundOrder.OrderStatus > 0)
+                        {
+                            return WebResponseContent.Instance.Error($"璇ュ嚭搴撳崟鍦ㄨ繘琛屼腑锛屾棤娉曟洿鏂拌鍑哄簱鍗�");
+                        }
+                        Db.DeleteNav(dt_NewOutboundOrder).Include(x => x.Details).ExecuteCommand();
+                    }
                     bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
 
                     foreach (var item in orderAddDTO1.Details)
@@ -670,7 +694,7 @@
             }
         }
         /// <summary>
-        /// 鐢熸垚鍑哄簱浠诲姟
+        /// 鐢熸垚鈥樹换鍔�
         /// </summary>
         /// <param name="orderDetailId"></param>
         /// <param name="stockSelectViews"></param>
@@ -941,14 +965,17 @@
                     }
                     if (result.Item5 != null && result.Item5.Count > 0)
                     {
-                        if (locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
+                        if(result.Item5.Any(x => x.RoadwayNo.Contains("DW")) || result.Item5.Any(x => x.RoadwayNo.Contains("YS")))
                         {
-                            locationInfos.AddRange(result.Item5.Distinct());
+                            locationInfos.AddRange(result.Item5.DistinctBy(x => x.LocationCode));
+
                         }
                         else
                         {
                             locationInfos.AddRange(result.Item5);
+
                         }
+
                     }
                     if (result.Item1 != null && result.Item1.Count > 0)
                     {

--
Gitblit v1.9.3