Merge remote-tracking branch 'origin/feature/REQ-3282' into feature/REQ-3282
This commit is contained in:
commit
956c0ce56c
@ -82,18 +82,6 @@ public class ListOrgCooperateShipReq {
|
||||
*/
|
||||
private Integer filterPersonType;
|
||||
|
||||
/**
|
||||
* 是否过滤工人
|
||||
*/
|
||||
@Builder.Default
|
||||
private Boolean isFilterWorker = false;
|
||||
|
||||
/**
|
||||
* 人员过滤是否包含已退场
|
||||
*/
|
||||
@Builder.Default
|
||||
private Boolean includeExitPerson = false;
|
||||
|
||||
/**
|
||||
* 是否包含祖先节点
|
||||
*/
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.axzo.orgmanax.dto.common.WorkspaceOuPair;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -16,17 +17,20 @@ public class ListNodeReq extends PageReqV2 {
|
||||
/**
|
||||
* ids
|
||||
*/
|
||||
private Set<Long> ids;
|
||||
@Builder.Default
|
||||
private Set<Long> ids = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 组织单位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集合
|
||||
*/
|
||||
private Set<Long> topNodeIds;
|
||||
@Builder.Default
|
||||
private Set<Long> topNodeIds = Collections.emptySet();;
|
||||
|
||||
/**
|
||||
* 是否包含祖先节点
|
||||
@ -74,33 +81,38 @@ public class ListNodeReq extends PageReqV2 {
|
||||
/**
|
||||
* 是否查询删除的
|
||||
*/
|
||||
private Boolean includeDelete;
|
||||
@Builder.Default
|
||||
private Boolean includeDelete = false;
|
||||
|
||||
/**
|
||||
* 是否包含协同关系
|
||||
*/
|
||||
@Builder.Default
|
||||
private Boolean includeCooperateShip = false;
|
||||
|
||||
/**
|
||||
* 只返回topNode
|
||||
*/
|
||||
private Boolean isSelectTopNodeOnly;
|
||||
|
||||
@Builder.Default
|
||||
private Boolean isSelectTopNodeOnly = false;
|
||||
|
||||
/**
|
||||
* 根据workspace和ouId组合查询
|
||||
*/
|
||||
private Set<WorkspaceOuPair> workspaceOuPairs;
|
||||
@Builder.Default
|
||||
private Set<WorkspaceOuPair> workspaceOuPairs = Collections.emptySet();;
|
||||
|
||||
/**
|
||||
* 项目id集合
|
||||
*/
|
||||
private Set<Long> workspaceIds;
|
||||
|
||||
/**
|
||||
* 需要返回父节点信息
|
||||
*/
|
||||
private Boolean needParent;
|
||||
@Builder.Default
|
||||
private Set<Long> workspaceIds = Collections.emptySet();;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
private Set<String> jobCodes;
|
||||
@Builder.Default
|
||||
private Set<String> jobCodes = Collections.emptySet();;
|
||||
|
||||
/**
|
||||
* 当前用户personId
|
||||
|
||||
@ -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,84 @@ 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();
|
||||
|
||||
/**
|
||||
* path右值
|
||||
*/
|
||||
@CriteriaField(field = "isDelete", operator = Operator.EQ)
|
||||
@Builder.Default
|
||||
private Long isDelete = 0L;
|
||||
private Collection<Long> parentIds = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* 项目单位关系聚合查询
|
||||
*/
|
||||
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;
|
||||
@ -23,7 +24,6 @@ import java.util.stream.Collectors;
|
||||
public class CooperateShipQueryRepositoryImpl implements CooperateShipQueryRepository {
|
||||
|
||||
private final SaasCooperateShipDao cooperateShipDao;
|
||||
private final NodeUserQueryRepository nodeUserQueryRepository;
|
||||
|
||||
@Override
|
||||
public List<SaasCooperateShip> list(CooperateShipQueryRepository.ListReq req) {
|
||||
@ -55,6 +55,7 @@ public class CooperateShipQueryRepositoryImpl implements CooperateShipQueryRepos
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
wrapper.eq("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();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.orgmanax.infra.dao.nodeuser.entity;
|
||||
|
||||
import cn.axzo.trade.datasecurity.core.annotation.CryptField;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -59,6 +60,7 @@ public class OrganizationalNodeUser implements Serializable {
|
||||
/**
|
||||
* 主电话
|
||||
*/
|
||||
@CryptField
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
@ -69,6 +71,7 @@ public class OrganizationalNodeUser implements Serializable {
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@CryptField
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.axzo.foundation.page.PageResp;
|
||||
import cn.axzo.orgmanax.infra.dao.nodeuser.dao.NodeUserDao;
|
||||
import cn.axzo.orgmanax.infra.dao.nodeuser.entity.OrganizationalNodeUser;
|
||||
import cn.axzo.orgmanax.infra.dao.nodeuser.repository.NodeUserQueryRepository;
|
||||
import cn.axzo.trade.datasecurity.core.util.DataSecurityHelper;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
@ -34,11 +35,12 @@ public class NodeUserQueryRepositoryImpl implements NodeUserQueryRepository {
|
||||
// 查询参数处理 ~
|
||||
// keyword
|
||||
if (StrUtil.isNotBlank(req.getKeyword())) {
|
||||
String encryptedKeyword = DataSecurityHelper.encrypt(req.getKeyword());
|
||||
wrapper.and(w -> {
|
||||
w.like("real_name", req.getKeyword())
|
||||
.or().eq("phone", req.getKeyword())
|
||||
.or().eq("phone", encryptedKeyword)
|
||||
.or().eq("job_number", req.getKeyword())
|
||||
.or().eq("phone", req.getKeyword());
|
||||
.or().eq("id_number", encryptedKeyword);
|
||||
});
|
||||
}
|
||||
// 处理删除标记
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.orgmanax.infra.dao.orguser.entity;
|
||||
|
||||
import cn.axzo.trade.datasecurity.core.annotation.CryptField;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@ -46,6 +47,7 @@ public class OrgUser implements Serializable {
|
||||
/**
|
||||
* 手机号,加密
|
||||
*/
|
||||
@CryptField
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
@ -56,6 +58,7 @@ public class OrgUser implements Serializable {
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@CryptField
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
|
||||
@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class CooperateShipFoundationServiceImpl implements CooperateShipFoundationService {
|
||||
|
||||
private NodeUserQueryRepository nodeUserQueryRepository;
|
||||
private final NodeUserQueryRepository nodeUserQueryRepository;
|
||||
|
||||
@Override
|
||||
public void filterByPerson(Long filterPersonId, List<SaasCooperateShip> list) {
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.axzo.orgmanax.server.node.service.impl;
|
||||
import cn.axzo.foundation.exception.Axssert;
|
||||
import cn.axzo.foundation.page.PageResp;
|
||||
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.req.ListNodeReq;
|
||||
import cn.axzo.orgmanax.dto.node.req.ProcessNodeReq;
|
||||
@ -122,10 +123,10 @@ 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())
|
||||
.build()), SaasCooperateShip::getOrganizationalNodeId, true);
|
||||
if (CollUtil.isEmpty(topNodeIds)) {
|
||||
return emptyPageResp;
|
||||
@ -142,6 +143,12 @@ public class NodeServiceImpl implements NodeService {
|
||||
// 转换为DTO
|
||||
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())) {
|
||||
Set<Long> parentIds = nodeFoundationService.extractParentIds(page.getData());
|
||||
@ -262,4 +269,14 @@ public class NodeServiceImpl implements NodeService {
|
||||
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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @author luofu
|
||||
@ -97,14 +96,6 @@ public class OrgJobPageParam extends PageReqV2 {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
public boolean isInvalid() {
|
||||
return CollUtil.isEmpty(orgJobGroupFlags)
|
||||
&& CollUtil.isEmpty(orgJobGroupCodes)
|
||||
&& CollUtil.isEmpty(jobIds)
|
||||
&& CollUtil.isEmpty(jobCodes)
|
||||
&& StringUtils.isBlank(keyword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString();
|
||||
|
||||
@ -94,10 +94,6 @@ public class OrgJobServiceImpl implements OrgJobService {
|
||||
|
||||
@Override
|
||||
public PageResp<OrgJobDTO> page(OrgJobPageParam param) {
|
||||
if (param.isInvalid()) {
|
||||
log.info("org job page param is invalid. param:{}", JSONUtil.toJsonStr(param));
|
||||
return PageResp.<OrgJobDTO>builder().build();
|
||||
}
|
||||
resolveCooperateTypes(param);
|
||||
OrgJobPageParam orgJobPageParam = resolveJobPageParam(param);
|
||||
PageResp<OrgJobDTO> orgJobs = foundationService.page(param);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user