| | |
| | | return false; |
| | | } |
| | | |
| | | Agv existAgv = agvService.findByPosition(code); |
| | | Agv agv = agvService.findByPosition(code); |
| | | |
| | | if (funcSta.getType().equals(FuncStaType.CHARGE.toString())) { |
| | | // if the type of this funSta is charge and the existing agv is in charge status, then that means this funSta is occupied |
| | | if (null != existAgv) { |
| | | AgvDetail agvDetail = agvDetailService.selectByAgvId(existAgv.getId()); |
| | | if (null != agv) { |
| | | AgvModel agvModel = agvModelService.getById(agv.getAgvModel()); |
| | | AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); |
| | | if (agvDetail.getAgvStatus().equals(AgvStatusType.CHARGE)) { |
| | | AgvModel agvModel = agvModelService.getById(existAgv.getAgvModel()); |
| | | if (agvDetail.getVol() < agvModel.getQuaBattery()) { |
| | | return false; |
| | | } |
| | | } else { |
| | | Task latestTask = taskService.findLatestTask(existAgv.getId(), null); |
| | | Task latestTask = taskService.findLatestTask(agv.getId(), null); |
| | | if (null != latestTask |
| | | && latestTask.getTaskType().equals(TaskTypeType.TO_CHARGE.val()) |
| | | && latestTask.getDestCode().equals(funcSta.getCode()) |
| | | ) { |
| | | return false; |
| | | // avoid the agv already be full battery but there was no task assign to it, so that not in charge status and battery had down |
| | | if (agvDetailService.isPowerLoss(agv, agvDetail, agvModel)) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (funcSta.getType().equals(FuncStaType.STANDBY.toString())) { |
| | | |
| | | if (null == existAgv) { |
| | | if (null == agv) { |
| | | // if there is a running task whose destination is this funSta, then that means this funSta is occupied |
| | | if (0 < taskService.count(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getTaskType, TaskTypeType.TO_STANDBY.val()) |