#
Junjie
2025-01-06 0ac76f7d8101903e1d050116f7d3835ce1303dfa
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
File was renamed from src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
@@ -1,32 +1,25 @@
package com.zy.common.utils;
package com.zy.core.dispatcher;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.WrkCharge;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.mapper.WrkChargeMapper;
import com.zy.asrs.mapper.WrkMastMapper;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.NavigateNode;
import com.zy.common.model.enums.NavigationMapType;
import com.zy.common.service.CommonService;
import com.zy.common.utils.ForkLiftUtils;
import com.zy.common.utils.NavigateUtils;
import com.zy.core.News;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.ShuttleChargeType;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.LiftSlave;
import com.zy.core.enums.WrkStsType;
import com.zy.core.model.ForkLiftSlave;
import com.zy.core.model.ShuttleSlave;
import com.zy.core.model.protocol.LiftProtocol;
import com.zy.core.model.protocol.LiftStaProtocol;
import com.zy.core.model.protocol.NyShuttleProtocol;
import com.zy.core.model.protocol.*;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.LiftThread;
import com.zy.core.thread.NyShuttleThread;
import com.zy.core.thread.ForkLiftThread;
import com.zy.core.thread.ShuttleThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -46,20 +39,16 @@
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private WrkMastMapper wrkMastMapper;
    @Autowired
    private WrkChargeMapper wrkChargeMapper;
    @Autowired
    private CommonService commonService;
    @Autowired
    private NavigateUtils navigateUtils;
    @Autowired
    private ConfigService configService;
    /**
     * 调度车辆-调度指定穿梭车
     */
    public boolean dispatchShuttle(Integer wrkNo, String locNo, Integer shuttleNo) {
        if (!checkCharge(shuttleNo, locNo)) {
            News.info("{}号小车,存在充电任务禁止小车移动任务调度", shuttleNo);
            return false;//存在充电任务暂停调度
        }
        return shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
    }
@@ -68,7 +57,7 @@
     */
    public boolean dispatchShuttle(Integer wrkNo, String locNo) {
        //检测目标库位组是否存在小车,如存在小车则直接指定该车
        WrkMast wrkMast = wrkMastMapper.selectByWorkNo(wrkNo);
        WrkMast wrkMast = wrkMastService.selectByWorkNo(wrkNo);
        if (wrkMast != null) {
            String targetLocNo = wrkMast.getIoType() < 100 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo();
            List<String> groupLoc = Utils.getGroupLoc(targetLocNo);
@@ -79,13 +68,13 @@
            }
        }
        ArrayList<NyShuttleThread> sameLev = new ArrayList<>();//相同楼层的穿梭车
        ArrayList<NyShuttleThread> diffLev = new ArrayList<>();//不同楼层的穿梭车
        ArrayList<ShuttleThread> sameLev = new ArrayList<>();//相同楼层的穿梭车
        ArrayList<ShuttleThread> diffLev = new ArrayList<>();//不同楼层的穿梭车
        for (ShuttleSlave shuttle : slaveProperties.getShuttle()) {
            //获取四向穿梭车线程
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
                continue;
            }
