| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.HealthVo; |
| | | import com.ruoyi.common.core.domain.TreeDeptWell; |
| | | import com.ruoyi.common.core.domain.TreeSelectWell; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TreeSelectWell> wellTree(List<TreeDeptWell> depts) { |
| | | public List<TreeDeptWell> wellTree(List<TreeDeptWell> depts) { |
| | | List<TreeDeptWell> deptTrees = buildDeptWellTree(depts); |
| | | return deptTrees.stream().map(TreeSelectWell::new).collect(Collectors.toList()); |
| | | return deptTrees; |
| | | // return deptTrees.stream().map(TreeSelectWell::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | private void recursionFnWell(List<TreeDeptWell> list, TreeDeptWell t) |
| | | { |
| | | // 得到子节点列表 |
| | | List<TreeDeptWell> childList = getChildListWell(list, t); |
| | | t.setChildren(childList); |
| | | for (TreeDeptWell tChild : childList) |
| | | { |
| | | if (hasChildWell(list, tChild)) |
| | | if(t.getId() == null){ |
| | | List<TreeDeptWell> childList = getChildListWell(list, t); |
| | | t.setChildren(childList); |
| | | for (TreeDeptWell tChild : childList) |
| | | { |
| | | recursionFnWell(list, tChild); |
| | | if (hasChildWell(list, tChild)) |
| | | { |
| | | recursionFnWell(list, tChild); |
| | | } |
| | | } |
| | | } |
| | | } |