aijinhui
2023-10-19 1f19fc38b37ed1aa96802702ca406ab740a8aa6c
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -4,6 +4,7 @@
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;
@@ -366,9 +367,10 @@
    }
    @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
@@ -395,13 +397,15 @@
    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);
                }
            }
        }
    }