|
@@ -1525,7 +1525,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
if (!collectNodes.isEmpty()) {
|
|
|
return collectNodes;
|
|
|
}
|
|
|
- List<ContractCollectFolder> query = jdbcTemplate.query(String.format("select * from m_contract_collect_folder where contract_id = %s and type = 1", contractId), new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
+ List<ContractCollectFolder> query = jdbcTemplate.query(String.format("select node_id from m_contract_collect_folder where contract_id = %s and type = 1", contractId), new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
for (ContractCollectFolder contractCollectFolder : query) {
|
|
|
Long nodeId = contractCollectFolder.getNodeId();
|
|
|
collectNodes.put(nodeId, "");
|
|
@@ -1591,7 +1591,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
return syncPKeyIds;
|
|
|
}
|
|
|
@Override
|
|
|
- public R<Object> getCollectTreeNode(String contractId, String tableOwner, Long folderId, String queryValue) {
|
|
|
+ public R<Object> getCollectTreeNode(String contractId, String tableOwner, Long folderId, String queryValue, Long pKeyId) {
|
|
|
if (StringUtils.isEmpty(contractId)) {
|
|
|
return R.fail(200, "合同段id错误");
|
|
|
}
|
|
@@ -1603,7 +1603,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
return R.fail(200, "合同段不存在");
|
|
|
}
|
|
|
Set<String> syncPKeyIds = getSyncFlagIds(contractId, tableOwner);
|
|
|
- List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select * from m_contract_collect_folder where type = 1 and parent_id = " + folderId, new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
+ List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select node_id from m_contract_collect_folder where type = 1 and parent_id = " + folderId + " and node_parent_id = " + pKeyId, new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
if (!contractCollectNodes.isEmpty()) {
|
|
|
Set<Long> pKeyIds = new LinkedHashSet<>();
|
|
|
Map<Long, String> collectMap = new HashMap<>();
|
|
@@ -1620,7 +1620,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
collectMap.put(node.getNodeId(), "");
|
|
|
pKeyIds.add(node.getNodeId());
|
|
|
}
|
|
|
- List<WbsTreeContract> wbsTreeContractList = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, pKeyIds));
|
|
|
+ List<WbsTreeContract> wbsTreeContractList = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, pKeyIds).eq(WbsTreeContract::getPId, pKeyId));
|
|
|
if (!wbsTreeContractList.isEmpty()) {
|
|
|
String pKeyIdStr = wbsTreeContractList.stream().map(item -> item.getPKeyId() + "").collect(Collectors.joining(","));
|
|
|
List<WbsTreeContractStatistics> wbsTreeContractStatisticsList = jdbcTemplate.query("select id, leaf_num, fill_num, approve_num, complete_num,jl_fill_num, jl_approve_num, jl_complete_num from m_wbs_tree_contract_statistics where id in (" + pKeyIdStr + ")",
|
|
@@ -1642,9 +1642,15 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
Integer nums = statistics.calculateSubmitNums(tableOwner);
|
|
|
vo.setSubmitCounts(nums == null ? 0 : nums.longValue());
|
|
|
vo.setColorStatus(statistics.calculateColorStatus(tableOwner));
|
|
|
+ if (statistics.getLeafNum() > 0) {
|
|
|
+ vo.setHasChildren( true);
|
|
|
+ } else {
|
|
|
+ vo.setHasChildren(false);
|
|
|
+ }
|
|
|
} else {
|
|
|
vo.setSubmitCounts(0L);
|
|
|
vo.setColorStatus(1);
|
|
|
+ vo.setHasChildren(false);
|
|
|
}
|
|
|
if(CollectionUtil.isNotEmpty(syncPKeyIds)){
|
|
|
//判断是否展示同步标识
|
|
@@ -1658,11 +1664,11 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
}
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
|
- List<WbsTreeContractTreeAllVO> resultList = this.buildWbsTreeByStreamByTreeAll(wbsTreeContractTreeAllVOS);
|
|
|
+// List<WbsTreeContractTreeAllVO> resultList = this.buildWbsTreeByStreamByTreeAll(wbsTreeContractTreeAllVOS);
|
|
|
if (StringUtil.hasText(queryValue)) {
|
|
|
- resultMaps.put(Long.parseLong(cId), this.queryTreeResult(resultList, queryValue));
|
|
|
+ resultMaps.put(Long.parseLong(cId), this.queryTreeResult(wbsTreeContractTreeAllVOS, queryValue));
|
|
|
} else {
|
|
|
- resultMaps.put(Long.parseLong(cId), resultList);
|
|
|
+ resultMaps.put(Long.parseLong(cId), wbsTreeContractTreeAllVOS);
|
|
|
}
|
|
|
});
|
|
|
if (contractInfo.getContractType() != null && contractInfo.getContractType() == 1) {
|