|
@@ -1603,7 +1603,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
return R.fail(200, "合同段不存在");
|
|
|
}
|
|
|
Set<String> syncPKeyIds = getSyncFlagIds(contractId, tableOwner);
|
|
|
- List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select node_id, node_ancestors from m_contract_collect_folder where type = 1 and parent_id = " + folderId, new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
+ List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select node_id, ifnull((select ancestors_p_id from m_wbs_tree_contract where p_key_id = a.node_id), (select ancestors from m_wbs_tree_contract_statistics where id = a.node_id)) as nodeAncestors " +
|
|
|
+ "from m_contract_collect_folder a where type = 1 and parent_id = " + folderId, new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
if (!contractCollectNodes.isEmpty()) {
|
|
|
Set<Long> pKeyIds = new LinkedHashSet<>();
|
|
|
Map<Long, String> collectMap = new HashMap<>();
|
|
@@ -1716,7 +1717,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
return R.fail(200, "合同段不存在");
|
|
|
}
|
|
|
Set<String> syncPKeyIds = getSyncFlagIds(contractId, tableOwner);
|
|
|
- List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select node_id, node_ancestors from m_contract_collect_folder a where type = 1 and parent_id = " + folderId
|
|
|
+ List<ContractCollectFolder> contractCollectNodes = jdbcTemplate.query("select node_id, ifnull((select ancestors_p_id from m_wbs_tree_contract where p_key_id = a.node_id), (select ancestors from m_wbs_tree_contract_statistics where id = a.node_id)) as nodeAncestors from m_contract_collect_folder a where type = 1 and parent_id = " + folderId
|
|
|
+ " and EXISTS (SELECT 1 from m_wbs_tree_contract where p_key_id = a.node_id and full_name like '%" + queryValue + "%')",
|
|
|
new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
if (!contractCollectNodes.isEmpty()) {
|