فهرست منبع

缓存数据库处理

zhanghao 1 ماه پیش
والد
کامیت
22585f6f9b

+ 7 - 1
project-common/src/main/java/com/project/common/core/redis/MyCache.java

@@ -109,6 +109,9 @@ public class MyCache {
         if (Objects.isNull(key)){
         if (Objects.isNull(key)){
             return null;
             return null;
         }
         }
+        if (key.toString().equals("hq-service:sys_config:sys.account.captchaEnabled_sxgw24")){
+            return "true";
+        }
         LargeCache cache = platCacheMapper.selectCache(key.toString());
         LargeCache cache = platCacheMapper.selectCache(key.toString());
         if (cache == null || StringUtils.isBlank(cache.getKey())){
         if (cache == null || StringUtils.isBlank(cache.getKey())){
             return null;
             return null;
@@ -154,7 +157,10 @@ public class MyCache {
 //        if (Objects.nonNull(value)) {
 //        if (Objects.nonNull(value)) {
 //            caffeineCache.put(key.toString(), value);
 //            caffeineCache.put(key.toString(), value);
 //        }
 //        }
-        if (Objects.isNull(key) || Objects.isNull(value)){
+        if (hasKey(key.toString())){
+            return;
+        }
+        if (Objects.isNull(value)){
             return;
             return;
         }
         }
         if (value instanceof String){
         if (value instanceof String){

+ 1 - 1
project-common/src/main/java/com/project/common/utils/DictUtils.java

@@ -38,7 +38,7 @@ public class DictUtils {
      * @return dictDatas 字典数据列表
      * @return dictDatas 字典数据列表
      */
      */
     public static List<SysDictData> getDictCache(String key) {
     public static List<SysDictData> getDictCache(String key) {
-        JSONArray arrayCache = JSONArray.parseArray(JSON.toJSONString(SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key))));
+        JSONArray arrayCache = JSONArray.parseArray(SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)));
 //        JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
 //        JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
         if (StringUtils.isNotNull(arrayCache)) {
         if (StringUtils.isNotNull(arrayCache)) {
             return arrayCache.toList(SysDictData.class);
             return arrayCache.toList(SysDictData.class);