|
@@ -75,20 +75,28 @@ public class SysDeptJlServiceImpl implements ISysDeptJlService {
|
|
|
|
|
|
@Override
|
|
|
public List<Tree> getChildListByMchnt(SysDeptJl sysDeptJl) {
|
|
|
- List<SysDeptJl> deptJlList = new ArrayList<>();
|
|
|
+ List<Tree> res = new ArrayList<>();
|
|
|
String codes = sysDeptJlMapper.getChildByMchnt(sysDeptJl.getMchnt());
|
|
|
if (StringUtils.isNotEmpty(codes)) {
|
|
|
+ List<SysDeptJl> deptJlList = new ArrayList<>();
|
|
|
+ List<SysDeptJl> parentList = new ArrayList<>();
|
|
|
List<String> codeList = Stream.of(codes.split(",")).collect(Collectors.toList());
|
|
|
- codeList.forEach(c -> deptJlList.add(sysDeptJlMapper.selectSysDeptJlByCode(c + "000000")));
|
|
|
+ codeList.forEach(c -> {
|
|
|
+ sysDeptJl.setCode(c);
|
|
|
+ deptJlList.addAll(sysDeptJlMapper.getChildListByCode(sysDeptJl));
|
|
|
+ parentList.add(sysDeptJlMapper.selectSysDeptJlByCode(c + "000000"));
|
|
|
+ });
|
|
|
+ res = parentList.stream().map(m -> {
|
|
|
+ Tree tree = new Tree();
|
|
|
+ tree.setId(m.getId());
|
|
|
+ tree.setParentId(m.getParentId());
|
|
|
+ tree.setCode(m.getCode());
|
|
|
+ tree.setLabel(m.getName());
|
|
|
+ return tree;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ rscTree(res, deptJlList);
|
|
|
}
|
|
|
- return deptJlList.stream().map(m -> {
|
|
|
- Tree tree = new Tree();
|
|
|
- tree.setId(m.getId());
|
|
|
- tree.setParentId(m.getParentId());
|
|
|
- tree.setCode(m.getCode());
|
|
|
- tree.setLabel(m.getName());
|
|
|
- return tree;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
private void rscTree(List<Tree> res, List<SysDeptJl> deptJlList) {
|