组织修改
This commit is contained in:
@@ -32,6 +32,4 @@ public class OrgVo implements TreeNode<OrgVo> {
|
|||||||
private List<StandardCategory> standardCategorys;
|
private List<StandardCategory> standardCategorys;
|
||||||
|
|
||||||
private List<OrgVo> children;
|
private List<OrgVo> children;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,11 @@ public class PermissionVo implements TreeNode<PermissionVo> {
|
|||||||
*/
|
*/
|
||||||
private Integer isDeleted;
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限范围
|
||||||
|
*/
|
||||||
|
private Integer dataScopeType;
|
||||||
|
|
||||||
private List<PermissionVo> children;
|
private List<PermissionVo> children;
|
||||||
|
|
||||||
public static PermissionVo toVo(Permission permission){
|
public static PermissionVo toVo(Permission permission){
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ public class OrgServiceImpl extends ServiceImpl<OrgMapper, Org>
|
|||||||
if(queryDto.getId() == null){
|
if(queryDto.getId() == null){
|
||||||
return ResponseResult.error("参数缺失");
|
return ResponseResult.error("参数缺失");
|
||||||
}
|
}
|
||||||
OrgQueryDto queryDto1 = new OrgQueryDto();
|
|
||||||
List<OrgVo> list = baseMapper.getListAll();
|
List<OrgVo> list = baseMapper.getListAll();
|
||||||
for (OrgVo orgVo : list){
|
for (OrgVo orgVo : list){
|
||||||
List<StandardCategory> standardCategorys = standardCategoryMapper.selectListByOrgId(orgVo.getId());
|
List<StandardCategory> standardCategorys = standardCategoryMapper.selectListByOrgId(orgVo.getId());
|
||||||
|
|||||||
@@ -54,8 +54,30 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|||||||
//Page<Permission> page = this.page(permissionDto.getPage(), queryWrapper);
|
//Page<Permission> page = this.page(permissionDto.getPage(), queryWrapper);
|
||||||
|
|
||||||
List<Permission> permissionList = baseMapper.getList(permissionDto);
|
List<Permission> permissionList = baseMapper.getList(permissionDto);
|
||||||
|
List<PermissionVo> permissionVoList;
|
||||||
|
if(permissionDto.getRoleId() != null){
|
||||||
|
permissionVoList = permissionList.stream()
|
||||||
|
.map(PermissionVo::toVo)
|
||||||
|
.map(p -> {
|
||||||
|
// 1. 获取查询结果对象
|
||||||
|
RolePermission rp = rolePermissionService.getOne(
|
||||||
|
new LambdaQueryWrapper<RolePermission>()
|
||||||
|
.eq(RolePermission::getPermissionId, p.getId())
|
||||||
|
.eq(RolePermission::getRoleId, permissionDto.getRoleId())
|
||||||
|
);
|
||||||
|
if (rp != null) {
|
||||||
|
p.setDataScopeType(rp.getDataScopeType());
|
||||||
|
} else {
|
||||||
|
p.setDataScopeType(2);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
permissionVoList = permissionList.stream().map(PermissionVo::toVo).toList();
|
||||||
|
}
|
||||||
|
|
||||||
List<PermissionVo> permissionVoList = permissionList.stream().map(PermissionVo::toVo).toList();
|
|
||||||
|
|
||||||
List<PermissionVo> root = TreeUtil.buildTree(permissionVoList, 1L);
|
List<PermissionVo> root = TreeUtil.buildTree(permissionVoList, 1L);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user