#
zy
2025-08-01 8a1502682476d035936b956d6a991f1257d96f81
src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java
@@ -354,25 +354,20 @@
                    fakeStatus.put("deviceStatus", 1);//设备空闲
                    fakeStatusMap.put(key, fakeStatus);
                } else if (commandType.equals("move")) {
                    boolean firstMove = true;
                    String baseCommandKey = RedisKeyType.FAKE_SHUTTLE_MOVE_EXECUTE_COMMAND_LIST.key + deviceConfig.getDeviceNo() + "_";
                    while (true) {
                    Set<String> keys = redisUtil.searchKeys(baseCommandKey);
                    if (!keys.isEmpty()) {
                        firstMove = false;
                        if (keys.isEmpty()) {
                            break;
                    }
                    }
                    String finalKey = baseCommandKey + System.currentTimeMillis();
                    redisUtil.set(finalKey, true, 60 * 60);
                    JSONObject body = command.getJSONObject("commandBody");
                    String pathList = body.getString("path");
                    List<JSONObject> list = JSON.parseArray(pathList, JSONObject.class);
                    String finalKey = baseCommandKey + System.currentTimeMillis();
                    redisUtil.set(finalKey, list);
                    if(!firstMove) {
                        return;
                    }
                    List<JSONObject> executePathList = JSON.parseArray(pathList, JSONObject.class);
                    fakeStatus.put("deviceStatus", 0);//设备忙碌
                    fakeStatusMap.put(key, fakeStatus);
@@ -384,25 +379,6 @@
                        break;
                    }
                    while (true) {
                        Set<String> searchKeys = redisUtil.searchKeys(baseCommandKey);
                        if(searchKeys.isEmpty()) {
                            break;
                        }
                        TreeSet<String> treeSet = new TreeSet<>();
                        for (String tmpKey : searchKeys) {
                            treeSet.add(tmpKey);
                        }
                        String first = treeSet.first();
                        Object object = redisUtil.get(first);
                        if(object == null) {
                            break;
                        }
                        List<JSONObject> executePathList = (List<JSONObject>) object;
                        for (JSONObject path : executePathList) {
                            while (true) {
                                JSONObject realFakeStatus = fakeStatusMap.get(key);
@@ -430,11 +406,10 @@
                            fakeStatusMap.put(key, fakeStatus);
                            startTime = System.currentTimeMillis();
                        }
                        redisUtil.del(first);
                    }
                    fakeStatus.put("deviceStatus", 1);//设备空闲
                    fakeStatusMap.put(key, fakeStatus);
                    redisUtil.del(finalKey);
                }
            } catch (Exception e) {
                e.printStackTrace();