From 4e051ed24849863a068c66b72c4c883985b2ec23 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期四, 29 一月 2026 11:17:15 +0800
Subject: [PATCH] 优化移库完成

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 4810da6..7e7ff22 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -504,6 +504,8 @@
                         MES_parameter mES_Parameter = AbnormalStorageLocation(task.PalletCode, task.SourceAddress, task.TargetAddress);
                         if (mES_Parameter.Result == "Y")
                         {
+                            Dt_Task dtOutWit=BaseDal.QueryData(x=>x.PalletCode==task.PalletCode && x.TaskStatus== (int)OutTaskStatusEnum.OutWait).FirstOrDefault();
+
                             Dt_LocationInfo OriginalLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault();
                             Dt_LocationInfo NewLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.TargetAddress).FirstOrDefault();
                             Dt_StockInfo dt_StockInfo = _stockInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault();
@@ -511,15 +513,27 @@
                             List<Dt_LocationInfo> dt_Locations = new List<Dt_LocationInfo>();
 
                             OriginalLocation.LocationStatus = (int)LocationStatusEnum.Free;
-                            NewLocation.LocationStatus = (int)LocationStatusEnum.InStock;
+                            NewLocation.LocationStatus = dtOutWit != null? (int)LocationStatusEnum.Lock:(int)LocationStatusEnum.InStock;
                             dt_StockInfo.LocationCode = NewLocation.LocationCode;
-                            dt_StockInfo.StockStatus = (int)StockStatusEmun.宸插叆搴�;
+                            dt_StockInfo.StockStatus = dtOutWit != null? (int)StockStatusEmun.鍑哄簱涓�:(int)StockStatusEmun.宸插叆搴�;
                             task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationFinish;
+
+                            if(dtOutWit != null)
+                            {
+                                dtOutWit.TaskStatus = (int)OutTaskStatusEnum.OutNew;
+                                dtOutWit.SourceAddress = NewLocation.LocationCode;
+                                dtOutWit.CurrentAddress = NewLocation.LocationCode;
+                            }
+                            
+
+
 
                             dt_Locations.Add(OriginalLocation);
                             dt_Locations.Add(NewLocation);
 
                             _unitOfWorkManage.BeginTran();
+                            if(dtOutWit!=null) BaseDal.UpdateData(dtOutWit);
+
                             _locationInfoService.UpdateData(dt_Locations);
                             _stockInfoService.UpdateData(dt_StockInfo);
                             BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);

--
Gitblit v1.9.3