| | |
| | | Reboot("10"), |
| | | // 设置心跳包间隔 |
| | | SettingHeartBeatTime("11"), |
| | | // 大气设备心跳包存储(设备状态)) |
| | | // 大气设备心跳包存储 |
| | | AIR_HEARTBEAT("air_heartbeat:air_heartbeat"), |
| | | // 大气设备心跳包存储(设备状态)) |
| | | AIR_HEARTBEAT_STATE("air_heartbeat:air_heartbeat_state"), |
| | | // 大气设备心跳包存储 农耕 |
| | | AIR_HEARTBEAT_NONG_GENG("air_heartbeat_nong_geng:air_heartbeat_nong_geng"), |
| | | // 大气设备心跳包存储(设备状态))农耕 |
| | | AIR_HEARTBEAT_NONG_GENG("air_heartbeat_nong_geng:air_heartbeat_nong_geng"); |
| | | AIR_HEARTBEAT_NONG_GENG_STATE("air_heartbeat_nong_geng:air_heartbeat_nong_geng_state"); |
| | | /** |
| | | * 大气结束(希梦自研) |
| | | */ |
| | |
| | | airEquipmentNongGengService.addAirEquipment(airEquipmentNongGeng); |
| | | |
| | | //存缓存 |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG.getCode() + deviceName, heartBeatDataPackage, 300L); |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG.getCode() + deviceName, heartBeatDataPackage); |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG_STATE.getCode() + deviceName, heartBeatDataPackage, 300L); |
| | | |
| | | return save(airDataNongGeng); |
| | | } |
| | |
| | | airEquipment.setCreateTime(airData.getCreateTime()); |
| | | airEquipmentService.addAirEquipment(airEquipment); |
| | | |
| | | //存缓存 |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT.getCode() + deviceName, heartBeatDataPackage, 300L); |
| | | //存缓存心跳包 |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT.getCode() + deviceName, heartBeatDataPackage); |
| | | //存缓存状态 |
| | | RedisUtils.getBean().set(AtmoFunctionCode.AIR_HEARTBEAT_STATE.getCode() + deviceName, heartBeatDataPackage, 300L); |
| | | |
| | | return save(airData); |
| | | } |
| | |
| | | */ |
| | | public AirEquipmentNongGeng getAirEquipment(String mac) { |
| | | AirEquipmentNongGeng one = getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac)); |
| | | if (RedisUtils.getBean().get(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG.getCode() + mac) != null) { |
| | | if (RedisUtils.getBean().get(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG_STATE.getCode() + mac) != null) { |
| | | one.setState(1); |
| | | } else { |
| | | one.setState(0); |
| | |
| | | */ |
| | | public AirEquipment getAirEquipment(String mac) { |
| | | AirEquipment one = getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac)); |
| | | if (RedisUtils.getBean().get(AtmoFunctionCode.AIR_HEARTBEAT.getCode() + mac) != null) { |
| | | if (RedisUtils.getBean().get(AtmoFunctionCode.AIR_HEARTBEAT_STATE.getCode() + mac) != null) { |
| | | one.setState(1); |
| | | } else { |
| | | one.setState(0); |