|
|
|
@ -290,8 +290,13 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public int deleteRoleById(Long roleId)
|
|
|
|
|
{
|
|
|
|
|
// 删除角色与菜单关联
|
|
|
|
|
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
|
|
|
|
|
// 删除角色与部门关联
|
|
|
|
|
roleDeptMapper.deleteRoleDeptByRoleId(roleId);
|
|
|
|
|
return roleMapper.deleteRoleById(roleId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -302,6 +307,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public int deleteRoleByIds(Long[] roleIds)
|
|
|
|
|
{
|
|
|
|
|
for (Long roleId : roleIds)
|
|
|
|
@ -313,6 +319,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|
|
|
|
throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 删除角色与菜单关联
|
|
|
|
|
roleMenuMapper.deleteRoleMenu(roleIds);
|
|
|
|
|
// 删除角色与部门关联
|
|
|
|
|
roleDeptMapper.deleteRoleDept(roleIds);
|
|
|
|
|
return roleMapper.deleteRoleByIds(roleIds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|