From 644cbe3e4eba765affa25454d69fee6286bb6094 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 30 十月 2025 13:06:35 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
index 0b07035..d0b82aa 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
@@ -18,7 +18,9 @@
 using WIDESEA_IStorageTaskRepository;
 using WIDESEA_IStorageTaskServices;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.ERP;
 using WIDESEA_Model.Models.Order;
+using WIDESEA_OrderRepository;
 
 namespace WIDESEA_OrderServices
 {
@@ -32,7 +34,8 @@
         private readonly IDt_TaskService _taskService;
         private readonly ILocationInfoRepository _locationRepository;
         private readonly IDt_TaskRepository _taskRepository;
-        private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository;
+        private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; 
+        private readonly IDt_OrderOutDetailsRepository _outDetailsRepository;
 
         public Dt_ProductionOutboundOrderService(IDt_ProductionOutboundOrderRepository BaseDal,
                                         IUnitOfWorkManage unitOfWorkManage,
@@ -43,7 +46,8 @@
                                         IDt_TaskService taskService,
                                         ILocationInfoRepository locationRepository,
                                         IDt_TaskRepository taskRepository,
-                                        ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal)
+                                        ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository,
+                                        IDt_OrderOutDetailsRepository outDetailsRepository) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _productionoutboundOrderDetailRepository = productionoutboundOrderDetailRepository;
@@ -54,8 +58,8 @@
             _locationRepository = locationRepository;
             _taskRepository = taskRepository;
             _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository;
+            _outDetailsRepository = outDetailsRepository;
         }
-
         public WebResponseContent GetProductOutboundOrder(OutboundOrderGetDTO outboundOrderGetDTO)
         {
             WebResponseContent content = new WebResponseContent();
@@ -156,9 +160,9 @@
 
                         if (result.Item1.Count <= 0)
                         {
-                            return content.Error("鏈壘鍒板簱瀛樺垎閰嶏紝璇风‘璁ゆ槸鍚﹀瓨鍦ㄥ簱瀛樻垨鍗曟嵁鏁伴噺宸插嚭瀹�");
+                            return content.Error($"璁㈠崟{outboundOrder.UpperOrderNo}鐗╂枡缂栫爜{outboundOrderdetail.MaterielCode}鏈壘鍒板簱瀛樺垎閰嶏紝璇风‘璁ゆ槸鍚﹀瓨鍦ㄥ簱瀛樻垨鍗曟嵁鏁伴噺宸插嚭瀹�");
                         }
-
+                        List<Dt_OrderOutDetails> outDetails = new List<Dt_OrderOutDetails>();
                         result.Item1.Distinct().ForEach(item =>
                         {
                             RequestTaskDto task = new RequestTaskDto
@@ -173,6 +177,20 @@
                             taskDtos.Add(task);
                             item.StockInfoDetails.Where(x => x.MaterielCode == outboundOrderdetail.MaterielCode).FirstOrDefault().Status = (int)StockStateEmun.鍑哄簱閿佸畾;
                             item.StockStatus = (int)StockStateEmun.鍑哄簱閿佸畾;
+
+                            outDetails.Add(new Dt_OrderOutDetails()
+                            {
+                                OrderNo = outboundOrder.UpperOrderNo,
+                                PalletCode = item.PalletCode,
+                                OrderType = outboundOrder.OrderType,
+                                ERPOrderId = outboundOrderdetail.ERPOrderId,
+                                MaterielCode = outboundOrderdetail.MaterielCode,
+                                MaterielName = outboundOrderdetail.MaterielName,
+                                Warehouse = "鏅鸿兘绔嬪簱",
+                                WareHouseId = "107",
+                                OutboundQuantity = item.StockInfoDetails.Where(x => x.MaterielCode == outboundOrderdetail.MaterielCode).Sum(x => x.Quantity),
+                            });
+
                         });
                         List<Dt_Task> taskNews = new List<Dt_Task>();
                         List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO>();
@@ -201,6 +219,7 @@
                             await _locationStatusChangeRecordRepository.AddDataAsync(locationStatusChangeRecords);
                             await _locationRepository.UpdateDataAsync(locations);
                             _productionoutboundOrderDetailRepository.UpdateData(result.Item2);
+                            _outDetailsRepository.AddData(outDetails);
                         });
                         content = await _taskService.SendWCSTask(taskDTOs);
                     }

--
Gitblit v1.9.3