|
@@ -795,7 +795,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
}
|
|
|
|
|
|
if (contractInfo != null) {
|
|
|
- Map<Long, String> collectNodesMap = getCollectNodesByContractId(contractId);
|
|
|
/* =========================== 施工合同段 =========================== */
|
|
|
if (new Integer(1).equals(contractInfo.getContractType())) {
|
|
|
String sql = "SELECT is_custom,p_key_id,contract_id," +
|
|
@@ -892,6 +891,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
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 (" + pKeyIds + ")",
|
|
|
new BeanPropertyRowMapper<>(WbsTreeContractStatistics.class));
|
|
|
Map<Long, WbsTreeContractStatistics> wbsTreeContractStatisticsMap = wbsTreeContractStatisticsList.stream().collect(Collectors.toMap(WbsTreeContractStatistics::getId, item -> item));
|
|
|
+ List<ContractCollectFolder> collectList = jdbcTemplate.query("select node_id from m_contract_collect_folder where type = 1 and contract_id = " + contractId + " and node_id in ( " + pKeyIds + ")", new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
+ Map<Long, ContractCollectFolder> collectNodesMap = collectList.stream().collect(Collectors.toMap(ContractCollectFolder::getNodeId, item -> item, (existing, replacement) -> existing));
|
|
|
setPrivateTemplate(lazyNodes);
|
|
|
for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
|
|
|
if(lazyNodeVO.getIsCustom()!=null&&lazyNodeVO.getIsCustom()==1){
|
|
@@ -1034,6 +1035,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
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 (" + pKeyIds + ")",
|
|
|
new BeanPropertyRowMapper<>(WbsTreeContractStatistics.class));
|
|
|
Map<Long, WbsTreeContractStatistics> wbsTreeContractStatisticsMap = wbsTreeContractStatisticsList.stream().collect(Collectors.toMap(WbsTreeContractStatistics::getId, item -> item));
|
|
|
+ List<ContractCollectFolder> collectList = jdbcTemplate.query("select node_id from m_contract_collect_folder where type = 1 and contract_id = " + contractId + " and node_id in ( " + pKeyIds + ")", new BeanPropertyRowMapper<>(ContractCollectFolder.class));
|
|
|
+ Map<Long, ContractCollectFolder> collectNodesMap = collectList.stream().collect(Collectors.toMap(ContractCollectFolder::getNodeId, item -> item, (existing, replacement) -> existing));
|
|
|
setPrivateTemplate(lazyNodes);
|
|
|
for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
|
|
|
if(lazyNodeVO.getIsCustom()!=null&&lazyNodeVO.getIsCustom()==1){
|
|
@@ -1138,49 +1141,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- private Map<Long, String> getCollectNodesByContractId(String contractId){
|
|
|
- if (contractId == null || contractId.trim().isEmpty()) {
|
|
|
- return new HashMap<>();
|
|
|
- }
|
|
|
- Map<Long, String> collectNodes = new HashMap<>();
|
|
|
- try {
|
|
|
- String string = redisTemplate.opsForValue().get("blade-manager::contract:collectFolder:" + contractId);
|
|
|
- if (string != null) {
|
|
|
- String[] split = string.split(",");
|
|
|
- for (String s : split) {
|
|
|
- if (StringUtil.isNumeric(s)) {
|
|
|
- collectNodes.put(Long.parseLong(s), "");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("",e);
|
|
|
- }
|
|
|
- try {
|
|
|
- if (!collectNodes.isEmpty()) {
|
|
|
- return collectNodes;
|
|
|
- }
|
|
|
- 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, "");
|
|
|
-// String nodeAncestors = contractCollectFolder.getNodeAncestors();
|
|
|
-// if (nodeAncestors != null) {
|
|
|
-// String[] split = nodeAncestors.split(",");
|
|
|
-// for (String s : split) {
|
|
|
-// if (StringUtil.isNumeric(s)) {
|
|
|
-// collectNodes.put(Long.parseLong(s), "");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
- String ids = collectNodes.keySet().stream().map(item -> item + "").collect(Collectors.joining(","));
|
|
|
- redisTemplate.opsForValue().set("blade-manager::contract:collectFolder:" + contractId, ids, 60 * 60 * 40L, TimeUnit.SECONDS);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("合同段id:" + contractId + ", 获取收藏节点失败:" + e.getMessage(), e);
|
|
|
- }
|
|
|
- return collectNodes;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 非批量电签时,主动清理本地缓存,如资料填报保存、任务上报等
|