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

The following examples show how to use com.ruoyi.system.domain.SysRole#getDeptIds() . 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
/**
 * 新增角色部门信息(数据权限)
 *
 * @param role 角色对象
 */
public int insertRoleDept(SysRole role)
{
    int rows = 1;
    // 新增角色与部门(数据权限)管理
    List<SysRoleDept> list = new ArrayList<SysRoleDept>();
    for (Long deptId : role.getDeptIds())
    {
        SysRoleDept rd = new SysRoleDept();
        rd.setRoleId(role.getRoleId());
        rd.setDeptId(deptId);
        list.add(rd);
    }
    if (list.size() > 0)
    {
        rows = roleDeptMapper.batchRoleDept(list);
    }
    return rows;
}
 
Example 2
Source File: SysRoleServiceImpl.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 新增角色部门信息(数据权限)
 *
 * @param role 角色对象
 */
public int insertRoleDept(SysRole role)
{
    int rows = 1;
    // 新增角色与部门(数据权限)管理
    List<SysRoleDept> list = new ArrayList<SysRoleDept>();
    for (Long deptId : role.getDeptIds())
    {
        SysRoleDept rd = new SysRoleDept();
        rd.setRoleId(role.getRoleId());
        rd.setDeptId(deptId);
        list.add(rd);
    }
    if (list.size() > 0)
    {
        rows = roleDeptMapper.batchRoleDept(list);
    }
    return rows;
}
 
Example 3
Source File: SysRoleServiceImpl.java    From RuoYi with Apache License 2.0 6 votes vote down vote up
/**
 * 新增角色部门信息(数据权限)
 *
 * @param role 角色对象
 */
private int insertRoleDept(SysRole role) {
    int rows = 1;
    // 新增角色与部门(数据权限)管理
    List<SysRoleDept> list = new ArrayList<>();
    for (Long deptId : role.getDeptIds()) {
        SysRoleDept rd = new SysRoleDept();
        rd.setRoleId(role.getRoleId());
        rd.setDeptId(deptId);
        list.add(rd);
    }
    if (!CollectionUtils.isEmpty(list)) {
        rows = roleDeptMapper.batchRoleDept(list);
    }
    return rows;
}