| | |
| | | Map<String, Object> adjustFormula = redisTemplate.opsForHash().entries(RedisConstants.ADJUST + "_" + mac); |
| | | if (!ObjectUtils.isEmpty(adjustFormula)) { |
| | | Map<String, Object> deviceInfo = getDeviceByMac(mac); |
| | | Map<String, Object> monitorPoint = (Map<String, Object>) deviceInfo.get("monitorPoint"); |
| | | String areaCode = monitorPoint.get("areaCode").toString(); |
| | | String cityCode = monitorPoint.get("cityCode").toString(); |
| | | |
| | | Map<String, Object> aqiMap = (Map<String, Object>) redisTemplate.opsForHash().get(RedisConstants.AQI_DATA, areaCode); |
| | | if (ObjectUtils.isEmpty(aqiMap)) { |
| | | aqiMap = (Map<String, Object>) redisTemplate.opsForHash().get(RedisConstants.AQI_DATA, cityCode); |
| | | //获取设备绑定的国控站信息 |
| | | Map<String, Object> govMpInfo = (Map<String, Object>) deviceInfo.get("govMonitorPoint"); |
| | | Map<String, Object> aqiMap = null; |
| | | if (govMpInfo.get("guid") != null) { |
| | | aqiMap = (Map<String, Object>) redisTemplate.opsForHash().get(RedisConstants.AQI_DATA, govMpInfo.get("guid").toString()); |
| | | } |
| | | return adjustDataUtils.adjust(deviceData, adjustFormula, ObjectUtils.isEmpty(aqiMap) ? null : aqiMap); |
| | | } |