| | |
| | | @Autowired |
| | | private ValidService validService; |
| | | @Autowired |
| | | private AllocateService allocateService; |
| | | @Autowired |
| | | private CodeService codeService; |
| | | @Autowired |
| | | private MapService mapService; |
| | |
| | | private TrafficService trafficService; |
| | | @Autowired |
| | | private AgvModelService agvModelService; |
| | | @Autowired |
| | | private MissionAssignService missionAssignService; |
| | | |
| | | |
| | | @SuppressWarnings("all") |
| | | @Transactional |
| | |
| | | |
| | | List<Long> taskIds = taskList.stream().map(Task::getId).distinct().collect(Collectors.toList()); |
| | | for (Task task : taskList) { |
| | | Agv agv = missionAssignService.execute(task); |
| | | Agv agv = allocateService.execute(task); |
| | | if (null == agv) { |
| | | log.warn("Task[{}] has an issue, because it failed to checkout agv which is idle...", task.getSeqNum()); |
| | | continue; |
| | |
| | | switch (taskType) { |
| | | case TO_CHARGE: |
| | | case TO_STANDBY: |
| | | List<FuncSta> funcStaList = funcStaService.list(new LambdaQueryWrapper<FuncSta>() |
| | | .eq(FuncSta::getType, FuncStaType.query(taskType).toString()) |
| | | .eq(FuncSta::getAgvId, agv.getId()) |
| | | .eq(FuncSta::getState, FuncStaStateType.IDLE.toString()) |
| | | .eq(FuncSta::getStatus, StatusType.ENABLE.val) |
| | | ); |
| | | if (!Cools.isEmpty(funcStaList)) { |
| | | FuncSta funcSta = funcStaList.get(0); |
| | | List<FuncSta> idleFunStaList = funcStaService.findInIdleStatus(FuncStaType.query(taskType), agv.getId()); |
| | | if (!Cools.isEmpty(idleFunStaList)) { |
| | | FuncSta funcSta = funcStaService.checkoutClosestFunSta(agvDetail.getRecentCode(), idleFunStaList); |
| | | endCode = codeService.getById(funcSta.getCode()); |
| | | } |
| | | break; |