From 6f8fe2fc191fb466e3141a6e915d6aa63802c269 Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期日, 22 六月 2025 11:43:35 +0800
Subject: [PATCH] 更新优化

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index e295122..f3e953b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -124,7 +124,7 @@
                 }
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
-                    Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderByDescending(x=>x.Grade).FirstOrDefault();
+                    Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderBy(x=>x.Grade).FirstOrDefault();
                     //鏇存柊鍑哄簱鐩殑浣嶇疆
                     result.Item1.ForEach(x =>
                     {
@@ -486,7 +486,9 @@
                             TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                             PalletType = stockInfo.PalletType,
                             WarehouseId = stockInfo.WarehouseId,
-                            GroupId= groupId
+                            GroupId= groupId,
+                            MaterielCode = stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).FirstOrDefault()?.ProductCode,
+                            Quantity = (float)stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).Sum(x=> x.StockPcsQty)
                         };
                         tasks.Add(task);
                     }
@@ -525,7 +527,17 @@
                             TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                             PalletType = stockInfo.PalletType,
                             WarehouseId = stockInfo.WarehouseId,
+                            
                         };
+                        if (taskType != TaskTypeEnum.OutEmpty)
+                        {
+                            task.MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
+                            task.Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
+                        }
+                        if (stockInfo.StockLength>0)
+                        {
+                            task.TaskLength = stockInfo.StockLength;
+                        }
                         tasks.Add(task);
                     }
                 }
@@ -770,7 +782,9 @@
                                 StockId = x.Id,
                                 TaskNum = 0,
                                 OrderQuantity = OrderDetail.OrderQuantity,
-                                Unit = OrderDetail.Unit
+                                Unit = OrderDetail.Unit,
+                                ProductionDate = v.ProductionDate,
+                                EffectiveDate = v.EffectiveDate
                             };
                             outStockLockInfos.Add(outStockLockInfo);
                         }
@@ -870,6 +884,15 @@
                     {
                         x.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
                     });
+                    outboundOrderDetails.ForEach(x =>
+                    {
+                        x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+                    });
+                    Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
+                    if (outboundOrder.OrderStatus != OutOrderStatusEnum.鍑哄簱涓�.ObjToInt())
+                    {
+                        _outboundRepository.OutboundOrderRepository.UpdateData(outboundOrder);
+                    }
                     WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
 
                     if (!content.Status)

--
Gitblit v1.9.3