|
|
|
|
|
|
|
|
queryWrapper.eq("mark", MarkEnum.VALID.getCode()); |
|
|
queryWrapper.eq("mark", MarkEnum.VALID.getCode()); |
|
|
//queryWrapper.orderByAsc("sort"); |
|
|
//queryWrapper.orderByAsc("sort"); |
|
|
queryWrapper.orderByAsc("create_time"); |
|
|
queryWrapper.orderByAsc("create_time"); |
|
|
queryWrapper.ne("id", "1"); |
|
|
|
|
|
|
|
|
//queryWrapper.ne("id", "1"); |
|
|
// 查询分页数据 |
|
|
// 查询分页数据 |
|
|
IPage<Role> pageData = roleMapper.selectPage(page, queryWrapper); |
|
|
IPage<Role> pageData = roleMapper.selectPage(page, queryWrapper); |
|
|
pageData.convert(x -> { |
|
|
pageData.convert(x -> { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public JsonResult getRoles() { |
|
|
public JsonResult getRoles() { |
|
|
|
|
|
|
|
|
|
|
|
//超管 |
|
|
|
|
|
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getUsername, "superAdmin").eq(User::getMark, 1)); |
|
|
|
|
|
if (StringUtils.isNull(user)) { |
|
|
|
|
|
List<Role> roles = roleMapper.selectList(Wrappers.<Role>lambdaQuery() |
|
|
|
|
|
.eq(Role::getCode, "superAdmin") |
|
|
|
|
|
.eq(Role::getMark, 1) |
|
|
|
|
|
.eq(Role::getStatus, 1)); |
|
|
|
|
|
return JsonResult.success(roles); |
|
|
|
|
|
} |
|
|
|
|
|
//对应的租户角色 |
|
|
List<Role> roles = roleMapper.selectList(Wrappers.<Role>lambdaQuery() |
|
|
List<Role> roles = roleMapper.selectList(Wrappers.<Role>lambdaQuery() |
|
|
.eq(Role::getMark, MarkEnum.VALID.getCode()).eq(Role::getStatus, 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.eq(Role::getTenantId, user.getTenantId()) |
|
|
|
|
|
.eq(Role::getMark, 1) |
|
|
|
|
|
.eq(Role::getStatus, 1)); |
|
|
return JsonResult.success(roles); |
|
|
return JsonResult.success(roles); |
|
|
} |
|
|
} |
|
|
|
|
|
|