Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_freeway into develop

tags/V1.3.3
wanjing 1 year ago
parent
commit
8ce546c6ae
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/role/RoleServiceImpl.java

+ 14
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/role/RoleServiceImpl.java View File

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);
} }



Loading…
Cancel
Save