| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.acs.common.enums.AgvStatusType; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.framework.common.DateUtils; |
| | | import com.zy.acs.manager.core.service.MainService; |
| | | import com.zy.acs.manager.manager.entity.*; |
| | |
| | | @Slf4j |
| | | @Component |
| | | public class MaintainScheduler { |
| | | |
| | | private final RedisSupport redis = RedisSupport.defaultRedisSupport; |
| | | |
| | | @Autowired |
| | | private AgvService agvService; |
| | |
| | | continue; |
| | | } |
| | | // 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(), null); |
| | | if (null != latestTask) { |
| | | long seconds = DateUtils.diffToSeconds(latestTask.getUpdateTime(), new Date()); |
| | | if (seconds < intervalOfAutoStandby) { continue; } |
| | | // 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()); |
| | | if (seconds < intervalOfAutoStandby) { continue; } |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | |
| | | mainService.buildMinorTask(agv, agvDetail, TaskTypeType.TO_STANDBY, null); |
| | | } |