| | |
| | | RtTaskListResponse response = msgContent.getRtTaskListResponse(); |
| | | try { |
| | | log.info("云端下发订单操作的响应消息 (XPU→云端):{}", jsonPrinter.print(response)); |
| | | Object sequence = redisTemplate.opsForValue().get("CREATE_ORDER:" + response.getResults().getOrderId()); |
| | | Object sequence = redisService.getCacheObject("CREATE_ORDER:" + response.getResults().getOrderId()); |
| | | if(sequence!=null){ |
| | | JSONObject jsonObject = JSON.parseObject(sequence.toString()); |
| | | String orderId = jsonObject.getString("orderId"); |
| | |
| | | // 存储车辆挡位 |
| | | GearLevel gearLevel = systemRuntimeStatus.getVehicleStatus().getDynamicStatus().getGearLevel(); |
| | | int value = gearLevel.getNumber(); |
| | | redisTemplate.opsForValue().set(CacheConstants.GEAR_LEVEL + systemRuntimeStatus.getVehicleStatus().getStaticInfo().getXpuId(), value); |
| | | redisService.setCacheObject(CacheConstants.GEAR_LEVEL + systemRuntimeStatus.getVehicleStatus().getStaticInfo().getXpuId(), value); |
| | | // 判断是否为故障状态 |
| | | if (abnormalReason == AbnormalReason.FAULT) { |
| | | log.info("车辆故障,开始处理故障"); |
| | |
| | | snowFlake.withStartTimestamp(1420041600000L); |
| | | long sequence = snowFlake.nextId(); |
| | | // 处理数据 |
| | | redisTemplate.opsForValue().set(sequence,"pushOrder_"+orderId+"_"+vin,30, TimeUnit.MINUTES); |
| | | redisService.setCacheObject(sequence + "","pushOrder_"+orderId+"_"+vin,30L, TimeUnit.MINUTES); |
| | | //开发发送请求到XPU |
| | | xpuUtil.cloudOrderOperation(orderOperationBuilder.build(), vin,sequence); |
| | | } |