| | |
| | | // 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()); |
| | | AgvModel agvModel = agvModelService.getById(existAgv.getAgvModel()); |
| | | 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); |
| | | if (null != latestTask |
| | | && latestTask.getTaskType().equals(TaskTypeType.TO_CHARGE.val()) |
| | | && latestTask.getDestCode().equals(funcSta.getCode()) |
| | | ) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |