Merge remote-tracking branch 'refs/remotes/origin/feature/REQ-3282' into feature/REQ-3282-zhh
This commit is contained in:
commit
13056f0067
@ -82,17 +82,20 @@ public class ListOrgCooperateShipReq {
|
||||
* 需要过滤的personId
|
||||
* personId
|
||||
*/
|
||||
private Long filterPersonId;
|
||||
@CriteriaField(ignore = true)
|
||||
private Long filterPersonId ;
|
||||
|
||||
/**
|
||||
* 当personId有值时,为必填项
|
||||
* 1只过滤当前节点数据 2过滤当前节点及以下数据
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
private Integer filterPersonType;
|
||||
|
||||
/**
|
||||
* 是否过滤工人
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Boolean isFilterWorker = false;
|
||||
|
||||
@ -100,18 +103,21 @@ public class ListOrgCooperateShipReq {
|
||||
/**
|
||||
* 人员过滤是否包含已退场
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Boolean includeExitPerson = false;
|
||||
|
||||
/**
|
||||
* 是否查询祖先节点
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Boolean isSelectAncestors = false;
|
||||
|
||||
/**
|
||||
* 是否查询子孙节点
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Boolean isSelectDescendant = false;
|
||||
|
||||
@ -119,6 +125,7 @@ public class ListOrgCooperateShipReq {
|
||||
* 条件:当需要查询上下级数据时启用
|
||||
* 是否只查一级
|
||||
*/
|
||||
@CriteriaField(ignore = true)
|
||||
@Builder.Default
|
||||
private Boolean isSelectLevelOne = false;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ public class MybatisPlusConfig {
|
||||
* 本地启动默认打印sql日志
|
||||
*/
|
||||
@Bean
|
||||
@LocalCondition.Conditional
|
||||
// @LocalCondition.Conditional
|
||||
public ConfigurationCustomizer localConfigurationCustomizer() {
|
||||
return configuration -> configuration.setLogImpl(StdOutImpl.class);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class NodeQueryRepositoryImpl implements NodeQueryRepository {
|
||||
}
|
||||
|
||||
private void assembleParentNode(ListNodeReq req, List<NodeResp> records) {
|
||||
if (!BooleanUtil.isTrue(req.getNeedParent())) {
|
||||
if (!BooleanUtil.isTrue(req.getIsSelectAncestors())) {
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
|
||||
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);
|
||||
@ -133,7 +134,7 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 是否根据person过滤当前节点
|
||||
// 根据person过滤当前节点
|
||||
if (isFilterCurrentNodeByPerson) {
|
||||
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.addAll(ancestorShipNodes);
|
||||
}
|
||||
|
||||
// 根据person过滤当前节点及以下节点
|
||||
if (isFilterCurrentAndBelowByPerson) {
|
||||
cooperateShipFoundationService.filterByPerson(req.getFilterPersonId(), list);
|
||||
}
|
||||
|
||||
return BeanUtil.copyToList(list, OrgCooperateShipDTO.class);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user