From e9b4a4107bdd7a7c737192827d4ee17e23c362f6 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 21 三月 2025 14:23:15 +0800
Subject: [PATCH] 1

---
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index 5182457..721f077 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -541,33 +541,35 @@
             if (stationManager.stationType != 7) throw new Exception("閿欒鐨勮皟鍙�");
 
             // 浠庣紦瀛樹腑鑾峰彇搴撳瓨淇℃伅
-            IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
-            List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+            //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
+            //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
 
-            var stockinfo1 = stockInfoList.OrderBy(x => x.CreateDate)
-                .ToList();
-            var stockinfo = stockinfo1.Where(x => x.LocationInfo != null && !x.IsFull && x.LocationInfo.RoadwayNo == stationManager.Roadway)
-                .FirstOrDefault();
+            //var stockinfo1 = stockInfoList.OrderBy(x => x.CreateDate)
+            //    .ToList();
+            //var strings = stationManager.Roadway.Split(",");
+            //var stockinfo = stockinfo1.Where(x => x.LocationInfo != null && !x.IsFull && strings.Contains(x.LocationInfo.RoadwayNo))
+            //    .FirstOrDefault();
+            var stockInfo = await QueryStockInfoForEmptyTrayFRAsync("CWSC1", "10086", input.ProductionLine);
 
-            if (stockinfo == null) return null;
+            if (stockInfo == null) return null;
 
             var task = new Dt_Task
             {
                 CurrentAddress = input.Position,
                 Grade = 2,
-                Roadway = input.Roadways,
+                Roadway = stockInfo.LocationInfo.RoadwayNo,
                 TargetAddress = stationManager.stationLocation,
                 Dispatchertime = DateTime.Now,
                 MaterialNo = "",
-                NextAddress = input.Roadways,
+                NextAddress = input.Position,
                 OrderNo = null,
-                PalletCode = stockinfo.PalletCode,
-                SourceAddress = stockinfo.LocationCode,
+                PalletCode = stockInfo.PalletCode,
+                SourceAddress = stockInfo.LocationCode,
                 TaskState = (int)TaskOutStatusEnum.OutNew,
                 TaskType = (int)TaskOutboundTypeEnum.OutTray,
                 TaskNum = await BaseDal.GetTaskNo(),
                 Creater = "System",
-                ProductionLine = stockinfo.ProductionLine,
+                ProductionLine = stockInfo.ProductionLine,
             };
             _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { task.PalletCode });
             return task;
@@ -617,7 +619,7 @@
     {
         try
         {
-            if (stationManager.stationType == 15) throw new Exception("");
+            //if (stationManager.stationType == 15) throw new Exception("");
 
             // 鍒涘缓涓�涓猅rayCellsStatusDto瀵硅薄锛屽苟璧嬪��
             TrayCellsStatusDto trayCells = new TrayCellsStatusDto()

--
Gitblit v1.9.3