Merge remote-tracking branch 'origin/feature/REQ-3488' into feature/REQ-3488
This commit is contained in:
commit
fe1d733c66
@ -49,6 +49,11 @@ public class OrgUnitRegisterDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String approvalMsg;
|
private String approvalMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批人
|
||||||
|
*/
|
||||||
|
private Long approver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系人&提交人姓名
|
* 联系人&提交人姓名
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import cn.axzo.orgmanax.dto.project.team.enums.ValidationEnum;
|
|||||||
import cn.axzo.orgmanax.dto.project.team.req.PageOrgTeamCategoryReq;
|
import cn.axzo.orgmanax.dto.project.team.req.PageOrgTeamCategoryReq;
|
||||||
import cn.axzo.orgmanax.dto.project.team.req.TreeOrgTeamCategoryReq;
|
import cn.axzo.orgmanax.dto.project.team.req.TreeOrgTeamCategoryReq;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -15,6 +16,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author syl
|
* @author syl
|
||||||
@ -70,10 +72,14 @@ public class ListTeamCategoryReq extends PageReqV2 {
|
|||||||
*/
|
*/
|
||||||
private Set<Long> projectTeamIds;
|
private Set<Long> projectTeamIds;
|
||||||
|
|
||||||
/**
|
public boolean isInvalid() {
|
||||||
* 平台班组id
|
return CollUtil.isEmpty(orgNodeIds)
|
||||||
*/
|
&& Objects.isNull(workspaceId)
|
||||||
private Set<Long> platTeamIds;
|
&& Objects.isNull(scene)
|
||||||
|
&& StringUtils.isBlank(parentCode)
|
||||||
|
&& CollUtil.isEmpty(categoryTypes)
|
||||||
|
&& CollUtil.isEmpty(categoryCodes);
|
||||||
|
}
|
||||||
|
|
||||||
public static ListTeamCategoryReq convertListReq(PageOrgTeamCategoryReq req){
|
public static ListTeamCategoryReq convertListReq(PageOrgTeamCategoryReq req){
|
||||||
ListTeamCategoryReq param = BeanUtil.copyProperties(req, ListTeamCategoryReq.class);
|
ListTeamCategoryReq param = BeanUtil.copyProperties(req, ListTeamCategoryReq.class);
|
||||||
|
|||||||
@ -22,7 +22,6 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -63,6 +62,10 @@ public class ProjectTeamCategoryServiceImpl implements ProjectTeamCategoryServic
|
|||||||
@Override
|
@Override
|
||||||
public List<TeamCategoryAggregateDTO> treeList(ListTeamCategoryReq param) {
|
public List<TeamCategoryAggregateDTO> treeList(ListTeamCategoryReq param) {
|
||||||
Map<Long, Long> nodeTeamMap = resolveNodeIds(param);
|
Map<Long, Long> nodeTeamMap = resolveNodeIds(param);
|
||||||
|
if (param.isInvalid()) {
|
||||||
|
log.info("treeList TeamCategory param is empty");
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
List<TeamCategoryDTO> categoryList = teamCategoryFoundationService.pageAll(param);
|
List<TeamCategoryDTO> categoryList = teamCategoryFoundationService.pageAll(param);
|
||||||
if (CollUtil.isEmpty(categoryList)) {
|
if (CollUtil.isEmpty(categoryList)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
@ -113,40 +116,38 @@ public class ProjectTeamCategoryServiceImpl implements ProjectTeamCategoryServic
|
|||||||
|
|
||||||
private Map<Long, Long> resolveNodeIds(ListTeamCategoryReq param) {
|
private Map<Long, Long> resolveNodeIds(ListTeamCategoryReq param) {
|
||||||
boolean hasProjectTeam = CollUtil.isNotEmpty(param.getProjectTeamIds());
|
boolean hasProjectTeam = CollUtil.isNotEmpty(param.getProjectTeamIds());
|
||||||
boolean hasPlatTeam = CollUtil.isNotEmpty(param.getPlatTeamIds());
|
// 由于profile没有属性,只能通过orggateway查询 teamOuRelation 实现。 后续等待废弃 teamOuRelation 再优化
|
||||||
if (!hasProjectTeam && !hasPlatTeam) {
|
//boolean hasPlatTeam = CollUtil.isNotEmpty(param.getPlatTeamIds());
|
||||||
|
if (!hasProjectTeam) {
|
||||||
return Maps.newHashMap();
|
return Maps.newHashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Long> projectTeamNodeIds = new HashSet<>();
|
Set<Long> projectTeamNodeIds = new HashSet<>();
|
||||||
Set<Long> platTeamNodeIds = new HashSet<>();
|
//Set<Long> platTeamNodeIds = new HashSet<>();
|
||||||
List<OrgProjectTeamDTO> projectTeams = new ArrayList<>();
|
// todo 通过项目班组id获取组织节点id
|
||||||
if (hasProjectTeam) {
|
List<OrgProjectTeamDTO> projectTeams = queryTeams(param.getProjectTeamIds(), NodeTypeEnum.PROJECT_TEAM);
|
||||||
// todo 通过项目班组id获取组织节点id
|
projectTeamNodeIds = projectTeams.stream()
|
||||||
projectTeams = queryTeams(param.getProjectTeamIds(), NodeTypeEnum.PROJECT_TEAM);
|
.map(OrgProjectTeamDTO::getOrganizationalNodeId)
|
||||||
projectTeamNodeIds = projectTeams.stream()
|
.collect(Collectors.toSet());
|
||||||
.map(OrgProjectTeamDTO::getOrganizationalNodeId)
|
// if (hasPlatTeam) {
|
||||||
.collect(Collectors.toSet());
|
// // 通过平台班组id获取组织节点id 后续实现
|
||||||
}
|
// List<OrgProjectTeamDTO> platTeams = queryTeams(param.getPlatTeamIds(), NodeTypeEnum.TEAM);
|
||||||
if (hasPlatTeam) {
|
// projectTeams.addAll(platTeams);
|
||||||
// todo 通过平台班组id获取组织节点id
|
// platTeamNodeIds = platTeams.stream()
|
||||||
List<OrgProjectTeamDTO> platTeams = queryTeams(param.getPlatTeamIds(), NodeTypeEnum.TEAM);
|
// .map(OrgProjectTeamDTO::getOrganizationalNodeId)
|
||||||
projectTeams.addAll(platTeams);
|
// .collect(Collectors.toSet());
|
||||||
platTeamNodeIds = platTeams.stream()
|
// }
|
||||||
.map(OrgProjectTeamDTO::getOrganizationalNodeId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> teamNodeIds;
|
Set<Long> teamNodeIds = intersectionNodeId(projectTeamNodeIds, param.getOrgNodeIds());
|
||||||
// 拼接
|
// 拼接
|
||||||
if (!hasProjectTeam) {
|
// if (!hasProjectTeam) {
|
||||||
teamNodeIds = intersectionNodeId(platTeamNodeIds, param.getOrgNodeIds());
|
// teamNodeIds = intersectionNodeId(platTeamNodeIds, param.getOrgNodeIds());
|
||||||
} else if (!hasPlatTeam) {
|
// } else if (!hasPlatTeam) {
|
||||||
teamNodeIds = intersectionNodeId(projectTeamNodeIds, param.getOrgNodeIds());
|
// teamNodeIds = intersectionNodeId(projectTeamNodeIds, param.getOrgNodeIds());
|
||||||
} else {
|
// } else {
|
||||||
teamNodeIds = intersectionNodeId(Sets.intersection(projectTeamNodeIds, platTeamNodeIds)
|
// teamNodeIds = intersectionNodeId(Sets.intersection(projectTeamNodeIds, platTeamNodeIds)
|
||||||
, param.getOrgNodeIds());
|
// , param.getOrgNodeIds());
|
||||||
}
|
// }
|
||||||
|
|
||||||
log.info("resolveNodeIds teamNodeIds = [{}]", JSONUtil.toJsonStr(teamNodeIds));
|
log.info("resolveNodeIds teamNodeIds = [{}]", JSONUtil.toJsonStr(teamNodeIds));
|
||||||
param.setOrgNodeIds(teamNodeIds);
|
param.setOrgNodeIds(teamNodeIds);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user