| | |
| | | import java.util.Collection;
|
| | | import java.util.List;
|
| | | import com.alibaba.fastjson2.JSONArray;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.utils.spring.SpringUtils;
|
| | | import com.ruoyi.framework.redis.RedisCache;
|
| | | import com.ruoyi.project.system.domain.SysDictData;
|
| | |
| | | */
|
| | | public static String getDictLabel(String dictType, String dictValue)
|
| | | {
|
| | | if (StringUtils.isEmpty(dictValue))
|
| | | {
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | return getDictLabel(dictType, dictValue, SEPARATOR);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public static String getDictValue(String dictType, String dictLabel)
|
| | | {
|
| | | if (StringUtils.isEmpty(dictLabel))
|
| | | {
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | return getDictValue(dictType, dictLabel, SEPARATOR);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public static void clearDictCache()
|
| | | {
|
| | | Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
|
| | | Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*");
|
| | | SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public static String getCacheKey(String configKey)
|
| | | {
|
| | | return Constants.SYS_DICT_KEY + configKey;
|
| | | return CacheConstants.SYS_DICT_KEY + configKey;
|
| | | }
|
| | | }
|