jiangqs
2023-06-21 4780a3ac4a163ea0181d395488042ec443403f62
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
@@ -47,6 +47,28 @@
    }
    /**
     * @description 通过权限获取部门员工列表
     * @author  jqs
     * @date    2023/6/21 10:24
     * @param userId
     * @return  List<MgtDeptStaffListVo>
     */
    @Override
    public List<MgtDeptStaffListVo>listMgtDeptStaffByPermission(Long userId){
        SysUser sysUser = sysUserService.getById(userId);
        String dataScope = sysUser.getDataScope();
        List<MgtDeptStaffListVo> deptStaffListVoList;
        if(dataScope.equals("4")){
            deptStaffListVoList = sysStaffMapper.listMgtDeptStaffByDept(sysUser.getDeptId(),null);
        }else if(dataScope.equals("5")){
            deptStaffListVoList = sysStaffMapper.listMgtDeptStaffByDept(sysUser.getDeptId(),sysUser.getUserId());
        }else{
            deptStaffListVoList = sysStaffMapper.listMgtDeptStaff();
        }
        return deptStaffListVoList;
    }
    /**
     * @description getBYUserId
     * @param userId
     * @return SysStaff