修复权限与权限集对应关系错误问题
This commit is contained in:
parent
e756f65631
commit
b42e6fb0ba
@ -100,16 +100,7 @@ public class PermissionGroupImpl implements PermissionGroupService {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Long> groupIds = groupList.stream().map(BaseEntity::getId).collect(Collectors.toList());
|
||||
// 查询权限集关联的权限
|
||||
List<SaasPgroupPermissionRelation> permissionList = permissionRelationDao.lambdaQuery()
|
||||
.in(SaasPgroupPermissionRelation::getGroupId, groupIds)
|
||||
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.list();
|
||||
List<PermissionPointTreeNode> feature = null;
|
||||
if (CollectionUtils.isNotEmpty(permissionList)) {
|
||||
// 查询featureCode
|
||||
feature = featureService.listNodesByIds(permissionList.stream().map(SaasPgroupPermissionRelation::getFeatureId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
List<SaasPermissionGroupScope> saasPermissionGroupScopesSource = saasPermissionGroupScopeDao.lambdaQuery()
|
||||
.in(SaasPermissionGroupScope::getPgroupId, groupIds)
|
||||
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
@ -132,18 +123,28 @@ public class PermissionGroupImpl implements PermissionGroupService {
|
||||
return true;
|
||||
}).collect(Collectors.toList());
|
||||
// 组装填充字段
|
||||
List<PermissionPointTreeNode> finalFeature = feature;
|
||||
return groupList.stream().map(group ->
|
||||
SaasPermissionGroupVO.builder()
|
||||
.id(group.getId())
|
||||
.name(group.getName())
|
||||
.feature(finalFeature)
|
||||
.scopes(saasPermissionGroupScopes.stream().filter(e -> e.getPgroupId().equals(group.getId())).map(e -> BeanMapper.copyBean(e, SaasRolePermissionScopeVO.class)).collect(Collectors.toList()))
|
||||
.createBy(group.getCreateBy())
|
||||
.updateBy(group.getUpdateBy())
|
||||
.type(group.getType())
|
||||
.isCommon(group.getIsCommon())
|
||||
.build()
|
||||
return groupList.stream().map(group -> {
|
||||
// 查询权限集关联的权限
|
||||
List<SaasPgroupPermissionRelation> permissionList = permissionRelationDao.lambdaQuery()
|
||||
.eq(SaasPgroupPermissionRelation::getGroupId, group.getId())
|
||||
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.list();
|
||||
List<PermissionPointTreeNode> feature = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(permissionList)) {
|
||||
// 查询featureCode
|
||||
feature = featureService.listNodesByIds(permissionList.stream().map(SaasPgroupPermissionRelation::getFeatureId).collect(Collectors.toList()));
|
||||
}
|
||||
return SaasPermissionGroupVO.builder()
|
||||
.id(group.getId())
|
||||
.name(group.getName())
|
||||
.feature(feature)
|
||||
.scopes(saasPermissionGroupScopes.stream().filter(e -> e.getPgroupId().equals(group.getId())).map(e -> BeanMapper.copyBean(e, SaasRolePermissionScopeVO.class)).collect(Collectors.toList()))
|
||||
.createBy(group.getCreateBy())
|
||||
.updateBy(group.getUpdateBy())
|
||||
.type(group.getType())
|
||||
.isCommon(group.getIsCommon())
|
||||
.build();
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user