#
vincentlu
2026-01-27 182b605d7015caf520639961d52c02171e9322f1
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AllocateService.java
@@ -64,7 +64,6 @@
        List<String> result = new ArrayList<>();
        for (Agv agv : agvList) {
            if (!hasRunning) {
                // 1. without running tasks
                if (0 < taskService.count(new LambdaQueryWrapper<Task>()
                        .eq(Task::getAgvId, agv.getId())
                        .and(i -> i
@@ -75,10 +74,13 @@
                )) {
                    continue;
                }
            }
            // 2. in idle status
            if (!agvService.judgeEnable(agv.getId(), true)) {
                continue;
                if (!agvService.judgeEnable(agv.getId(), true, true)) {
                    continue;
                }
            } else {
                if (!agvService.judgeEnable(agv.getId(), true, false)) {
                    continue;
                }
            }
            result.add(agv.getUuid());
@@ -222,21 +224,16 @@
//            if (taskCnt == 0) {
//                continue;
//            }
            // in TransferStationHandler.hasDelayAtSta todo
            Travel runningTravel = travelService.findRunningTravel(agvId);
            if (null == runningTravel) {
                continue;
            }
            segmentService.hasRollerWaitingNow(runningTravel.getId(), agvId, sta.getCode(), TaskPosDto.PosType.ORI_STA)
            Segment currSeg = segmentService.getRollerWaiting(agvId, sta.getCode(), TaskPosDto.PosType.ORI_STA);
            if (null == currSeg) {
            // in TransferStationHandler.hasDelayAtSta
            Travel currTravelInRollerWaiting = travelService.findRollerWaitingTravel(agvId, currentCode.getId());
            if (null == currTravelInRollerWaiting) {
                continue;
            }
            // has enough backpack space to load
            Integer backpack = agvService.getBackpack(agvId);
            List<Integer> usedBackpacks = segmentService.selectUsedBackpacks(null, agvId);
            if (usedBackpacks.size() >= backpack) {
            Integer backpackCap = agvService.getBackpack(agvId);
            List<Integer> usedBackpacks = segmentService.selectUsedBackpacks(currTravelInRollerWaiting.getId(), agvId);
            if (usedBackpacks.size() >= backpackCap) {
                continue;
            }