From eb7892b61b050646ad11e7a36942c2a2a16a24f2 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 03 七月 2025 20:12:58 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
index 848c393..601467a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
@@ -107,6 +107,7 @@
                     commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
                     if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                     {
+                        Thread.Sleep(1000);
                         Dt_Task? task = GetTask(commonStackerCrane);
                         if (task != null)
                         {
@@ -196,11 +197,15 @@
                                 return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
                             }
                         }
-                        if (task.TargetAddress.Contains("SCUTL-001"))
+                        if (task.TargetAddress.Contains("SCUTL-001")) //鑷姩涓�绾�
                         {
                             _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi);
                         }
-                        else
+                        else if (task.TargetAddress.Contains("SCUTL-002")) //鑷姩浜岀嚎
+                        {
+                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1103", targetAddress: "1103");
+                        }
+                        else //鎵嬪姩绾�
                         {
                             _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102");
                         }
@@ -284,7 +289,7 @@
                 if (OutTaskStationIsOccupied(task) == null)
                 {
                     bool flag = false;
-                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
+                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress,task.TaskType).Select(x => x.ChildPosi).ToList();
                     List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                     foreach (var item in tasks)
                     {
@@ -345,10 +350,14 @@
                     Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
                     //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
                     Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
-                    if (existTask != null)
+                    if (existTask != null && existTask.TaskState == (int)TaskStatusEnum.SC_Execute)
                     {
                         return existTask;
                     }
+                    else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute)
+                    {
+                        return null;
+                    }
                     else
                     {
                         reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();

--
Gitblit v1.9.3