#
Junjie
昨天 1786865cb0dd37da602852b97ab0b80da025f353
src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java
@@ -170,8 +170,14 @@
                    int currentLev = Utils.getLev(currentLocNo);
                    //判断当前楼层是否有任务,如果有则不分配这辆车
                    List<WrkMast> wrkMasts1 = wrkMastService.selectWrkByLev(currentLev);
                    int shuttleCount = this.getShuttleEnableUseCountByLev(currentLev);//获取穿梭车楼层车辆数量
                    if (!wrkMasts1.isEmpty() && shuttleCount <= 1) {
                    int currentLevTaskCount = wrkMasts1.size();
                    for (WrkMast wrkMast : wrkMasts1) {
                        if (wrkMast.getIoType() == WrkIoType.SHUTTLE_CHARGE.id) {
                            currentLevTaskCount--;
                        }
                    }
                    int shuttleCount = this.getShuttleCountByLev(currentLev);//获取穿梭车楼层车辆数量
                    if (currentLevTaskCount > 0 && shuttleCount <= 1) {
                        //存在其他任务且可用小车数量小于等于1,跳过这辆车
                        continue;
                    }
@@ -220,6 +226,11 @@
        //小车处于空闲状态
        if (!shuttleThread.isIdle()) {
            News.info("{}号小车,忙碌中", shuttleNo);
            return false;
        }
        if (shuttleProtocol.getCurrentLocNo().equals(locNo)) {
            News.info("{}号小车,移动目标位置与小车当前位置一致无法移动", shuttleNo);
            return false;
        }
@@ -401,6 +412,11 @@
        //判断是否有充电任务正在使用穿梭车
        WrkMast wrkMast = wrkMastService.selectChargeWorking(shuttleNo);
        if (wrkMast != null) {
            if (wrkMast.getMemo().equals("suggestCharge")) {
                wrkMast.setMemo("suggestChargeTaskStop");//断开充电
                wrkMast.setModiTime(new Date());
                wrkMastService.updateById(wrkMast);
            }
            return true;//有充电任务
        }
        return false;//无充电任务