解决“在只填加了字典类型,没有添加字典数据时,会出现缓存了空集合,即使后边添加了字典数据也没用,只能清空redis缓存。”的问题,小问题就是判断稍稍改了下,若依大大让我pr当个贡献者,很荣幸很欣慰。感谢!

This commit is contained in:
dawn 2020-09-02 10:14:34 +08:00
parent 4f86b6d9ca
commit 3fd9147afb
1 changed files with 2 additions and 2 deletions

View File

@ -76,12 +76,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
public List<SysDictData> selectDictDataByType(String dictType)
{
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotNull(dictDatas))
if (null!=dictDatas&&!dictDatas.isEmpty())
{
return dictDatas;
}
dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotNull(dictDatas))
if (null!=dictDatas&&!dictDatas.isEmpty())
{
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;