Search in sources :

Example 1 with DictModelMany

use of org.jeecg.common.system.vo.DictModelMany in project jeecg-boot by jeecgboot.

the class SysDictServiceImpl method queryDictItemsByCodeList.

@Override
public Map<String, List<DictModel>> queryDictItemsByCodeList(List<String> dictCodeList) {
    List<DictModelMany> list = sysDictMapper.queryDictItemsByCodeList(dictCodeList);
    Map<String, List<DictModel>> dictMap = new HashMap<>();
    for (DictModelMany dict : list) {
        List<DictModel> dictItemList = dictMap.computeIfAbsent(dict.getDictCode(), i -> new ArrayList<>());
        dict.setDictCode(null);
        dictItemList.add(new DictModel(dict.getValue(), dict.getText()));
    }
    return dictMap;
}
Also used : HashMap(java.util.HashMap) DictModel(org.jeecg.common.system.vo.DictModel) ArrayList(java.util.ArrayList) List(java.util.List) DictModelMany(org.jeecg.common.system.vo.DictModelMany)

Example 2 with DictModelMany

use of org.jeecg.common.system.vo.DictModelMany in project jeecg-boot by jeecgboot.

the class SysDictServiceImpl method queryManyDictByKeys.

@Override
public Map<String, List<DictModel>> queryManyDictByKeys(List<String> dictCodeList, List<String> keys) {
    List<DictModelMany> list = sysDictMapper.queryManyDictByKeys(dictCodeList, keys);
    Map<String, List<DictModel>> dictMap = new HashMap<>();
    for (DictModelMany dict : list) {
        List<DictModel> dictItemList = dictMap.computeIfAbsent(dict.getDictCode(), i -> new ArrayList<>());
        dictItemList.add(new DictModel(dict.getValue(), dict.getText()));
    }
    return dictMap;
}
Also used : HashMap(java.util.HashMap) DictModel(org.jeecg.common.system.vo.DictModel) ArrayList(java.util.ArrayList) List(java.util.List) DictModelMany(org.jeecg.common.system.vo.DictModelMany)

Aggregations

ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 DictModel (org.jeecg.common.system.vo.DictModel)2 DictModelMany (org.jeecg.common.system.vo.DictModelMany)2