#
Junjie
3 天以前 6cf4a3e2ba925e75b60f13bb8ebc5e92d37809b2
src/main/java/com/zy/asrs/utils/Utils.java
@@ -84,7 +84,7 @@
        return null;
    }
    //获取除白名单外的指定楼层全部穿梭车xy坐标点
    //获取穿梭车xy坐标点
    public static int[] getShuttlePoint(Integer shuttleNo) {
        //获取穿梭车所在节点位置
        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
@@ -145,6 +145,34 @@
            list.add(xyPosition);
        }
        return list;
    }
    public static ShuttleThread searchShuttle(String locNo) {
        DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class);
        List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.Shuttle)));
        for (DeviceConfig device : shuttleList) {
            //获取穿梭车所在节点位置
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo());
            if (shuttleThread == null) {
                continue;
            }
            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
            if (shuttleProtocol == null) {
                continue;
            }
            String currentLocNo = shuttleProtocol.getCurrentLocNo();
            if (currentLocNo == null) {
                continue;
            }
            if (currentLocNo.equals(locNo)) {
                return shuttleThread;
            }
        }
        return null;
    }
    //检测楼层是否有可用穿梭车
@@ -252,7 +280,7 @@
        String recentLocNo = null;
        for (LocMast locMast : locMasts) {
            //待机位到目标点距离
            List<NavigateNode> currentShuttlePath = navigateUtils.calc(locNo, locMast.getLocNo(), NavigationMapType.NORMAL.id, Utils.getShuttlePoints(0, Utils.getLev(locNo)), null);//搜索空闲穿梭车,使用正常通道地图
            List<NavigateNode> currentShuttlePath = navigateUtils.calc(locNo, locMast.getLocNo(), NavigationMapType.getMapTypes(NavigationMapType.NORMAL), Utils.getShuttlePoints(0, Utils.getLev(locNo)), null);//搜索空闲穿梭车,使用正常通道地图
            if (currentShuttlePath == null) {
                continue;
            }