@Override
    public List<DeptTreeVO> getDeptTree(Integer excludeNodeId, Boolean appendRoot, Boolean needSetTotal) {
        QueryWrapper wrapper = QueryWrapper.create()
                // .orderBy(SysDept::getDeep).asc()
                .orderBy(SysDept::getSort).asc();
        // 获取所有部门信息
        List<SysDept> list = list(wrapper);
        List<DeptTreeVO> deptTreeVOS = BeanCopyUtils.copyList(list, DeptTreeVO.class);
        if (needSetTotal) {
            setUseTotal(deptTreeVOS);
        }
        DeptTreeVO root = TreeUtils.getRoot(DeptTreeVO.class);
        root.setName("根部门");
        List<DeptTreeVO> trees = TreeUtils.buildTree(deptTreeVOS, root, excludeNodeId);
        if (appendRoot != null && !appendRoot) {
            if (trees.get(0).getChildren() == null) {
                trees = new ArrayList<>();
            } else {
                trees = trees.get(0).getChildren();
            }
        }
        return trees;
    }
@Test
    void getDeepTreeVOS() {
        List<DeptTreeVO> tree = sysDeptService.getDeptTree(null, true, false);
        System.out.println("树形:" + JsonUtils.toJsonString(tree));
    }