#
vincentlu
2026-01-04 a71d7a7a4b437a718e68ec41dcecd30ee7ff55e7
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AgvAreaDispatcher.java
@@ -12,7 +12,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@@ -61,7 +61,7 @@
    public List<Long> getAgvIdsByCode(String code) {
        if (Cools.isEmpty(code)) {
            return Collections.emptyList();
            return new ArrayList<>();
        }
        List<Long> areaIds = areaGovernService.queryAreas(code);
        List<Long> agvIds = areaAgvService.queryAgvIdsByAreaIds(areaIds);
@@ -79,9 +79,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);
    }
}