Commit 2693bc00 by huangjy

fix:空间列表新增orgId

parent 531d0d2f
...@@ -18,4 +18,6 @@ public class PlatSpaceQueryDTO { ...@@ -18,4 +18,6 @@ public class PlatSpaceQueryDTO {
@ApiModelProperty("长者ID") @ApiModelProperty("长者ID")
private String elderId; private String elderId;
@ApiModelProperty("组织机构id")
private String orgId;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils; import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import com.google.common.collect.Lists;
import com.makeit.common.dto.BaseIdDTO; import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.vo.ExcelErrorVo; import com.makeit.common.vo.ExcelErrorVo;
import com.makeit.common.vo.ExcelImportVo; import com.makeit.common.vo.ExcelImportVo;
...@@ -169,12 +170,17 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -169,12 +170,17 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
@Override @Override
public List<PlatSpaceVO> tree(PlatSpaceQueryDTO dto) { public List<PlatSpaceVO> tree(PlatSpaceQueryDTO dto) {
//查询用户权限组织id List<String> orgIds = Lists.newArrayList();
List<PlatOrg> orgs = platOrgService.belongToScopeList(new PlatOrg()); if (StringUtil.isNotEmpty(dto.getOrgId())) {
if (orgs.isEmpty()) { orgIds.add(dto.getOrgId());
return new ArrayList<>(); } else {
//查询用户权限组织id
List<PlatOrg> orgs = platOrgService.belongToScopeList(new PlatOrg());
if (orgs.isEmpty()) {
return new ArrayList<>();
}
orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
} }
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
LambdaQueryWrapper<PlatSpace> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PlatSpace> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtil.isNotEmpty(dto.getName()), PlatSpace::getName, dto.getName()); queryWrapper.like(StringUtil.isNotEmpty(dto.getName()), PlatSpace::getName, dto.getName());
queryWrapper.in(PlatSpace::getOrgId, orgIds); queryWrapper.in(PlatSpace::getOrgId, orgIds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment