#
Junjie
7 天以前 2c1e3b7b10c0d4afbf09a9151e132f1ee85b9c6f
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -89,35 +89,35 @@
        });
        readThread.start();
        //设备执行
        Thread executeThread = new Thread(() -> {
            while (true) {
                try {
                    if (shuttleAction == null) {
                        try {
                            shuttleAction = SpringUtils.getBean(ShuttleAction.class);
                        }catch (Exception e){
                        }
                        continue;
                    }
                    Object object = redisUtil.get(RedisKeyType.SHUTTLE_FLAG.key + deviceConfig.getDeviceNo());
                    if (object == null) {
                        continue;
                    }
                    Integer taskNo = Integer.valueOf(String.valueOf(object));
                    if (taskNo != 0) {
                        //存在任务需要执行
                        boolean result = shuttleAction.executeWork(deviceConfig.getDeviceNo(), taskNo);
                    }
                    Thread.sleep(100);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
        executeThread.start();
//        //设备执行
//        Thread executeThread = new Thread(() -> {
//            while (true) {
//                try {
//                    if (shuttleAction == null) {
//                        try {
//                            shuttleAction = SpringUtils.getBean(ShuttleAction.class);
//                        }catch (Exception e){
//                        }
//                        continue;
//                    }
//
//                    Object object = redisUtil.get(RedisKeyType.SHUTTLE_FLAG.key + deviceConfig.getDeviceNo());
//                    if (object == null) {
//                        continue;
//                    }
//
//                    Integer taskNo = Integer.valueOf(String.valueOf(object));
//                    if (taskNo != 0) {
//                        //存在任务需要执行
//                        boolean result = shuttleAction.executeWork(deviceConfig.getDeviceNo(), taskNo);
//                    }
//                    Thread.sleep(100);
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
//        });
//        executeThread.start();
    }
    private void listenMessageFromRedis() {
@@ -927,8 +927,11 @@
            return false;
        }
        List<NavigationMapType> restartCalcMapTypes = new ArrayList<>(mapTypes);
        restartCalcMapTypes.add(NavigationMapType.SHUTTLE);
        String currentLocNo = shuttleProtocol.getCurrentLocNo();
        List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, mapTypes, assignCommand, this);
        List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(currentLocNo, locNo, restartCalcMapTypes, assignCommand, this);
        if (commands == null) {
            return false;
        }