疯狂的狮子li
2021-05-10 961c60dd1a546969359b717c289f7cf21d083670
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -32,8 +32,6 @@
 */
@Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService {
    @Autowired
    private SysDeptMapper deptMapper;
    @Autowired
    private SysRoleMapper roleMapper;
@@ -50,15 +48,7 @@
    @Override
    @DataScope(deptAlias = "d")
    public List<SysDept> selectDeptList(SysDept dept) {
        Object dataScope = dept.getParams().get("dataScope");
        return list(new LambdaQueryWrapper<SysDept>()
                .eq(dept.getParentId() != null && dept.getParentId() != 0,
                        SysDept::getParentId, dept.getParentId())
                .like(StrUtil.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName())
                .eq(StrUtil.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus())
                .apply(dataScope != null, dataScope != null ? dataScope.toString() : null)
                .orderByAsc(SysDept::getParentId)
                .orderByAsc(SysDept::getOrderNum));
        return baseMapper.selectDeptList(dept);
    }
    /**
@@ -108,8 +98,8 @@
     */
    @Override
    public List<Integer> selectDeptListByRoleId(Long roleId) {
        SysRole role = roleMapper.selectRoleById(roleId);
        return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
        SysRole role = roleMapper.selectById(roleId);
        return baseMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
    }
    /**