| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * judge whether agv go to funcSta which be charging or standby |
| | |
| | | )) { |
| | | continue; |
| | | } |
| | | // the time between the latest task and now that be must more that 10 seconds |
| | | // the time between the latest task and now that be must more that @{param} seconds |
| | | // if (!Optional.ofNullable((Boolean) redis.getObject(RedisConstant.AGV_TO_STANDBY_FLAG, agv.getUuid())).orElse(false)) { |
| | | Integer intervalOfAutoStandby = configService.getVal("intervalOfAutoStandby", Integer.class); |
| | | if (null != intervalOfAutoStandby && intervalOfAutoStandby > 0) { |
| | | Task latestTask = taskService.findLatestTask(agv.getId(), null); |
| | | if (null != latestTask) { |
| | | long seconds = DateUtils.diffToSeconds(latestTask.getUpdateTime(), new Date()); |
| | | long seconds = DateUtils.diffToSeconds( |
| | | Optional.ofNullable(latestTask.getEndTime()).orElse(latestTask.getUpdateTime()) |
| | | , new Date() |
| | | ); |
| | | if (seconds < intervalOfAutoStandby) { continue; } |
| | | } |
| | | } |