|
@@ -1,13 +1,19 @@
|
|
|
package com.hdkj.lt.core.sys.service.impl;
|
|
package com.hdkj.lt.core.sys.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.hdkj.lt.core.sys.dao.SysDictMapper;
|
|
|
|
|
+import com.hdkj.lt.core.sys.model.po.DicSingle;
|
|
|
import com.hdkj.lt.core.sys.model.vo.DicLevelTreeVo;
|
|
import com.hdkj.lt.core.sys.model.vo.DicLevelTreeVo;
|
|
|
import com.hdkj.lt.core.sys.model.vo.DicVo;
|
|
import com.hdkj.lt.core.sys.model.vo.DicVo;
|
|
|
import com.hdkj.lt.core.sys.model.vo.DictVo;
|
|
import com.hdkj.lt.core.sys.model.vo.DictVo;
|
|
|
import com.hdkj.lt.core.sys.service.ISysDicRefService;
|
|
import com.hdkj.lt.core.sys.service.ISysDicRefService;
|
|
|
|
|
+import com.ruoyi.system.api.domain.SysDictData;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author rj
|
|
* @author rj
|
|
@@ -15,7 +21,12 @@ import java.util.List;
|
|
|
* @description
|
|
* @description
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
public class SysDicRefServiceImpl implements ISysDicRefService {
|
|
public class SysDicRefServiceImpl implements ISysDicRefService {
|
|
|
|
|
+
|
|
|
|
|
+ private final SysDictMapper sysDictMapper;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//todo: 需要重写
|
|
//todo: 需要重写
|
|
|
@Override
|
|
@Override
|
|
|
public List<DicVo> getDicListByType(String typeName) {
|
|
public List<DicVo> getDicListByType(String typeName) {
|
|
@@ -24,7 +35,25 @@ public class SysDicRefServiceImpl implements ISysDicRefService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<DictVo> getDictVosByTypeNames(List<String> typeNames) {
|
|
public List<DictVo> getDictVosByTypeNames(List<String> typeNames) {
|
|
|
- return new ArrayList<>();
|
|
|
|
|
|
|
+ List<SysDictData> listByTypeName = sysDictMapper.getListByTypeName(typeNames);
|
|
|
|
|
+ List<DicSingle> dicSingles = new ArrayList<>();
|
|
|
|
|
+ listByTypeName.forEach(i -> {
|
|
|
|
|
+ DicSingle dicSingle = new DicSingle();
|
|
|
|
|
+ dicSingle.setTypeName(i.getDictType());
|
|
|
|
|
+ dicSingle.setValue(i.getDictValue());
|
|
|
|
|
+ dicSingle.setLabel(i.getDictLabel());
|
|
|
|
|
+ dicSingle.setSort(i.getDictSort().intValue());
|
|
|
|
|
+ dicSingles.add(dicSingle);
|
|
|
|
|
+ });
|
|
|
|
|
+ Map<String, List<DicSingle>> collect = dicSingles.stream().collect(Collectors.groupingBy(DicSingle::getTypeName));
|
|
|
|
|
+ List<DictVo> dictVoList = new ArrayList<>();
|
|
|
|
|
+ for (String key : collect.keySet()) {
|
|
|
|
|
+ DictVo dictVo = new DictVo();
|
|
|
|
|
+ dictVo.setTypeName(key);
|
|
|
|
|
+ dictVo.setSingleList(collect.get(key));
|
|
|
|
|
+ dictVoList.add(dictVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ return dictVoList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|