| | |
| | | } |
| | | |
| | | |
| | | // @Scheduled(cron = "0/30 * * * * ? ") |
| | | @Scheduled(cron = "0 */2 * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | // @Scheduled(cron = "0 */2 * * * ? ") |
| | | private synchronized void autoStandby(){ |
| | | if (!configService.getVal("automaticStandbyPosition", Boolean.class)) { return; } |
| | | |
| | |
| | | )) { |
| | | continue; |
| | | } |
| | | // the time between the latest task and now that be must more that 20 minutes |
| | | // the time between the latest task and now that be must more that 10 seconds |
| | | Integer intervalOfAutoStandby = configService.getVal("intervalOfAutoStandby", Integer.class); |
| | | if (null != intervalOfAutoStandby && intervalOfAutoStandby > 0) { |
| | | Task latestTask = taskService.findLatestTask(agv.getId(), TaskStsType.COMPLETE); |
| | | if (null != latestTask && !latestTask.getTaskType().equals(TaskTypeType.TO_CHARGE.val())) { |
| | | long minutes = DateUtils.diffToMinute(latestTask.getUpdateTime(), new Date()); |
| | | if (minutes < intervalOfAutoStandby) { continue; } |
| | | Task latestTask = taskService.findLatestTask(agv.getId(), null); |
| | | if (null != latestTask) { |
| | | long seconds = DateUtils.diffToSeconds(latestTask.getUpdateTime(), new Date()); |
| | | if (seconds < intervalOfAutoStandby) { continue; } |
| | | } |
| | | } |
| | | |