实现接口:isSuperAdmin
This commit is contained in:
parent
9907742993
commit
572bdcfc49
@ -3,6 +3,7 @@ package cn.axzo.tyr.server.service.impl;
|
||||
import cn.axzo.basics.common.constant.enums.TableIsDeleteEnum;
|
||||
import cn.axzo.basics.common.exception.ServiceException;
|
||||
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
|
||||
import cn.axzo.tyr.client.model.enums.PermissionGroupType;
|
||||
import cn.axzo.tyr.client.model.req.QueryByIdentityIdTypeReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasPermissionGroupReq;
|
||||
@ -249,13 +250,21 @@ public class RoleServiceImpl implements RoleService {
|
||||
public List<IsSuperAdminRes> isSuperAdmin(List<QueryByIdentityIdTypeReq> req) {
|
||||
List<IsSuperAdminRes> result = new ArrayList<>();
|
||||
req.forEach(e -> {
|
||||
// result.add(QueryBatchByIdentityIdTypeRes.builder()
|
||||
// .identityId(e.getIdentityId())
|
||||
// .identityType(e.getIdentityType())
|
||||
// .workspaceId(e.getWorkspaceId())
|
||||
// .ouId(e.getOuId())
|
||||
// .role(queryByIdentityIdType(e.getIdentityId(),e.getIdentityType(),e.getWorkspaceId(),e.getOuId()))
|
||||
// .build());
|
||||
List<Long> roleIds = roleUserRelationDao.query(e.getIdentityId(), e.getIdentityType(), e.getWorkspaceId(), e.getOuId()).stream().map(SaasRoleUserRelation::getRoleId).collect(Collectors.toList());
|
||||
List<SaasRole> list = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(roleIds)) {
|
||||
list = saasRoleDao.lambdaQuery()
|
||||
.in(BaseEntity::getId, roleIds)
|
||||
.eq(SaasRole::getRoleType, RoleTypeEnum.SUPER_ADMIN.getValue())
|
||||
.list();
|
||||
}
|
||||
result.add(IsSuperAdminRes.builder()
|
||||
.identityId(e.getIdentityId())
|
||||
.identityType(e.getIdentityType())
|
||||
.workspaceId(e.getWorkspaceId())
|
||||
.ouId(e.getOuId())
|
||||
.isSuperAdmin(CollectionUtils.isNotEmpty(list)?true:false)
|
||||
.build());
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user