From 4e877317e999eb4f821db14e4d32801db16d1ac4 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期一, 09 十二月 2024 10:19:48 +0800
Subject: [PATCH] 分容回流空托盘逻辑更改

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 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 6a5b440..058f3e0 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
@@ -789,7 +789,7 @@
             }
             else
             {
-                locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
+                locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.FreeDisable && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
             }
 
             if (locations == null)
@@ -985,18 +985,13 @@
         {
             var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTO.Position);
             var locations = _locationRepository.QueryData(x => x.RoadwayNo == station.Roadway && x.LocationStatus == (int)LocationEnum.Free && x.LocationType == 1);
-            ConsoleHelper.WriteSuccessLine(station.Roadway);
-            var taskRun = BaseDal.QueryData(x => x.TaskType == (int)TaskOutboundTypeEnum.OutTray && x.Roadway.Contains("CW"));
 
-
-            ConsoleHelper.WriteSuccessLine(locations.Count.ToString());
-
-            ConsoleHelper.WriteSuccessLine(taskRun.Count.ToString());
-            var number = locations.Count - taskRun.Count;
-            ConsoleHelper.WriteSuccessLine(number.ToString());
-            if (number > 10)
+            if (locations.Count > 10)
             {
-                ConsoleHelper.WriteColorLine(number.ToString(), ConsoleColor.Blue);
+                ConsoleHelper.WriteColorLine(locations.Count.ToString(), ConsoleColor.Blue);
+
+                var location = locations.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault();
+
                 var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1", new List<string>());
 
 
@@ -1007,10 +1002,12 @@
 
                 // 鏇存柊搴撳瓨浣嶇疆鐘舵�佷负涓嶅彲鐢�
                 stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
+                location.LocationStatus = (int)LocationEnum.FreeDisable;
                 await _unitOfWorkManage.UseTranAsync(async () =>
                 {
                     await BaseDal.AddDataAsync(task);
                     await _locationRepository.UpdateDataAsync(stockInfo.LocationInfo);
+                    await _locationRepository.UpdateDataAsync(location);
                 });
 
                 // 杩斿洖鎴愬姛鍝嶅簲

--
Gitblit v1.9.3