From 659b0ed98c87b164b96ac43b3c0c8a7d2f975bf2 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 28 二月 2025 10:51:20 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 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 47f3fd2..341b487 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"
@@ -144,6 +144,14 @@
                 (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
+                    Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
+                    TaskTypeEnum typeEnum = outboundOrder.OrderType switch
+                    {
+                        (int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound,
+                        (int)OutOrderTypeEnum.Allocate => TaskTypeEnum.OutAllocate,
+                        (int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality,
+                        _ => new TaskTypeEnum()
+                    };
                     tasks = GetTasks(result.Item1, TaskTypeEnum.Outbound);
                     result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                     result.Item3.ForEach(x =>
@@ -203,7 +211,15 @@
                 (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails);
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
-                    tasks = GetTasks(result.Item1, TaskTypeEnum.Outbound);
+                    Dt_OutboundOrder outboundOrder =_outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
+                    TaskTypeEnum typeEnum = outboundOrder.OrderType switch
+                    {
+                        (int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound,
+                        (int)OutOrderTypeEnum.Allocate=> TaskTypeEnum.OutAllocate,
+                        (int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality,
+                        _ =>new TaskTypeEnum()
+                    };
+                    tasks = GetTasks(result.Item1, typeEnum);
                     result.Item2.ForEach(x =>
                     {
                         x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
@@ -360,7 +376,7 @@
                 #endregion
 
                 #region 涓婃姤ERP
-                if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+                if (outboundOrder.OrderStatus == OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && outboundOrder.OrderType==OutOrderTypeEnum.Issue.ObjToInt())
                 {
                     //List<ERPPickModel> eRPPickModels = new List<ERPPickModel>();
                     //outStockLockInfos.ForEach(x =>
@@ -427,6 +443,10 @@
                 BaseDal.AddData(tasks);
                 if (stockInfos != null && stockInfos.Count > 0 && outboundOrderDetails != null && outboundOrderDetails.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
                 {
+                    stockInfos.ForEach(x =>
+                    {
+                        x.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
+                    });
                     WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
 
                     if (!content.Status)
@@ -461,7 +481,7 @@
         /// </summary>
         /// <param name="keys">鍑哄簱鍗曟槑缁嗕富閿�</param>
         /// <returns></returns>
-        public WebResponseContent GenerateOutboundTask(int[] keys)
+        public WebResponseContent GenerateOutboundTasks(int[] keys)
         {
             try
             {
@@ -515,7 +535,7 @@
             {
                 List<int> keys = _outboundService.OutboundOrderDetailService.Repository.QueryData(x => x.Id, x => x.OrderId == outboundId);
 
-                return GenerateOutboundTask(keys.ToArray());
+                return GenerateOutboundTasks(keys.ToArray());
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3