|
|
@@ -85,7 +85,7 @@ public class RoleServiceImpl implements IRoleService { |
|
|
|
queryWrapper.eq("mark", MarkEnum.VALID.getCode()); |
|
|
|
//queryWrapper.orderByAsc("sort"); |
|
|
|
queryWrapper.orderByAsc("create_time"); |
|
|
|
queryWrapper.ne("id", "1"); |
|
|
|
//queryWrapper.ne("id", "1"); |
|
|
|
// 查询分页数据 |
|
|
|
IPage<Role> pageData = roleMapper.selectPage(page, queryWrapper); |
|
|
|
pageData.convert(x -> { |
|
|
@@ -349,9 +349,20 @@ public class RoleServiceImpl implements IRoleService { |
|
|
|
@Override |
|
|
|
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() |
|
|
|
.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); |
|
|
|
} |
|
|
|
|