feat:[REQ-3282] 自测, 修复已知问题
This commit is contained in:
parent
564e799141
commit
985229f627
@ -5,6 +5,7 @@ import cn.axzo.orgmanax.dto.common.WorkspaceOuPair;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -16,17 +17,20 @@ public class ListNodeReq extends PageReqV2 {
|
|||||||
/**
|
/**
|
||||||
* ids
|
* ids
|
||||||
*/
|
*/
|
||||||
private Set<Long> ids;
|
@Builder.Default
|
||||||
|
private Set<Long> ids = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织单位ids
|
* 组织单位ids
|
||||||
*/
|
*/
|
||||||
private Set<Long> ouIds;
|
@Builder.Default
|
||||||
|
private Set<Long> ouIds = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称集合
|
* 节点名称集合
|
||||||
*/
|
*/
|
||||||
private Set<String> nodeNames;
|
@Builder.Default
|
||||||
|
private Set<String> nodeNames = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称查询(模糊)
|
* 节点名称查询(模糊)
|
||||||
@ -36,16 +40,19 @@ public class ListNodeReq extends PageReqV2 {
|
|||||||
/**
|
/**
|
||||||
* 指定部门类型
|
* 指定部门类型
|
||||||
*/
|
*/
|
||||||
private Set<Integer> includeOrgNodeTypes;
|
@Builder.Default
|
||||||
|
private Set<Integer> includeOrgNodeTypes = Collections.emptySet();;
|
||||||
/**
|
/**
|
||||||
* 排除部门类型
|
* 排除部门类型
|
||||||
*/
|
*/
|
||||||
private Set<Integer> excludeOrgNodeTypes;
|
@Builder.Default
|
||||||
|
private Set<Integer> excludeOrgNodeTypes = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顶级节点ID集合
|
* 顶级节点ID集合
|
||||||
*/
|
*/
|
||||||
private Set<Long> topNodeIds;
|
@Builder.Default
|
||||||
|
private Set<Long> topNodeIds = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否包含祖先节点
|
* 是否包含祖先节点
|
||||||
@ -74,28 +81,38 @@ public class ListNodeReq extends PageReqV2 {
|
|||||||
/**
|
/**
|
||||||
* 是否查询删除的
|
* 是否查询删除的
|
||||||
*/
|
*/
|
||||||
|
@Builder.Default
|
||||||
private Boolean includeDelete = false;
|
private Boolean includeDelete = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否包含协同关系
|
||||||
|
*/
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean includeCooperateShip = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 只返回topNode
|
* 只返回topNode
|
||||||
*/
|
*/
|
||||||
private Boolean isSelectTopNodeOnly;
|
@Builder.Default
|
||||||
|
private Boolean isSelectTopNodeOnly = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据workspace和ouId组合查询
|
* 根据workspace和ouId组合查询
|
||||||
*/
|
*/
|
||||||
private Set<WorkspaceOuPair> workspaceOuPairs;
|
@Builder.Default
|
||||||
|
private Set<WorkspaceOuPair> workspaceOuPairs = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目id集合
|
* 项目id集合
|
||||||
*/
|
*/
|
||||||
private Set<Long> workspaceIds;
|
@Builder.Default
|
||||||
|
private Set<Long> workspaceIds = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位编码
|
* 岗位编码
|
||||||
*/
|
*/
|
||||||
private Set<String> jobCodes;
|
@Builder.Default
|
||||||
|
private Set<String> jobCodes = Collections.emptySet();;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前用户personId
|
* 当前用户personId
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package cn.axzo.orgmanax.server.node.service.impl;
|
|||||||
import cn.axzo.foundation.exception.Axssert;
|
import cn.axzo.foundation.exception.Axssert;
|
||||||
import cn.axzo.foundation.page.PageResp;
|
import cn.axzo.foundation.page.PageResp;
|
||||||
import cn.axzo.orgmanax.common.config.BizResultCode;
|
import cn.axzo.orgmanax.common.config.BizResultCode;
|
||||||
|
import cn.axzo.orgmanax.dto.cooperateship.dto.OrgCooperateShipDTO;
|
||||||
import cn.axzo.orgmanax.dto.node.dto.OrgNodeDTO;
|
import cn.axzo.orgmanax.dto.node.dto.OrgNodeDTO;
|
||||||
import cn.axzo.orgmanax.dto.node.req.ListNodeReq;
|
import cn.axzo.orgmanax.dto.node.req.ListNodeReq;
|
||||||
import cn.axzo.orgmanax.dto.node.req.ProcessNodeReq;
|
import cn.axzo.orgmanax.dto.node.req.ProcessNodeReq;
|
||||||
@ -143,6 +144,12 @@ public class NodeServiceImpl implements NodeService {
|
|||||||
// 转换为DTO
|
// 转换为DTO
|
||||||
List<OrgNodeDTO> records = page.getData().stream().map(e -> BeanUtil.toBean(e, OrgNodeDTO.class)).collect(Collectors.toList());
|
List<OrgNodeDTO> records = page.getData().stream().map(e -> BeanUtil.toBean(e, OrgNodeDTO.class)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 是否包含协同关系
|
||||||
|
if (req.getIncludeCooperateShip()) {
|
||||||
|
assembleCooperateShip(records);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 是否查询父级节点
|
// 是否查询父级节点
|
||||||
if (BooleanUtil.isTrue(req.getIncludeParent())) {
|
if (BooleanUtil.isTrue(req.getIncludeParent())) {
|
||||||
Set<Long> parentIds = nodeFoundationService.extractParentIds(page.getData());
|
Set<Long> parentIds = nodeFoundationService.extractParentIds(page.getData());
|
||||||
@ -263,4 +270,14 @@ public class NodeServiceImpl implements NodeService {
|
|||||||
e.setChildrenNodes(CollUtil.emptyIfNull(orgNodeDTOS));
|
e.setChildrenNodes(CollUtil.emptyIfNull(orgNodeDTOS));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void assembleCooperateShip(List<OrgNodeDTO> nodes) {
|
||||||
|
List<Long> nodeTopNodeIds = nodes.stream().map(OrgNodeDTO::getTopNodeId).distinct().collect(Collectors.toList());
|
||||||
|
Map<Long, SaasCooperateShip> cooperateShips = cooperateShipQueryRepository.list(CooperateShipQueryRepository.ListReq.builder().organizationNodeIds(nodeTopNodeIds).build()).stream().collect(Collectors.toMap(SaasCooperateShip::getOrganizationalNodeId, Function.identity()));
|
||||||
|
// 补充 workspaceId 和 cooperateType
|
||||||
|
nodes.forEach(node -> {
|
||||||
|
SaasCooperateShip cooperateShip = cooperateShips.get(node.getTopNodeId());
|
||||||
|
node.setCooperateShip(BeanUtil.copyProperties(cooperateShip, OrgCooperateShipDTO.class));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user