| | |
| | | public void init() { |
| | | } |
| | | |
| | | public List<Long> getAgvNosByTask(Task task) { |
| | | public List<Long> getAgvIdsByTask(Task task) { |
| | | if (null == task) { |
| | | return null; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | public List<Long> getAgvIdsByCode(String code) { |
| | | if (Cools.isEmpty(code)) { |
| | | public List<Long> getAgvIdsByCode(String codeData) { |
| | | if (Cools.isEmpty(codeData)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Long> areaIds = areaGovernService.queryAreas(code); |
| | | List<Long> areaIds = areaGovernService.queryAreas(codeData); |
| | | List<Long> agvIds = areaAgvService.queryAgvIdsByAreaIds(areaIds); |
| | | agvIds.addAll(areaAgvService.findAgvIdsWithoutAreaAgv()); |
| | | return agvIds; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public Boolean match(Long agvId, Long codeId) { |
| | | Code code = codeService.getCacheById(codeId); |
| | | if (Cools.isEmpty(agvId, code)) { |
| | | return false; |
| | | } |
| | | List<Long> agvIds = this.getAgvIdsByCode(code.getData()); |
| | | if (Cools.isEmpty(agvIds)) { |
| | | return false; |
| | | } |
| | | if (!agvIds.contains(agvId)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // 如果都没有命中,就返回全部code |
| | | public List<String> getCodesByAgvId(Long agvId) { |
| | | List<Long> areaIds = areaAgvService.queryAreaIdsByAgvId(agvId); |