#
Junjie
2024-12-24 0df6e7bb33c9f6a18f026a500776b00cbf2ae62c
src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
@@ -103,6 +103,11 @@
                continue;
            }
            if (shuttleProtocol.getWorkingMode() == 0) {
                //小车处于手动模式
                continue;
            }
            int currentLev = shuttleProtocol.getPoint().getZ();//小车当前层高
            String currentLocNo = shuttleProtocol.getCurrentLocNo();//小车当前库位号
@@ -176,8 +181,9 @@
                    String currentLocNo = shuttleThread.getShuttleProtocol().getCurrentLocNo();
                    int currentLev = Utils.getLev(currentLocNo);
                    List<WrkMast> wrkMasts1 = wrkMastService.selectNoShuttleWrkByLev(currentLev);//判断当前穿梭车楼层是否有待分配车辆的任务,如果有则不分配这辆车
                    if (!wrkMasts1.isEmpty()) {
                        //存在其他任务,跳过这辆车
                    int shuttleCount = this.getShuttleCountByLev(currentLev);//获取穿梭车楼层车辆数量
                    if (!wrkMasts1.isEmpty() && shuttleCount <= 1) {
                        //存在其他任务且可用小车数量小于等于1,跳过这辆车
                        continue;
                    }
@@ -315,16 +321,20 @@
            NyShuttleProtocol.NyShuttlePointClass point = null;
            if (shuttleProtocol.getPoint() == null) {
                BasShuttle basShuttle = basShuttleService.selectById(shuttle.getId());//小车如果没有数据,从数据库取数据
                if (basShuttle == null || basShuttle.getPoint() == null) {
                    continue;
                }
                point = JSON.parseObject(basShuttle.getPoint(), NyShuttleProtocol.NyShuttlePointClass.class);
                continue;
            }else {
                point = shuttleProtocol.getPoint();
            }
            if (point.getZ().equals(lev)) {
                if (shuttleProtocol.getChargState() == 1) {
                    continue;//充电中
                }
                if (shuttleProtocol.getSuspendState() == 1) {
                    continue;//管制中
                }
                levCount++;//目标楼层有车,数量增加
            }
        }