feat:[REQ-3282] 自测, 修复已知问题
This commit is contained in:
parent
ed90487f85
commit
bb8d798510
@ -74,7 +74,7 @@ public class ListNodeReq extends PageReqV2 {
|
||||
/**
|
||||
* 是否查询删除的
|
||||
*/
|
||||
private Boolean includeDelete;
|
||||
private Boolean includeDelete = false;
|
||||
|
||||
/**
|
||||
* 只返回topNode
|
||||
@ -92,11 +92,6 @@ public class ListNodeReq extends PageReqV2 {
|
||||
*/
|
||||
private Set<Long> workspaceIds;
|
||||
|
||||
/**
|
||||
* 需要返回父节点信息
|
||||
*/
|
||||
private Boolean needParent;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
|
||||
@ -2,16 +2,14 @@ package cn.axzo.orgmanax.infra.dao.cooperateship.repository;
|
||||
|
||||
import cn.axzo.foundation.dao.support.wrapper.CriteriaField;
|
||||
import cn.axzo.foundation.dao.support.wrapper.Operator;
|
||||
import cn.axzo.orgmanax.dto.common.WorkspaceOuPair;
|
||||
import cn.axzo.orgmanax.infra.dao.cooperateship.entity.SaasCooperateShip;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.google.common.base.Preconditions;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
public interface CooperateShipQueryRepository {
|
||||
|
||||
@ -60,103 +58,91 @@ public interface CooperateShipQueryRepository {
|
||||
*/
|
||||
@CriteriaField(field = "id", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Long> ids = Collections.emptySet();
|
||||
private Collection<Long> ids = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 工作台id
|
||||
*/
|
||||
@CriteriaField(field = "workspaceId", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Long> workspaceIds = Collections.emptySet();
|
||||
private Collection<Long> workspaceIds = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 工作台类型
|
||||
*/
|
||||
@CriteriaField(field = "workspaceType", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Integer> workspaceTypes = Collections.emptySet();
|
||||
private Collection<Integer> workspaceTypes = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 单位id集合(如果是班组则插入队伍id)
|
||||
*/
|
||||
@CriteriaField(field = "organizationalUnitId", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Long> ouIds = Collections.emptySet();
|
||||
private Collection<Long> ouIds = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 指定的协同关系类型
|
||||
*/
|
||||
@CriteriaField(field = "cooperateType", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Integer> includeCooperateTypes = Collections.emptySet();
|
||||
private Collection<Integer> includeCooperateTypes = Collections.emptySet();
|
||||
/**
|
||||
* 待排除的协同关系类型
|
||||
*/
|
||||
@CriteriaField(field = "cooperateType", operator = Operator.NOT_IN)
|
||||
@Builder.Default
|
||||
private Set<Integer> excludeCooperateTypes = Collections.emptySet();
|
||||
private Collection<Integer> excludeCooperateTypes = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
@CriteriaField(field = "organizationalNodeId", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Long> organizationNodeIds = Collections.emptySet();
|
||||
private Collection<Long> organizationNodeIds = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 合作关系 1.合作 2.直属
|
||||
*/
|
||||
@CriteriaField(field = "partnerShip", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Integer> partnerShips = Collections.emptySet();
|
||||
private Collection<Integer> partnerShips = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 在场状态集合
|
||||
*/
|
||||
@CriteriaField(field = "status", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Integer> statuses = Collections.emptySet();
|
||||
private Collection<Integer> statuses = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* path右值
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Set<String> pathsRight = Collections.emptySet();
|
||||
private Collection<String> pathsRight = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* path右值
|
||||
*/
|
||||
@CriteriaField(field = "parentId", operator = Operator.IN)
|
||||
@Builder.Default
|
||||
private Set<Long> parentIds = Collections.emptySet();
|
||||
private Collection<Long> parentIds = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* path右值
|
||||
* 是否包含删除数据
|
||||
*/
|
||||
@CriteriaField(field = "isDelete", operator = Operator.EQ)
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Long isDelete = 0L;
|
||||
private Boolean includeDelete = false;
|
||||
|
||||
/**
|
||||
* 项目单位关系聚合查询
|
||||
*/
|
||||
private List<WorkspaceOuPair> workspaceOuPairs;
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Collection<WorkspaceOuPair> workspaceOuPairs = Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
class WorkspaceOuPair {
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private Long ouId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.axzo.orgmanax.infra.dao.cooperateship.repository.impl;
|
||||
|
||||
import cn.axzo.foundation.dao.support.mysql.QueryWrapperHelper;
|
||||
import cn.axzo.orgmanax.dto.common.WorkspaceOuPair;
|
||||
import cn.axzo.orgmanax.infra.dao.cooperateship.dao.SaasCooperateShipDao;
|
||||
import cn.axzo.orgmanax.infra.dao.cooperateship.entity.SaasCooperateShip;
|
||||
import cn.axzo.orgmanax.infra.dao.cooperateship.repository.CooperateShipQueryRepository;
|
||||
@ -55,6 +56,7 @@ public class CooperateShipQueryRepositoryImpl implements CooperateShipQueryRepos
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
wrapper.eq(!req.getIncludeDelete(), "is_delete", 0);
|
||||
return cooperateShipDao.list(wrapper)
|
||||
.stream().map(e -> BeanUtil.toBean(e, SaasCooperateShip.class)).collect(Collectors.toList());
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@ public class NodeQueryRepositoryImpl implements NodeQueryRepository {
|
||||
return PageResp.<OrganizationalNode>builder().build();
|
||||
}
|
||||
|
||||
wrapper.eq(!req.getIncludeDelete(), "is_delete", 0);
|
||||
IPage<OrganizationalNode> results = nodeDao.page(page, wrapper);
|
||||
PageResp<OrganizationalNode> resp = PageConverter.toResp(results);
|
||||
List<OrganizationalNode> records = resp.getData();
|
||||
|
||||
@ -122,10 +122,11 @@ public class NodeServiceImpl implements NodeService {
|
||||
}
|
||||
|
||||
// 根据项目ID获取topNodeId进行组织节点过滤
|
||||
if (CollUtil.isNotEmpty(req.getWorkspaceIds())) {
|
||||
if (CollUtil.isNotEmpty(req.getWorkspaceIds()) || CollUtil.isNotEmpty(req.getWorkspaceOuPairs())) {
|
||||
List<Long> topNodeIds = CollUtil.map(cooperateShipQueryRepository.list(CooperateShipQueryRepository.ListReq.builder()
|
||||
.workspaceIds(req.getWorkspaceIds())
|
||||
.workspaceOuPairs(BeanUtil.copyToList(req.getWorkspaceOuPairs(), CooperateShipQueryRepository.WorkspaceOuPair.class))
|
||||
.workspaceOuPairs(req.getWorkspaceOuPairs())
|
||||
.includeDelete(false)
|
||||
.build()), SaasCooperateShip::getOrganizationalNodeId, true);
|
||||
if (CollUtil.isEmpty(topNodeIds)) {
|
||||
return emptyPageResp;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user