From 617cd40beff6019043597796f92eeddd5fe41a5b Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 03 十一月 2025 08:21:47 +0800
Subject: [PATCH] 更新代码

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index bd1d916..dd80c6b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -920,7 +920,7 @@
                 //MES鎴愬搧鍑哄簱鍚屾
                 if (task.TaskType!= TaskTypeEnum.OutSendProduct.ObjToInt())
                 {
-                    MesShipmentOrderSync shipmentOrderSync = MesOutSync(outProStockInfo, proOutOrderDetail, proStockInfoDetails);
+                    MesShipmentOrderSync shipmentOrderSync = MesOutSync(outProStockInfo, proOutOrderDetail, proStockInfoDetails,task);
                     ShipmentOrderSync(shipmentOrderSync);
                     ShipmentOrderMESSync(shipmentOrderSync);
                 }
@@ -1271,7 +1271,7 @@
                 Dt_InboundOrderDetail? inboundOrderDetail = null;
                 Dt_ReturnOrder? returnOrder = null;
                 //鏍囧噯鍏ュ簱娴佺▼鏌ユ壘鍏ュ簱鍗曟嵁
-                if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt()&&(task.WarehouseId == WarehouseEnum.HA152.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA58.ObjToInt()))
+                if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt()&&(task.WarehouseId == 11 || task.WarehouseId == 4))
                 {
                     inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == stockInfo.Details.FirstOrDefault()?.InboundOrderRowNo);
                     foreach (var item in stockInfo.Details)
@@ -1297,11 +1297,15 @@
                         }
                     }
                 }
-                if(task.WarehouseId == WarehouseEnum.HA154.ObjToInt()|| task.WarehouseId == WarehouseEnum.HA152.ObjToInt() || task.WarehouseId == WarehouseEnum.HA58.ObjToInt())
+                if(task.WarehouseId == 11 || task.WarehouseId == 4||task.WarehouseId == 13)
                 {
                     _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩鍒犻櫎 : OperateTypeEnum.浜哄伐鍒犻櫎);
                     _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.鑷姩鍒犻櫎 : OperateTypeEnum.浜哄伐鍒犻櫎);
-                }else
+                }else if(task.WarehouseId == 6 && task.TaskType == TaskTypeEnum.ProductionReturn.ObjToInt())
+                {
+                    stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
+                }
+                else
                 {
                     stockInfo.StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt();
                 }
@@ -1310,7 +1314,10 @@
                 FeedBackWCSTaskHandCancel(taskNum);
                 _unitOfWorkManage.BeginTran();
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐鍒犻櫎 : OperateTypeEnum.浜哄伐鍒犻櫎);
-                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
+                if(locationInfo != null)
+                {
+                    _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
+                }
                 _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                 if (inboundOrder != null && inboundOrderDetail != null)
                 {

--
Gitblit v1.9.3