zhang
2026-01-05 1809dba25f489ea01c07a9ecc977d9f408545310
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AgvAreaDispatcher.java
@@ -65,7 +65,15 @@
        }
        List<Long> areaIds = areaGovernService.queryAreas(code);
        List<Long> agvIds = areaAgvService.queryAgvIdsByAreaIds(areaIds);
        agvIds.addAll(areaAgvService.findAgvIdsWithoutAreaAgv());
        List<Long> agvIdsWithoutAreaAgv = areaAgvService.findAgvIdsWithoutAreaAgv();
        if (agvIdsWithoutAreaAgv.isEmpty()) {
            return agvIds;
        }else {
            if (agvIds.isEmpty()){
                return agvIdsWithoutAreaAgv;
            }
        }
        agvIds.addAll(agvIdsWithoutAreaAgv);
        return agvIds;
    }
@@ -79,9 +87,13 @@
        return areaGovernService.queryCodes(areaIds);
    }
    // 判断车辆是否被area绑定,如果绑定返回 true, 如果没绑定返回 false
    public Boolean isAgvExistsInAnyArea(Long agvId) {
        List<Long> agvIdsWithoutAreaAgv = areaAgvService.findAgvIdsWithoutAreaAgv();
        return !Cools.isEmpty(agvIdsWithoutAreaAgv) && agvIdsWithoutAreaAgv.contains(agvId);
        List<Long> agvIdsWithoutAreaAgv = areaAgvService.findAgvIdsWithoutAreaAgv(); // 没有被绑定的车辆集合
        if (Cools.isEmpty(agvIdsWithoutAreaAgv)) {
            return true;
        }
        return !agvIdsWithoutAreaAgv.contains(agvId);
    }
}