feat:[REQ-3282]实现协同关系方查询接口
This commit is contained in:
parent
b5c308a454
commit
725ce1422b
@ -32,41 +32,41 @@ public class ListOrgCooperateShipReq {
|
|||||||
/**
|
/**
|
||||||
* 工作台类型
|
* 工作台类型
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "workspaceType", operator = Operator.IN)
|
// @CriteriaField(field = "workspaceType", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Integer> workspaceType = Collections.emptySet();
|
private Set<Integer> workspaceType = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位id集合(如果是班组则插入队伍id)
|
* 单位id集合(如果是班组则插入队伍id)
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "organizationalUnitId", operator = Operator.IN)
|
// @CriteriaField(field = "organizationalUnitId", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Long> ouIds = Collections.emptySet();
|
private Set<Long> ouIds = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定的协同关系类型
|
* 指定的协同关系类型
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "cooperateType", operator = Operator.IN)
|
// @CriteriaField(field = "cooperateType", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Integer> includeCooperateTypes = Collections.emptySet();
|
private Set<Integer> includeCooperateTypes = Collections.emptySet();
|
||||||
/**
|
/**
|
||||||
* 待排除的协同关系类型
|
* 待排除的协同关系类型
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "cooperateType", operator = Operator.NOT_IN)
|
// @CriteriaField(field = "cooperateType", operator = Operator.NOT_IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Integer> excludeCooperateTypes = Collections.emptySet();
|
private Set<Integer> excludeCooperateTypes = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点id
|
* 节点id
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "organizationalNodeId", operator = Operator.IN)
|
// @CriteriaField(field = "organizationalNodeId", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Long> organizationNodeIds = Collections.emptySet();
|
private Set<Long> organizationNodeIds = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合作关系 1.合作 2.直属
|
* 合作关系 1.合作 2.直属
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "partnerShip", operator = Operator.IN)
|
// @CriteriaField(field = "partnerShip", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Integer> partnerShips = Collections.emptySet();
|
private Set<Integer> partnerShips = Collections.emptySet();
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ public class ListOrgCooperateShipReq {
|
|||||||
/**
|
/**
|
||||||
* 在场状态集合
|
* 在场状态集合
|
||||||
*/
|
*/
|
||||||
@CriteriaField(field = "status", operator = Operator.IN)
|
// @CriteriaField(field = "status", operator = Operator.IN)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Set<Integer> statuses = Collections.emptySet();
|
private Set<Integer> statuses = Collections.emptySet();
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class NodeQueryRepositoryImpl implements NodeQueryRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void assembleParentNode(ListNodeReq req, List<NodeResp> records) {
|
private void assembleParentNode(ListNodeReq req, List<NodeResp> records) {
|
||||||
if (!BooleanUtil.isTrue(req.getNeedParent())) {
|
if (!BooleanUtil.isTrue(req.getIsSelectAncestors())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<Long, NodeResp> nodesById = records.stream().collect(Collectors.toMap(NodeResp::getId, Function.identity()));
|
Map<Long, NodeResp> nodesById = records.stream().collect(Collectors.toMap(NodeResp::getId, Function.identity()));
|
||||||
|
|||||||
@ -126,6 +126,7 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
|||||||
public List<OrgCooperateShipDTO> list(ListOrgCooperateShipReq req) {
|
public List<OrgCooperateShipDTO> list(ListOrgCooperateShipReq req) {
|
||||||
|
|
||||||
boolean isFilterCurrentNodeByPerson = ObjectUtil.isNotNull(req.getFilterPersonId()) && Objects.equals(req.getFilterPersonType(), 1);
|
boolean isFilterCurrentNodeByPerson = ObjectUtil.isNotNull(req.getFilterPersonId()) && Objects.equals(req.getFilterPersonType(), 1);
|
||||||
|
boolean isFilterCurrentAndBelowByPerson = ObjectUtil.isNotNull(req.getFilterPersonId()) && Objects.equals(req.getFilterPersonType(), 2);
|
||||||
|
|
||||||
// 根据入参查询数据
|
// 根据入参查询数据
|
||||||
List<SaasCooperateShip> list = cooperateShipQueryRepository.list(req);
|
List<SaasCooperateShip> list = cooperateShipQueryRepository.list(req);
|
||||||
@ -133,7 +134,7 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否根据person过滤当前节点
|
// 根据person过滤当前节点
|
||||||
if (isFilterCurrentNodeByPerson) {
|
if (isFilterCurrentNodeByPerson) {
|
||||||
cooperateShipFoundationService.filterByPerson(req.getFilterPersonId(), list);
|
cooperateShipFoundationService.filterByPerson(req.getFilterPersonId(), list);
|
||||||
}
|
}
|
||||||
@ -144,6 +145,12 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
|||||||
List<SaasCooperateShip> ancestorShipNodes = cooperateShipQueryRepository.list(ListOrgCooperateShipReq.builder().ids(ancestorIds).build());
|
List<SaasCooperateShip> ancestorShipNodes = cooperateShipQueryRepository.list(ListOrgCooperateShipReq.builder().ids(ancestorIds).build());
|
||||||
list.addAll(ancestorShipNodes);
|
list.addAll(ancestorShipNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据person过滤当前节点及以下节点
|
||||||
|
if (isFilterCurrentAndBelowByPerson) {
|
||||||
|
cooperateShipFoundationService.filterByPerson(req.getFilterPersonId(), list);
|
||||||
|
}
|
||||||
|
|
||||||
return BeanUtil.copyToList(list, OrgCooperateShipDTO.class);
|
return BeanUtil.copyToList(list, OrgCooperateShipDTO.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user