| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.MapstructUtils; |
| | | import com.ruoyi.common.core.utils.StreamUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertRole(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | SysRole role = MapstructUtils.convert(bo, SysRole.class); |
| | | // 新增角色信息 |
| | | baseMapper.insert(role); |
| | | bo.setRoleId(role.getRoleId()); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateRole(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | SysRole role = MapstructUtils.convert(bo, SysRole.class); |
| | | // 修改角色信息 |
| | | baseMapper.updateById(role); |
| | | // 删除角色与菜单关联 |
| | |
| | | */ |
| | | @Override |
| | | public int updateRoleStatus(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | SysRole role = MapstructUtils.convert(bo, SysRole.class); |
| | | return baseMapper.updateById(role); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int authDataScope(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | SysRole role = MapstructUtils.convert(bo, SysRole.class); |
| | | // 修改角色信息 |
| | | baseMapper.updateById(role); |
| | | // 删除角色与部门关联 |