Commit cfce2561 authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_bugfix@dl' into develop_bugfix@dl

parents a1f003b0 30bcda9e
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.biz.common.utils; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.biz.common.utils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.cache.enumeration.CacheType; import org.typroject.tyboot.component.cache.enumeration.CacheType;
...@@ -24,6 +25,10 @@ public class RedisUtils { ...@@ -24,6 +25,10 @@ public class RedisUtils {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired
private StringRedisTemplate stringRedisTemplate;
/** /**
* 指定缓存失效时间 * 指定缓存失效时间
* *
...@@ -41,6 +46,17 @@ public class RedisUtils { ...@@ -41,6 +46,17 @@ public class RedisUtils {
} }
/** /**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public String getString(String key) {
String object = stringRedisTemplate.opsForValue().get(key);
return object;
}
/**
* 根据key 获取过期时间 * 根据key 获取过期时间
* *
* @param key 键 不能为null * @param key 键 不能为null
......
...@@ -3110,10 +3110,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -3110,10 +3110,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
private JSONObject getRiskTriggerConfig(String tableName) { 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)) { if (!ObjectUtils.isEmpty(configMap)) {
String config = configMap.get(tableName + "0").toString(); String config = configMap.get(tableName + "0").toString();
return JSONObject.parseObject(config).getJSONObject("extra"); return JSONObject.parseObject(config).getJSONObject("content").getJSONObject("extra");
} }
return null; 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