@@ -94,30 +83,20 @@
                continue;//存在充电任务,过滤小车
            }
            if (!shuttleProtocol.isIdle()) {
            if (!shuttleThread.isIdle()) {
                continue;//小车忙碌中
            }
            if (shuttleProtocol.getSuspendState() == 1) {
                //小车处于管制中
                continue;
            }
            if (shuttleProtocol.getWorkingMode() == 0) {
                //小车处于手动模式
                continue;
            }
            int currentLev = shuttleProtocol.getPoint().getZ();//小车当前层高
            int currentLev = Utils.getLev(shuttleProtocol.getCurrentLocNo());//小车当前层高
            String currentLocNo = shuttleProtocol.getCurrentLocNo();//小车当前库位号
            if (currentLocNo.equals(locNo)) {
                //车辆当前位置已经是目标库位,调度该车
                //给工作档绑定小车号
                WrkMast wrkMast1 = wrkMastMapper.selectByWorkNo(wrkNo);
                WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkNo);
                if (wrkMast1 != null) {
                    wrkMast1.setShuttleNo(shuttleProtocol.getShuttleNo().intValue());
                    wrkMastMapper.updateById(wrkMast1);
                    wrkMast1.setShuttleNo(shuttleProtocol.getShuttleNo());
                    wrkMastService.updateById(wrkMast1);
                    return true;
                }
                break;
@@ -135,24 +114,28 @@
        //优先调度同楼层小车,寻找离任务最近的穿梭车
        if (!sameLev.isEmpty()) {
            Map<Integer, NyShuttleThread> sameShuttles = new TreeMap<>();//自然排序小车Map
            for (NyShuttleThread shuttleThread : sameLev) {
            Map<Integer, ShuttleThread> sameShuttles = new TreeMap<>();//自然排序小车Map
            for (ShuttleThread shuttleThread : sameLev) {
                ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                Integer shuttleNo = shuttleProtocol.getShuttleNo();
                //当前穿梭车库位号
                String currentLocNo = shuttleThread.getShuttleProtocol().getCurrentLocNo();
                String currentLocNo = shuttleProtocol.getCurrentLocNo();
                //当前穿梭车线程到目标地点距离
                List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleThread.getSlave().getId(), Utils.getLev(currentLocNo)), null);//搜索空闲穿梭车,使用正常通道地图
                List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//搜索空闲穿梭车,使用正常通道地图
                if (currentShuttlePath == null) {
                    continue;
                }
                Integer currentAllDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离
                Integer currentAllDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离
                sameShuttles.put(currentAllDistance, shuttleThread);
            }
            //尝试调度同楼层小车
            for (Map.Entry<Integer, NyShuttleThread> entry : sameShuttles.entrySet()) {
                NyShuttleThread shuttleThread = entry.getValue();
            for (Map.Entry<Integer, ShuttleThread> entry : sameShuttles.entrySet()) {
                ShuttleThread shuttleThread = entry.getValue();
                ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                Integer shuttleNo = shuttleProtocol.getShuttleNo();
                //尝试调度小车
                boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleThread.getSlave().getId());
                boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
                if (result) {
                    return true;//调度成功
                }
@@ -162,9 +145,9 @@
        //执行到此处,同楼层无调度成功小车。需要进行跨楼层调度小车
        //寻找离任务楼层最近的穿梭车(不考虑跨楼层小车移动距离)
        if (!diffLev.isEmpty()) {
            Map<Integer, NyShuttleThread> diffShuttles = new TreeMap<>();//自然排序小车Map
            Map<Integer, ShuttleThread> diffShuttles = new TreeMap<>();//自然排序小车Map
            //获取任务
            WrkMast wrkMast1 = wrkMastMapper.selectByWorkNo(wrkNo);
            WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkNo);
            if (wrkMast1 != null) {
                String targetLoc = wrkMast1.getIoType() < 100 ? wrkMast1.getLocNo() : wrkMast1.getSourceLocNo();
                int lev = Utils.getLev(targetLoc);//目标楼层
@@ -176,9 +159,10 @@
                    return false;
                }
                for (NyShuttleThread shuttleThread : diffLev) {
                for (ShuttleThread shuttleThread : diffLev) {
                    ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                    //当前穿梭车库位号
                    String currentLocNo = shuttleThread.getShuttleProtocol().getCurrentLocNo();
                    String currentLocNo = shuttleProtocol.getCurrentLocNo();
                    int currentLev = Utils.getLev(currentLocNo);
                    List<WrkMast> wrkMasts1 = wrkMastService.selectNoShuttleWrkByLev(currentLev);//判断当前穿梭车楼层是否有待分配车辆的任务,如果有则不分配这辆车
                    int shuttleCount = this.getShuttleCountByLev(currentLev);//获取穿梭车楼层车辆数量
@@ -193,10 +177,12 @@
                }
                //尝试调度跨楼层小车
                for (Map.Entry<Integer, NyShuttleThread> entry : diffShuttles.entrySet()) {
                    NyShuttleThread shuttleThread = entry.getValue();
                for (Map.Entry<Integer, ShuttleThread> entry : diffShuttles.entrySet()) {
                    ShuttleThread shuttleThread = entry.getValue();
                    ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
                    Integer shuttleNo = shuttleProtocol.getShuttleNo();
                    //尝试调度小车
                    boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleThread.getSlave().getId());
                    boolean result = shuttleMoveGenerate(wrkNo, locNo, shuttleNo);
                    if (result) {
                        return true;//调度成功
                    }
@@ -215,32 +201,32 @@
    public boolean shuttleMoveGenerate(Integer wrkNo, String locNo, Integer shuttleNo) {
        Date now = new Date();
        //获取四向穿梭车线程
        NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
        if (shuttleThread == null) {
            News.info("{}号小车,线程不存在", shuttleNo);
            return false;
        }
        NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
        ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
        if (shuttleProtocol == null) {
            News.info("{}号小车,线程不存在", shuttleNo);
            return false;
        }
        //小车处于空闲状态
        if (!shuttleProtocol.isIdleNoCharge()) {
        if (!shuttleThread.isIdle()) {
            News.info("{}号小车,忙碌中", shuttleNo);
            return false;
        }
        //判断穿梭车是否存在未完成的小车移库任务
        WrkMast hasMoveWorking = wrkMastMapper.selectShuttleHasMoveWorking(shuttleNo);
        WrkMast hasMoveWorking = wrkMastService.selectShuttleHasMoveWorking(shuttleNo);
        if (hasMoveWorking != null) {//小车存在移库任务,等待执行完成后再生成新的任务
            News.info("{}号小车,存在移动任务,等待执行完成后再生成新的任务", shuttleNo);
            return false;
        }
        //判断是否有其他任务正在使用穿梭车
        WrkMast wrkMast2 = wrkMastMapper.selectShuttleWorking(shuttleNo);
        WrkMast wrkMast2 = wrkMastService.selectShuttleWorking(shuttleNo);
        if (wrkMast2 != null) {//小车存在其他工作档任务,等待执行完成后再生成新的任务
            News.info("{}号小车,存在其他工作档任务,等待执行完成再生成新的任务", shuttleNo);
            return false;
@@ -248,10 +234,10 @@
        Integer sourceStaNo = null;//小车换层源站点
        Integer staNo = null;//小车换层目标站点
        if (Utils.getLev(locNo) != shuttleProtocol.getPoint().getZ()) {
        if (Utils.getLev(locNo) != Utils.getLev(shuttleProtocol.getCurrentLocNo())) {
            //目标库位和小车库位处于不同一楼层,需要通过提升机调度
            //获取穿梭车最近且空闲的提升机输送站点
            LiftStaProtocol liftSta = this.getRecentLiftSta(shuttleNo, Utils.getLev(locNo));
            ForkLiftStaProtocol liftSta = this.getRecentLiftSta(shuttleNo, Utils.getLev(locNo));
            if (liftSta == null) {
                News.info("{}号小车,{}目标库位,没有可用空闲输送站点", shuttleNo, locNo);
                return false;//没有可用且空闲的输送站点
@@ -267,30 +253,27 @@
        WrkMast wrkMast = new WrkMast();
        wrkMast.setWrkNo(workNo);
        wrkMast.setIoTime(now);
        wrkMast.setWrkSts(101L); // 工作状态:101.移动到近点等待迁出
        wrkMast.setIoType(200); // 入出库状态: 200.小车移库
        wrkMast.setWrkSts(WrkStsType.NEW_MOVE.sts); // 工作状态:301.生成迁移任务
        wrkMast.setIoType(200); // 入出库状态: 200.小车迁移
        wrkMast.setIoPri(20D);
        wrkMast.setShuttleNo(shuttleNo);//穿梭车号
        wrkMast.setSourceLocNo(shuttleProtocol.getCurrentLocNo()); // 源库位 => 小车当前库位号
        wrkMast.setLocNo(locNo); // 目标库位
        wrkMast.setSourceStaNo(sourceStaNo);//源站
        wrkMast.setStaNo(staNo);//目标站
        wrkMast.setPicking("N"); // 拣料
        wrkMast.setExitMk("N"); // 退出
        wrkMast.setLinkMis("N");
        wrkMast.setAppeTime(now);
        wrkMast.setModiTime(now);
        int res = wrkMastMapper.insert(wrkMast);
        if (res == 0) {
        boolean res = wrkMastService.insert(wrkMast);
        if (!res) {
            News.error("小车迁移 --- 保存工作档失败! 穿梭车号:" + shuttleNo);
            throw new CoolException("保存工作档失败");
        }
        //给工作档绑定小车号
        WrkMast wrkMast1 = wrkMastMapper.selectByWorkNo(wrkNo);
        WrkMast wrkMast1 = wrkMastService.selectByWorkNo(wrkNo);
        if (wrkMast1 != null) {
            wrkMast1.setShuttleNo(shuttleNo);
            wrkMastMapper.updateById(wrkMast1);
            wrkMastService.updateById(wrkMast1);
        }
        return true;
@@ -301,8 +284,6 @@
     * true: 小于最大数量  false: 大于或等于最大数量
     */
    public boolean checkDispatchMaxNum(Integer lev) {
        BasShuttleService basShuttleService = SpringUtils.getBean(BasShuttleService.class);
        ConfigService configService = SpringUtils.getBean(ConfigService.class);
        EntityWrapper<Config> wrapper = new EntityWrapper<>();
        wrapper.eq("code", "dispatchShuttleMaxNum");
        Config config = configService.selectOne(wrapper);
@@ -313,34 +294,28 @@
        int levCount = 0;//目标楼层车辆数量
        for (ShuttleSlave shuttle : slaveProperties.getShuttle()) {
            //获取四向穿梭车线程
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId());
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
                continue;
            }
            NyShuttleProtocol.NyShuttlePointClass point = null;
            if (shuttleProtocol.getPoint() == null) {
            String currentLocNo = shuttleProtocol.getCurrentLocNo();
            if (currentLocNo == null) {
                continue;
            }else {
                point = shuttleProtocol.getPoint();
            }
            int currentLev = Utils.getLev(currentLocNo);
            if (point.getZ().equals(lev)) {
                if (shuttleProtocol.getChargState() == 1) {
                    continue;//充电中
            if (lev == currentLev) {
                if (shuttleThread.isCharging()) {
                    continue;
                }
                if (shuttleProtocol.getSuspendState() == 1) {
                    continue;//管制中
                }
                levCount++;//目标楼层有车,数量增加
            }
        }
        //搜索是否存在前往目标楼层的小车移动工作档
        for (WrkMast wrkMast : wrkMastMapper.selectShuttleMoveWrk()) {
        for (WrkMast wrkMast : wrkMastService.selectShuttleMoveWrk()) {
            if (wrkMast.getSourceLocNo() == null || wrkMast.getLocNo() == null) {
                continue;
            }
@@ -364,40 +339,40 @@
    /**
     * 获取穿梭车最近且空闲的提升机输送站点
     */
    public LiftStaProtocol getRecentLiftSta(Integer shuttleNo, Integer targetLev) {
    public ForkLiftStaProtocol getRecentLiftSta(Integer shuttleNo, Integer targetLev) {
        //获取四向穿梭车线程
        NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
        if (shuttleThread == null) {
            return null;
        }
        NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
        ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
        if (shuttleProtocol == null) {
            return null;
        }
        //获取小车同一楼层的站点
        ArrayList<LiftStaProtocol> list = new ArrayList<>();
        ArrayList<ForkLiftStaProtocol> list = new ArrayList<>();
        int lev = Utils.getLev(shuttleProtocol.getCurrentLocNo());//小车楼层
        for (LiftSlave slave : slaveProperties.getLift()) {
            LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, slave.getId());
            if (liftThread == null) {
        for (ForkLiftSlave slave : slaveProperties.getForkLift()) {
            ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId());
            if (forkLiftThread == null) {
                continue;
            }
            LiftProtocol liftProtocol = liftThread.getLiftProtocol();
            if (liftProtocol == null) {
            ForkLiftProtocol forkLiftProtocol = forkLiftThread.getStatus();
            if (forkLiftProtocol == null) {
                continue;
            }
            if (!liftProtocol.isIdle()) {
            if (!forkLiftThread.isIdle()) {
                continue;
            }
            LiftStaProtocol liftStaProtocol = NyLiftUtils.getLiftStaByLev(slave.getId(), lev);
            if (liftStaProtocol == null) {
            ForkLiftStaProtocol forkLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(slave.getId(), lev);
            if (forkLiftStaProtocol == null) {
                continue;
            }
            //判断目标楼层站点是否无托盘
            LiftStaProtocol targetLiftStaProtocol = NyLiftUtils.getLiftStaByLev(slave.getId(), targetLev);
            ForkLiftStaProtocol targetLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(slave.getId(), targetLev);
            if (targetLiftStaProtocol == null) {
                continue;
            }
@@ -406,7 +381,7 @@
                continue;//有托盘跳过
            }
            list.add(liftStaProtocol);
            list.add(forkLiftStaProtocol);
        }
        if (list.isEmpty()) {
@@ -415,21 +390,21 @@
        String currentLocNo = shuttleProtocol.getCurrentLocNo();//小车位置
        Integer recentAllDistance = 9999999;
        LiftStaProtocol recentSta = null;//最近站点
        ForkLiftStaProtocol recentSta = null;//最近站点
        //搜索距离小车最近的站点
        for (LiftStaProtocol liftStaProtocol : list) {
            Integer staNo = liftStaProtocol.getStaNo();//站点号
            String locNo = liftStaProtocol.getLocNo();//站点库位号
        for (ForkLiftStaProtocol forkLiftStaProtocol : list) {
            Integer staNo = forkLiftStaProtocol.getStaNo();//站点号
            String locNo = forkLiftStaProtocol.getLocNo();//站点库位号
            //当前穿梭车线程到目标地点距离
            List<NavigateNode> currentShuttlePath = NavigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//使用正常通道地图
            List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(currentLocNo)), null);//使用正常通道地图
            if (currentShuttlePath == null) {
                continue;
            }
            Integer currentAllDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离
            Integer currentAllDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离
            if (currentAllDistance < recentAllDistance) {
                //如果当前楼层的车路径更小,则更新最近站点
                recentSta = liftStaProtocol;
                recentSta = forkLiftStaProtocol;
                recentAllDistance = currentAllDistance;
            }
        }
@@ -442,42 +417,11 @@
     */
    public boolean checkChargeWrk(int shuttleNo) {
        //判断是否有充电任务正在使用穿梭车
        WrkCharge wrkCharge = wrkChargeMapper.selectWorking(shuttleNo);
        if (wrkCharge != null) {
        WrkMast wrkMast = wrkMastService.selectChargeWorking(shuttleNo);
        if (wrkMast != null) {
            return true;//有充电任务
        }
        return false;//无充电任务
    }
    /**
     * 检测穿梭车是否有充电任务,目标点是否为充电桩位置
     * @param shuttleNo 小车号
     * @param locNo 目标位置
     */
    public boolean checkCharge(int shuttleNo, String locNo) {
        //判断是否有充电任务正在使用穿梭车
        WrkCharge wrkCharge = wrkChargeMapper.selectWorking(shuttleNo);
        if (wrkCharge != null) {//小车存在充电任务,等待执行完成后再生成新的任务
            //判断目标点是否为充电桩,如果是去充电则放行
            boolean toCharge = false;//去充电目标
            for (ShuttleChargeType chargeType : ShuttleChargeType.values()) {
                if (chargeType.locNo.equals(locNo)) {
                    toCharge = true;//去充电桩
                    break;
                }
            }
            if (wrkCharge.getWrkSts() == 53) {
                toCharge = true;//充电结束,允许生成移库任务
            }
            if (!toCharge) {
                //不是去充电桩且存在充电任务,禁止生成新的移动任务
                return false;
            }
        }
        return true;//无充电任务放行 || 去充电桩中放行
    }
    /**
@@ -487,12 +431,12 @@
        int count = 0;
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            //获取四向穿梭车线程
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            if (shuttleThread == null) {
                continue;
            }
            NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
                continue;
            }
@@ -501,16 +445,11 @@
                continue;//存在充电任务,过滤小车
            }
            if (shuttleProtocol.getWorkingMode() == 0) {
                continue;//手动状态
            }
            if (shuttleProtocol.getSuspendState() == 1) {
                //小车处于管制中
            if (!shuttleThread.isIdle()) {
                continue;
            }
            if (shuttleProtocol.getPoint().getZ() == lev) {
            if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) == lev) {
                //同一楼层可用小车
                count++;
                continue;