疯狂的狮子li
2022-12-07 06cda3fb18a3241deff404f6948b02cc0d9a75a5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -59,6 +59,18 @@
    }
    /**
     * 查询部门树结构信息
     *
     * @param dept 部门信息
     * @return 部门树信息集合
     */
    @Override
    public List<Tree<Long>> selectDeptTreeList(SysDept dept) {
        List<SysDept> depts = this.selectDeptList(dept);
        return buildDeptTreeSelect(depts);
    }
    /**
     * 构建前端所需要下拉树结构
     *
     * @param depts 部门列表
@@ -85,7 +97,7 @@
    @Override
    public List<Long> selectDeptListByRoleId(Long roleId) {
        SysRole role = roleMapper.selectById(roleId);
        return baseMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
        return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly());
    }
    /**
@@ -96,7 +108,11 @@
     */
    @Override
    public SysDept selectDeptById(Long deptId) {
        return baseMapper.selectById(deptId);
        SysDept dept = baseMapper.selectById(deptId);
        SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper<SysDept>()
            .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId()));
        dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null);
        return dept;
    }
    /**