From f2de6a3a04c91348dc9e35596230bea4f994128d Mon Sep 17 00:00:00 2001 From: LGH <1746689524@qq.com> Date: Tue, 19 Jul 2022 14:09:51 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mt/wms/empty/task/AsynRunTaskService.java | 4 +++- .../src/main/java/com/mt/wms/empty/task/ScheduledTask.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java index e2efb29..ca71cb5 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java @@ -86,7 +86,7 @@ public class AsynRunTaskService extends BaseService { //工业炉可用未满的情况下,调用车辆起点为提升台终点为工业炉 @Async("asyncServiceExecutor") - public void asynRunTask(Long currTaskId, Long vehicleId) throws IOException { + public void asynRunTask(Long currTaskId, Long vehicleId) throws IOException, InterruptedException { CurrTask currTask = currTaskServiceBiz.getById(currTaskId); VehicleInfo vehicle = vehicleInfoServiceBiz.getById(vehicleId); List currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID, currTask)); @@ -123,6 +123,8 @@ public class AsynRunTaskService extends BaseService { currTask.setUpdateTime(LocalDateTime.now()); currTask.setBeginTime(LocalDateTime.now()); currTaskServiceBiz.updateById(currTask); + //程序休眠10秒.防止进炉后允许入炉信号还没消失,就又发了下一个入炉任务. + Thread.sleep(10000); //更新小车状态 vehicle.setStatus(0); vehicleInfoServiceBiz.updateById(vehicle); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index 1c2a911..bf8a513 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -559,6 +559,7 @@ public class ScheduledTask extends BaseService { vehicleInfoServiceBiz.updateById(vehicleInfo); asynRunTaskService.asynRunTaskForStockToKiln(inStockInfo.getId(), vehicleId); } + logger.info("当前两辆车都不在线.无法发起任务!"); } } }