Commit 30bcda9e authored by 张森's avatar 张森

健康诊断告警,稳压泵每小时启动次数>15次生成了告警记录、但是设备未赋红码

parent 4f7fae68
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.biz.common.utils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
......@@ -24,6 +25,10 @@ public class RedisUtils {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private StringRedisTemplate stringRedisTemplate;
/**
* 指定缓存失效时间
*
......@@ -41,6 +46,17 @@ public class RedisUtils {
}
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public String getString(String key) {
String object = stringRedisTemplate.opsForValue().get(key);
return object;
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
......
......@@ -3111,10 +3111,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
private JSONObject getRiskTriggerConfig(String tableName) {
Map<String, Object> configMap = JSON.parseObject(redisUtils.get(QRCODE_REDIS_KEY).toString(), Map.class);
Map<String, Object> configMap = JSON.parseObject(redisUtils.getString(QRCODE_REDIS_KEY), Map.class);
if (!ObjectUtils.isEmpty(configMap)) {
String config = configMap.get(tableName + "0").toString();
return JSONObject.parseObject(config).getJSONObject("extra");
return JSONObject.parseObject(config).getJSONObject("content").getJSONObject("extra");
}
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment