From e33f97fb99549ad986cb1998f2272453572f5a1b Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 01 四月 2026 15:29:38 +0800
Subject: [PATCH] 1

---
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs |   56 ++++++++++++++++++++++++++------------------------------
 1 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
index 23849ff..c5aacc0 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
@@ -501,12 +501,11 @@
                 }
                 List<Dt_StockInfo> autoAssignStocks = new List<Dt_StockInfo>();
                 List<IStockInfoService.residueQuantity> newResidueQuantitys = new List<IStockInfoService.residueQuantity>();
-                if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS")))
-                {
+
                     autoAssignStocks = _stockService.StockInfoService.DWANDYSGetOutboundStocks(stockInfos, dt_OutboundOrderDetails, out List<IStockInfoService.residueQuantity> residueQuantitys);
                     newResidueQuantitys.AddRange(residueQuantitys);
                     outStocks.AddRange(autoAssignStocks);
-                }
+                
                 foreach(var residueQuantity in newResidueQuantitys)
                 {
                     foreach (var item in dt_OutboundOrderDetails)
@@ -536,11 +535,10 @@
                                         palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == item.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//鍑哄簱璇︽儏宸插垎閰嶆暟閲�
                                     }
                                     decimal palletOutboundQuantity = 0;
-                                    if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS")))
-                                    {
+                                  
                                         palletOutboundQuantity = autoAssignStocks[j].Details.Where(x => x.BatchNo == item.BatchNo && x.MaterielCode == item.MaterielCode).Sum(x => x.OutboundQuantity);
 
-                                    }
+                                    
                                     if (palletAssignQuantity < palletOutboundQuantity)//濡傛灉鍑哄簱璇︽儏宸插垎閰嶆暟閲忓皬浜庢墭鐩樺凡鍒嗛厤鏁伴噺锛屽垯鍙互缁х画娣诲姞璇ユ墭鐩樺嚭搴撲俊鎭�
                                     {
                                         decimal orderDetailNeedQuantity = details[i].OrderQuantity - detailAssignQuantity;
@@ -673,15 +671,15 @@
                 return WebResponseContent.Instance.Error("璇ュ嚭搴撳崟鎹潪ERP鎺ㄩ�侊紝鏃犳硶鍙栨秷");
             }
             string ids ="";
-            foreach (var item in outboundOrderDetails)
+            try
             {
-                ids = item.LinId;
-                var postContent = new MultipartFormDataContent();
-                postContent.Add(new StringContent(ids), "ids");
-                string result = string.Empty;
-                HttpClient client = null;
-                try
+                foreach (var item in outboundOrderDetails)
                 {
+                    ids = item.LinId;
+                    var postContent = new MultipartFormDataContent();
+                    postContent.Add(new StringContent(ids), "ids");
+                    string result = string.Empty;
+                    HttpClient client = null;
                     using (client = new HttpClient())
                     {
                         // 2. 鍙戦�佽姹�
@@ -708,26 +706,24 @@
                         _outboundRepository.OutboundOrderRepository.DeleteAndMoveIntoHty(outboundOrder, OperateType.浜哄伐鍙栨秷);
                     }
                     _unitOfWorkManage.CommitTran();
-                    // 鍋囪ERP杩斿洖鎴愬姛鏃惰繑鍥炴垚鍔熷搷搴�
-                    return WebResponseContent.Instance.OK(result);
-
                 }
-                catch (HttpRequestException ex)
-                {
-                    _unitOfWorkManage.RollbackTran();
-                    // 澶勭悊HTTP璇锋眰鐩稿叧寮傚父
-                    return WebResponseContent.Instance.Error($"HTTP璇锋眰閿欒: {ex.Message}");
-                    
-                }
-                catch (Exception ex)
-                {
-                    _unitOfWorkManage.RollbackTran();
-                    // 澶勭悊鍏朵粬寮傚父
-                    return WebResponseContent.Instance.Error($"澶勭悊澶辫触: {ex.Message}");
-                }
+                // 鍋囪ERP杩斿洖鎴愬姛鏃惰繑鍥炴垚鍔熷搷搴�
+                return WebResponseContent.Instance.OK();
 
             }
-            return WebResponseContent.Instance.OK();
+            catch (HttpRequestException ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                // 澶勭悊HTTP璇锋眰鐩稿叧寮傚父
+                return WebResponseContent.Instance.Error($"HTTP璇锋眰閿欒: {ex.Message}");
+
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                // 澶勭悊鍏朵粬寮傚父
+                return WebResponseContent.Instance.Error($"澶勭悊澶辫触: {ex.Message}");
+            }
         }
 
     }

--
Gitblit v1.9.3