| | |
| | | } |
| | | List<DeviceConfig> deviceConfigs = fakeDeviceUtils.getFakeDeviceConfig(); |
| | | for (DeviceConfig device : deviceConfigs) { |
| | | if (!device.getDeviceType().equals(String.valueOf(SlaveType.Shuttle))) { |
| | | continue; |
| | | } |
| | | |
| | | excuteFakeCommand(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), device); |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | fakeStatus.put("currentCode", JSON.toJSONString(point)); |
| | | fakeStatus.put("deviceStatus", 1);//设备空闲 |
| | | fakeStatusMap.put(key, fakeStatus); |
| | | } else if (commandType.equals("move")) { |
| | | } else if (commandType.equals("move") || commandType.equals("intoLift") || commandType.equals("outLift")) { |
| | | String baseCommandKey = RedisKeyType.FAKE_SHUTTLE_MOVE_EXECUTE_COMMAND_LIST.key + deviceConfig.getDeviceNo() + "_"; |
| | | while (true) { |
| | | Set<String> keys = redisUtil.searchKeys(baseCommandKey); |
| | |
| | | } |
| | | |
| | | String finalKey = baseCommandKey + System.currentTimeMillis(); |
| | | redisUtil.set(finalKey, true, 60 * 60); |
| | | redisUtil.set(finalKey, true, 60 * 2); |
| | | |
| | | JSONObject body = command.getJSONObject("commandBody"); |
| | | String requestType = body.getString("requestType"); |
| | | String pathList = body.getString("path"); |
| | | List<JSONObject> executePathList = JSON.parseArray(pathList, JSONObject.class); |
| | | |
| | |
| | | } else if (requestType.equals("updateFloor")) { |
| | | fakeCommandMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), fakeCommand); |
| | | response = genereateFakeCommandResponse(requestId, taskId, requestType); |
| | | } else if (requestType.equals("move")) { |
| | | } else if (requestType.equals("move") || requestType.equals("intoLift") || requestType.equals("outLift")) { |
| | | fakeCommandMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), fakeCommand); |
| | | response = genereateFakeCommandResponse(requestId, taskId, requestType); |
| | | } else if (requestType.equals("readState")) { |