#
Junjie
2025-03-31 5432b5251106ba5e8e5512c6868d31ebaec0b8ce
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -1,7 +1,9 @@
package com.zy.core.dispatcher;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.domain.ShuttleGatherResult;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.BasShuttleService;
@@ -295,6 +297,29 @@
    }
    /**
     * 小车集合
     */
    public List<ShuttleGatherResult> shuttleGather() {
        List<BasShuttle> basShuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().eq("status", 1));
        List<ShuttleGatherResult> list = new ArrayList<>();
        for (BasShuttle basShuttle : basShuttles) {
            String idleLoc = basShuttle.getIdleLoc();
            if(Cools.isEmpty(idleLoc)) {
                continue;
            }
            boolean result = shuttleMoveGenerate(null, idleLoc, basShuttle.getShuttleNo());
            ShuttleGatherResult gatherResult = new ShuttleGatherResult();
            gatherResult.setShuttleNo(basShuttle.getShuttleNo());
            gatherResult.setIdleLoc(idleLoc);
            gatherResult.setResult(result);
            list.add(gatherResult);
        }
        return list;
    }
    /**
     * 检测目标楼层车数量是否小于允许的最大数量
     * true: 小于最大数量  false: 大于或等于最大数量
     */
@@ -312,6 +337,16 @@
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
                continue;
            }
            //小车有充电任务
            if (shuttleThread.isCharging()) {
                continue;
            }
            //小车故障跳过
            if (shuttleThread.isFault()) {
                continue;
            }
@@ -386,6 +421,15 @@
                continue;
            }
            //判断当前层是否无托盘
            if (forkLiftStaProtocol.getHasTray()) {
                continue;
            }
            if (forkLiftStaProtocol.getHasCar()) {
                continue;
            }
            //判断目标楼层站点是否无托盘
            ForkLiftStaProtocol targetLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(slave.getId(), targetLev);
            if (targetLiftStaProtocol == null) {
@@ -396,6 +440,10 @@
                continue;//有托盘跳过
            }
            if (targetLiftStaProtocol.getHasCar()) {
                continue;
            }
            list.add(forkLiftStaProtocol);
        }