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

The following examples show how to use com.ruoyi.system.domain.SysRole#setFlag() . 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: SysRoleServiceImpl.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 根据用户ID查询角色
 * 
 * @param userId 用户ID
 * @return 角色列表
 */
@Override
public List<SysRole> selectRolesByUserId(Long userId)
{
    List<SysRole> userRoles = roleMapper.selectRolesByUserId(userId);
    List<SysRole> roles = selectRoleAll();
    for (SysRole role : roles)
    {
        for (SysRole userRole : userRoles)
        {
            if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
            {
                role.setFlag(true);
                break;
            }
        }
    }
    return roles;
}
 
Example 2
Source File: SysRoleServiceImpl.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 根据用户ID查询角色
 * 
 * @param userId 用户ID
 * @return 角色列表
 */
@Override
public List<SysRole> selectRolesByUserId(Long userId)
{
    List<SysRole> userRoles = roleMapper.selectRolesByUserId(userId);
    List<SysRole> roles = selectRoleAll();
    for (SysRole role : roles)
    {
        for (SysRole userRole : userRoles)
        {
            if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
            {
                role.setFlag(true);
                break;
            }
        }
    }
    return roles;
}
 
Example 3
Source File: SysRoleServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 根据用户ID查询角色
 *
 * @param userId 用户ID
 * @return 角色列表
 */
@Override
public List<SysRole> selectRolesByUserId(Long userId) {
    List<SysRole> userRoles = roleMapper.selectRolesByUserId(userId);
    List<SysRole> roles = selectRoleAll();
    for (SysRole role : roles) {
        for (SysRole userRole : userRoles) {
            if (role.getRoleId().equals(userRole.getRoleId())) {
                role.setFlag(true);
                break;
            }
        }
    }
    return roles;
}