From 9937da19b59a59df433abb99c1d650545265ea71 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 23 十二月 2025 08:49:41 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
index 151e998..b2df8da 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
@@ -250,9 +250,18 @@
                 }
 
                 result.FactoryArea = outboundOrder.FactoryArea;
+                List<Dt_OutboundOrderDetail> selectedDetails = new List<Dt_OutboundOrderDetail>();
 
-                // 鑾峰彇閫夋嫨鐨勫嚭搴撴槑缁�
-                List<Dt_OutboundOrderDetail> selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id && request.DetailIds.Contains(x.Id));
+                if (request.DetailIds == null || !request.DetailIds.Any())
+                {
+                    selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id);
+                }
+                else
+                {
+                    // 鑾峰彇閫夋嫨鐨勫嚭搴撴槑缁�
+                    selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id && request.DetailIds.Contains(x.Id));
+                }
+
 
                 //if (outboundOrder.IsBatch == 1 && request.DetailIds.Count == 1)
                 //{
@@ -278,7 +287,7 @@
                 result.OutboundOrder = outboundOrder;
                 result.SelectedDetails = selectedDetails;
 
-                if (outboundOrder.IsBatch == 0 || request.DetailIds.Count > 1)
+                if (outboundOrder.IsBatch == 0 || request.DetailIds.Count != 1)
                 {
                     // 澶氭槑缁嗗嚭搴擄細鎸夌墿鏂欏垎缁勫鐞�
                     result.MaterielCalculations = CalcMaterielOutboundQuantities(outboundOrder, selectedDetails.ToList());
@@ -1098,7 +1107,11 @@
                     {
                         UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt());
 
-                        _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
+                        if (outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt())
+                        {
+                            _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
+                        }
+
                     }
                 }
                 catch (Exception ex)
@@ -1415,7 +1428,7 @@
                         List<Barcodes> barcodesList = new List<Barcodes>();
                         Barcodes barcodes = new Barcodes
                         {
-                            Barcode = request.Barcode,
+                            Barcode = newBarcode,
                             Qty = barcodeQuantity,
                             SupplyCode = stockDetail?.SupplyCode ?? "",
                             BatchNo = stockDetail?.BatchNo ?? "",
@@ -1486,7 +1499,10 @@
                     {
                         UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt());
 
-                        _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
+                        if (outboundOrder.OrderType != OutOrderTypeEnum.InternalAllocat.ObjToInt())
+                        {
+                            _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
+                        }
                     }
                 }
                 catch (Exception ex)

--
Gitblit v1.9.3