|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.common.utils; |
|
|
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.List; |
|
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
|
import com.ruoyi.common.constant.Constants; |
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDictData; |
|
|
|
|
import com.ruoyi.common.core.redis.RedisCache; |
|
|
|
@ -38,10 +39,10 @@ public class DictUtils |
|
|
|
|
*/ |
|
|
|
|
public static List<SysDictData> getDictCache(String key) |
|
|
|
|
{ |
|
|
|
|
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); |
|
|
|
|
if (StringUtils.isNotNull(cacheObj)) |
|
|
|
|
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); |
|
|
|
|
if (StringUtils.isNotNull(arrayCache)) |
|
|
|
|
{ |
|
|
|
|
return StringUtils.cast(cacheObj); |
|
|
|
|
return arrayCache.toList(SysDictData.class); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -83,7 +84,9 @@ public class DictUtils |
|
|
|
|
StringBuilder propertyString = new StringBuilder(); |
|
|
|
|
List<SysDictData> datas = getDictCache(dictType); |
|
|
|
|
|
|
|
|
|
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) |
|
|
|
|
if (StringUtils.isNotNull(datas)) |
|
|
|
|
{ |
|
|
|
|
if (StringUtils.containsAny(separator, dictValue)) |
|
|
|
|
{ |
|
|
|
|
for (SysDictData dict : datas) |
|
|
|
|
{ |
|
|
|
@ -107,6 +110,7 @@ public class DictUtils |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.stripEnd(propertyString.toString(), separator); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|