From abff6261e5e74ff16a844f4739f84d49b6133000 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期六, 15 二月 2025 13:01:02 +0800
Subject: [PATCH] 新增分容空框出库功能及代码结构优化

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index 3feb10b..0653533 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1,4 +1,5 @@
 锘縰sing Masuit.Tools;
+using WIDESEA_Common;
 using WIDESEA_Common.CustomModels;
 
 //using WIDESEA_Common.CustomModels;
@@ -1153,4 +1154,43 @@
     }
 
     #endregion
+
+    #region 鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱
+    public async Task<WebResponseContent> SetEmptyOutbyInToOutAsync(RequestTaskDto request)
+    {
+        WebResponseContent content = new WebResponseContent();
+        var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode && x.CurrentAddress == request.Position);
+        if (!task.IsNullOrEmpty())
+        {
+            var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position);
+            var toStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == fromStation.productLine && x.stationArea == fromStation.stationArea);
+            if (!toStation.IsNullOrEmpty())
+            {
+                task.TargetAddress = toStation.stationLocation;
+                task.NextAddress = toStation.stationChildCode;
+                task.Grade = 3;
+                task.TaskType = (int)TaskOutboundTypeEnum.InToOut;
+
+                var location = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress);
+                location.LocationStatus = (int)LocationEnum.Free;
+
+                await _locationRepository.UpdateDataAsync(location);
+                await BaseDal.UpdateDataAsync(task);
+                return content.OK("鎴愬姛");
+            }
+            else
+            {
+                ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒板搴旂珯鍙�");
+                content.Error("鏈壘鍒板搴旂珯鍙�");
+            }
+        }
+        else
+        {
+            ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒颁换鍔�");
+            content.Error("鏈壘鍒颁换鍔�");
+        }
+        return content;
+    }
+
+    #endregion
 }
\ No newline at end of file

--
Gitblit v1.9.3