|
|
@ -283,6 +283,9 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int updateRoleStatus(Long roleId, String status) {
|
|
|
|
public int updateRoleStatus(Long roleId, String status) {
|
|
|
|
|
|
|
|
if (UserConstants.ROLE_DISABLE.equals(status) && this.countUserRoleByRoleId(roleId) > 0) {
|
|
|
|
|
|
|
|
throw new ServiceException("角色已分配,不能禁用!");
|
|
|
|
|
|
|
|
}
|
|
|
|
return baseMapper.update(null,
|
|
|
|
return baseMapper.update(null,
|
|
|
|
new LambdaUpdateWrapper<SysRole>()
|
|
|
|
new LambdaUpdateWrapper<SysRole>()
|
|
|
|
.set(SysRole::getStatus, status)
|
|
|
|
.set(SysRole::getStatus, status)
|
|
|
@ -379,7 +382,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|
|
|
checkRoleAllowed(BeanUtil.toBean(role, SysRoleBo.class));
|
|
|
|
checkRoleAllowed(BeanUtil.toBean(role, SysRoleBo.class));
|
|
|
|
checkRoleDataScope(roleId);
|
|
|
|
checkRoleDataScope(roleId);
|
|
|
|
if (countUserRoleByRoleId(roleId) > 0) {
|
|
|
|
if (countUserRoleByRoleId(roleId) > 0) {
|
|
|
|
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
|
|
|
throw new ServiceException(String.format("%1$s已分配,不能删除!", role.getRoleName()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<Long> ids = Arrays.asList(roleIds);
|
|
|
|
List<Long> ids = Arrays.asList(roleIds);
|
|
|
|