|
|
@ -1,6 +1,9 @@ |
|
|
|
package com.ruoyi.system.service.impl; |
|
|
|
package com.ruoyi.system.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -135,11 +138,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void loadingDictCache() |
|
|
|
public void loadingDictCache() |
|
|
|
{ |
|
|
|
{ |
|
|
|
List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll(); |
|
|
|
SysDictData dictData = new SysDictData(); |
|
|
|
for (SysDictType dictType : dictTypeList) |
|
|
|
dictData.setStatus("0"); |
|
|
|
{ |
|
|
|
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType)); |
|
|
|
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); |
|
|
|
for (Map.Entry<String, List<SysDictData>> entry: dictDataMap.entrySet()) { |
|
|
|
DictUtils.setDictCache(dictType.getDictType(), dictDatas); |
|
|
|
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|