|
|
@@ -39,6 +39,7 @@ import vip.xiaonuo.disk.mapper.CollegeMapper;
|
|
|
import vip.xiaonuo.disk.param.*;
|
|
|
import vip.xiaonuo.disk.service.CollegeService;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -85,6 +86,29 @@ public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> impl
|
|
|
return TreeUtil.build(treeNodeList, "0");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Tree<String>> treeAll() {
|
|
|
+ List<College> collegeList = this.getAllOrgList();
|
|
|
+ List<TreeNode<String>> treeNodeList = collegeList.stream().map(college ->
|
|
|
+ new TreeNode<>(college.getId(), college.getParentId(),
|
|
|
+ college.getName(), college.getSortCode()).setExtra(JSONUtil.parseObj(college)))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<Tree<String>> list= TreeUtil.build(treeNodeList, "0");
|
|
|
+ Tree<String> tree=new Tree<String>();
|
|
|
+ tree.setName("全部");
|
|
|
+ Tree<String> child=new Tree<String>();
|
|
|
+ child.setName("全部");
|
|
|
+ List<Tree<String>> childList=new ArrayList<>();
|
|
|
+ childList.add(child);
|
|
|
+ tree.setChildren(childList);
|
|
|
+ list.add(0,tree);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void add(CollegeAddParam collegeAddParam) {
|