From 4ba2eba294e2e32d4e09cd29f4162e72eae4ef9e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 10 六月 2025 23:29:56 +0800
Subject: [PATCH] 2
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 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..620a9c5 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"
@@ -120,6 +120,8 @@
task.Dispatchertime = DateTime.Now;
task.ExceptionMessage = "";
_taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
+ //寤舵椂1s
+ Thread.Sleep(1000);
}
}
}
@@ -198,9 +200,13 @@
{
_taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi);
}
+ 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: router.NextPosi, targetAddress: "1102");
+ _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102");
}
}
@@ -246,7 +252,12 @@
//}
}
catch { }
-
+ if (_taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.TaskState==TaskStatusEnum.SC_Executing.ObjToInt())!=null)
+ {
+ return null;
+ }
+
+ WriteDebug(commonStackerCrane.DeviceCode, $"璇诲彇鍒板綋鍓嶄换鍔″彿:{commonStackerCrane.CurrentTaskNum}");
Dt_Task task;
if (commonStackerCrane.LastTaskType == null)
{
@@ -277,7 +288,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)
{
@@ -336,13 +347,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