From c29940a5ff8b56d96d4fe0fee2076a278e52e9c5 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期三, 28 一月 2026 09:54:45 +0800
Subject: [PATCH] 优化出库

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   13 +++++++++++--
 1 files changed, 11 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..0b98b42 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,22 @@
                             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;
+
+                            dtOutWit.TaskStatus = (int)OutTaskStatusEnum.OutNew;
+                            dtOutWit.SourceAddress = NewLocation.LocationCode;
+                            dtOutWit.CurrentAddress = NewLocation.LocationCode;
+
+
 
                             dt_Locations.Add(OriginalLocation);
                             dt_Locations.Add(NewLocation);
 
                             _unitOfWorkManage.BeginTran();
+                            BaseDal.UpdateData(dtOutWit);
                             _locationInfoService.UpdateData(dt_Locations);
                             _stockInfoService.UpdateData(dt_StockInfo);
                             BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);

--
Gitblit v1.9.3