use of com.megagao.production.ssm.domain.authority.SysRolePermission in project production_ssm by megagao.
the class PermissionServiceImpl method updateByRoleId.
@Override
public CustomResult updateByRoleId(String roleId, String permission) throws Exception {
SysRolePermission sysRolePermission = new SysRolePermission();
sysRolePermission.setSysPermissionId(permission);
sysRolePermission.setSysRoleId(roleId);
// 修改角色权限表
int i = sysRolePermissionMapper.updateRolePermission(sysRolePermission);
if (i > 0) {
return CustomResult.ok();
} else {
return null;
}
}
use of com.megagao.production.ssm.domain.authority.SysRolePermission in project production_ssm by megagao.
the class PermissionServiceImpl method getList.
@Override
public EUDataGridResult getList(int page, int rows, SysRolePermission sysRolePermission) throws Exception {
// 查询列表
SysRolePermissionExample example = new SysRolePermissionExample();
// 分页处理
PageHelper.startPage(page, rows);
List<SysRolePermission> list = sysRolePermissionMapper.selectByExample(example);
// 创建一个返回值对象
EUDataGridResult result = new EUDataGridResult();
result.setRows(list);
// 取记录总条数
PageInfo<SysRolePermission> pageInfo = new PageInfo<>(list);
result.setTotal(pageInfo.getTotal());
return result;
}
use of com.megagao.production.ssm.domain.authority.SysRolePermission in project production_ssm by megagao.
the class RoleServiceImpl method updateAll.
@Override
public CustomResult updateAll(SysRole role) throws Exception {
// 在业务层整合处理
SysRolePermission sysRolePermission = new SysRolePermission();
sysRolePermission.setSysRoleId(role.getRoleId());
sysRolePermission.setSysPermissionId(role.getPermission());
// 修改角色权限表
int k = sysRolePermissionMapper.updateRolePermission(sysRolePermission);
int i = sysRoleMapper.updateByPrimaryKey(role);
if (i > 0 && k > 0) {
return CustomResult.ok();
} else {
return CustomResult.build(101, "修改角色信息失败");
}
}
use of com.megagao.production.ssm.domain.authority.SysRolePermission in project production_ssm by megagao.
the class RoleServiceImpl method insert.
@Override
public CustomResult insert(SysRole role) throws Exception {
// 在业务层整合
SysRolePermission sysRolePermission = new SysRolePermission();
sysRolePermission.setId(IDUtils.genStringId());
sysRolePermission.setSysRoleId(role.getRoleId());
sysRolePermission.setSysPermissionId(role.getPermission());
// 存角色权限表
int k = sysRolePermissionMapper.insertSelective(sysRolePermission);
int i = sysRoleMapper.insert(role);
if (i > 0 && k > 0) {
return CustomResult.ok();
} else {
return CustomResult.build(101, "新增角色信息失败");
}
}
Aggregations