From f947d43adfe6a204b6afe920ce88a30d78015f1d Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 28 二月 2025 10:44:44 +0800
Subject: [PATCH] 板料优化,成品流程,测试架...

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 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 397c4a8..8fb228b 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"
@@ -200,7 +200,7 @@
                         }
                         else
                         {
-                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: "1102");
+                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102");
                         }
                         
                     }
@@ -336,13 +336,22 @@
                 else
                 {
                     Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
-                    reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
-                    reloTask.CurrentAddress = taskDTO.SourceAddress;
-                    reloTask.NextAddress = taskDTO.TargetAddress;
-                    reloTask.DeviceCode = task.DeviceCode;
-                    reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
-                    int taskId = _taskRepository.AddData(reloTask);
-                    reloTask.TaskId = taskId;
+                    //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+                    Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
+                    if (existTask != null)
+                    {
+                        return existTask;
+                    }
+                    else
+                    {
+                        reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+                        reloTask.CurrentAddress = taskDTO.SourceAddress;
+                        reloTask.NextAddress = taskDTO.TargetAddress;
+                        reloTask.DeviceCode = task.DeviceCode;
+                        reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
+                        int taskId = _taskRepository.AddData(reloTask);
+                        reloTask.TaskId = taskId;
+                    }
                     return reloTask;
 
                 }

--
Gitblit v1.9.3