Java Code Examples for com.ruoyi.system.domain.SysRole#getRoleId()

The following examples show how to use com.ruoyi.system.domain.SysRole#getRoleId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysDeptServiceImpl.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 根据角色ID查询部门(数据权限)
 *
 * @param role 角色对象
 * @return 部门列表(数据权限)
 */
@Override
public List<Ztree> roleDeptTreeData(SysRole role)
{
    Long roleId = role.getRoleId();
    List<Ztree> ztrees = new ArrayList<Ztree>();
    List<SysDept> deptList = selectDeptList(new SysDept());
    if (StringUtils.isNotNull(roleId))
    {
        List<String> roleDeptList = deptMapper.selectRoleDeptTree(roleId);
        ztrees = initZtree(deptList, roleDeptList);
    }
    else
    {
        ztrees = initZtree(deptList);
    }
    return ztrees;
}
 
Example 2
Source File: SysMenuServiceImpl.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 根据角色ID查询菜单
 * 
 * @param role 角色对象
 * @return 菜单列表
 */
@Override
public List<Ztree> roleMenuTreeData(SysRole role, Long userId)
{
    Long roleId = role.getRoleId();
    List<Ztree> ztrees = new ArrayList<Ztree>();
    List<SysMenu> menuList = selectMenuAll(userId);
    if (StringUtils.isNotNull(roleId))
    {
        List<String> roleMenuList = menuMapper.selectMenuTree(roleId);
        ztrees = initZtree(menuList, roleMenuList, true);
    }
    else
    {
        ztrees = initZtree(menuList, null, true);
    }
    return ztrees;
}
 
Example 3
Source File: SysDeptServiceImpl.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 根据角色ID查询部门(数据权限)
 *
 * @param role 角色对象
 * @return 部门列表(数据权限)
 */
@Override
public List<Map<String, Object>> roleDeptTreeData(SysRole role)
{
    Long roleId = role.getRoleId();
    List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
    List<SysDept> deptList = selectDeptList(new SysDept());
    if (StringUtils.isNotNull(roleId))
    {
        List<String> roleDeptList = deptMapper.selectRoleDeptTree(roleId);
        trees = getTrees(deptList, true, roleDeptList);
    }
    else
    {
        trees = getTrees(deptList, false, null);
    }
    return trees;
}
 
Example 4
Source File: SysMenuServiceImpl.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 根据角色ID查询菜单
 * 
 * @param role 角色对象
 * @return 菜单列表
 */
@Override
public List<Map<String, Object>> roleMenuTreeData(SysRole role)
{
    Long roleId = role.getRoleId();
    List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
    List<SysMenu> menuList = menuMapper.selectMenuAll();
    if (StringUtils.isNotNull(roleId))
    {
        List<String> roleMenuList = menuMapper.selectMenuTree(roleId);
        trees = getTrees(menuList, true, roleMenuList, true);
    }
    else
    {
        trees = getTrees(menuList, false, null, true);
    }
    return trees;
}
 
Example 5
Source File: SysRoleServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验角色名称是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleNameUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.ROLE_NAME_NOT_UNIQUE;
    }
    return UserConstants.ROLE_NAME_UNIQUE;
}
 
Example 6
Source File: SysRoleServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验角色权限是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleKeyUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.ROLE_KEY_NOT_UNIQUE;
    }
    return UserConstants.ROLE_KEY_UNIQUE;
}
 
Example 7
Source File: SysRoleServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验角色名称是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleNameUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.ROLE_NAME_NOT_UNIQUE;
    }
    return UserConstants.ROLE_NAME_UNIQUE;
}
 
Example 8
Source File: SysRoleServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验角色权限是否唯一
 * 
 * @param role 角色信息
 * @return 结果
 */
@Override
public String checkRoleKeyUnique(SysRole role)
{
    Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
    SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
    if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
    {
        return UserConstants.ROLE_KEY_NOT_UNIQUE;
    }
    return UserConstants.ROLE_KEY_UNIQUE;
}
 
Example 9
Source File: SysDeptServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 根据角色ID查询部门(数据权限)
 *
 * @param role 角色对象
 * @return 部门列表(数据权限)
 */
@Override
public List<Ztree> roleDeptTreeData(SysRole role) {
    Long roleId = role.getRoleId();
    List<Ztree> ztrees;
    List<SysDept> deptList = selectDeptList(new SysDept());
    if (ObjectUtil.isNotNull(roleId)) {
        List<String> roleDeptList = deptMapper.selectRoleDeptTree(roleId);
        ztrees = initZtree(deptList, roleDeptList);
    } else {
        ztrees = initZtree(deptList);
    }
    return ztrees;
}
 
Example 10
Source File: SysMenuServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 根据角色ID查询菜单
 *
 * @param role 角色对象
 * @param userId 用户ID
 * @return 菜单列表
 */
@Override
public List<Ztree> roleMenuTreeData(SysRole role, Long userId) {
    Long roleId = role.getRoleId();
    List<Ztree> ztrees;
    List<SysMenu> menuList = selectMenuAll(userId);
    if (ObjectUtil.isNotNull(roleId)) {
        List<String> roleMenuList = menuMapper.selectMenuTree(roleId);
        ztrees = initZtree(menuList, roleMenuList, true);
    } else {
        ztrees = initZtree(menuList, null, true);
    }
    return ztrees;
}