|
@@ -96,6 +96,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
/*存储当前合同段contractId_tableOwner对应的节点数量统计缓存信息*/
|
|
/*存储当前合同段contractId_tableOwner对应的节点数量统计缓存信息*/
|
|
private final Map<String, List<WbsTreeContractLazyVO>> localCacheParentCountNodes = new ConcurrentHashMap<>();
|
|
private final Map<String, List<WbsTreeContractLazyVO>> localCacheParentCountNodes = new ConcurrentHashMap<>();
|
|
|
|
|
|
|
|
+ /*存储当前合同段对应的资料查询信息*/
|
|
|
|
+ private final Map<String, List<InformationQuery>> localCacheQueryInfoAll = new ConcurrentHashMap<>();
|
|
|
|
+
|
|
private final NewIOSSClient newIOSSClient;
|
|
private final NewIOSSClient newIOSSClient;
|
|
private static final String GUEST_NAME = "guest";
|
|
private static final String GUEST_NAME = "guest";
|
|
private final IUserDeptService userDeptService;
|
|
private final IUserDeptService userDeptService;
|
|
@@ -958,6 +961,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
localCacheNodes.clear();
|
|
localCacheNodes.clear();
|
|
localCacheQueryInfos.clear();
|
|
localCacheQueryInfos.clear();
|
|
localCacheParentCountNodes.clear();
|
|
localCacheParentCountNodes.clear();
|
|
|
|
+ localCacheQueryInfoAll.clear();
|
|
|
|
|
|
//清除RedisWbs树节点缓存(此处的Redis为每层懒加载缓存)
|
|
//清除RedisWbs树节点缓存(此处的Redis为每层懒加载缓存)
|
|
Set<String> keysByNodes = redisTemplate.keys("blade-manager::contract:wbstree:*");
|
|
Set<String> keysByNodes = redisTemplate.keys("blade-manager::contract:wbstree:*");
|
|
@@ -1277,12 +1281,21 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
List<String> pKeyIds = lowestNodes.stream().map(WbsTreeContractVO8::getPKeyId).map(String::valueOf).collect(Collectors.toList());
|
|
List<String> pKeyIds = lowestNodes.stream().map(WbsTreeContractVO8::getPKeyId).map(String::valueOf).collect(Collectors.toList());
|
|
List<List<String>> partition = Lists.partition(pKeyIds, 1000);
|
|
List<List<String>> partition = Lists.partition(pKeyIds, 1000);
|
|
for (List<String> items : partition) {
|
|
for (List<String> items : partition) {
|
|
- String sql = "SELECT wtc.id AS treeId,wtc.p_key_id AS primaryKeyId,wtc.ancestors AS ancestors,wtc.major_data_type AS majorDataType," +
|
|
|
|
|
|
+ /*String sql = "SELECT wtc.id AS treeId,wtc.p_key_id AS primaryKeyId,wtc.ancestors AS ancestors,wtc.major_data_type AS majorDataType," +
|
|
" wtc.node_type AS nodeType,IFNULL(if(length(trim(wtc.full_name)) > 0, wtc.full_name, wtc.node_name), wtc.node_name) AS title," +
|
|
" wtc.node_type AS nodeType,IFNULL(if(length(trim(wtc.full_name)) > 0, wtc.full_name, wtc.node_name), wtc.node_name) AS title," +
|
|
" wtc.parent_id AS parentId,uiq.id AS informationQueryId,IFNULL(uiq.status, 0) AS status,uiq.type AS queryType," +
|
|
" wtc.parent_id AS parentId,uiq.id AS informationQueryId,IFNULL(uiq.status, 0) AS status,uiq.type AS queryType," +
|
|
" CASE WHEN uiq.pdf_trial_url IS NULL THEN FALSE ELSE TRUE end AS isExperiment FROM m_wbs_tree_contract AS wtc" +
|
|
" CASE WHEN uiq.pdf_trial_url IS NULL THEN FALSE ELSE TRUE end AS isExperiment FROM m_wbs_tree_contract AS wtc" +
|
|
" LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = " + contract.getContractType() +
|
|
" LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id AND uiq.classify = " + contract.getContractType() +
|
|
- " AND uiq.is_deleted = 0 AND wtc.is_deleted = 0 AND wtc.status = 1 WHERE wtc.p_key_id IN (" + org.apache.commons.lang.StringUtils.join(items, ",") + ")";
|
|
|
|
|
|
+ " AND uiq.is_deleted = 0 AND wtc.is_deleted = 0 AND wtc.status = 1 WHERE wtc.p_key_id IN (" + org.apache.commons.lang.StringUtils.join(items, ",") + ")";*/
|
|
|
|
+
|
|
|
|
+ String sql = "SELECT wtc.p_key_id AS primaryKeyId,uiq.type AS queryType " +
|
|
|
|
+ " FROM m_wbs_tree_contract AS wtc" +
|
|
|
|
+ " LEFT JOIN u_information_query AS uiq ON wtc.p_key_id = uiq.wbs_id" +
|
|
|
|
+ " AND uiq.classify = " + contract.getContractType() +
|
|
|
|
+ " AND uiq.is_deleted = 0 " +
|
|
|
|
+ " WHERE wtc.p_key_id IN (" + org.apache.commons.lang.StringUtils.join(items, ",") + ") " +
|
|
|
|
+ " AND wtc.is_deleted = 0 AND wtc.status = 1 ";
|
|
|
|
+
|
|
List<QueryProcessDataVO> result = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(QueryProcessDataVO.class));
|
|
List<QueryProcessDataVO> result = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(QueryProcessDataVO.class));
|
|
if (result.size() > 0) {
|
|
if (result.size() > 0) {
|
|
queryDataResult.addAll(result);
|
|
queryDataResult.addAll(result);
|
|
@@ -1297,7 +1310,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
queryDataResult = queryDataResult.stream().filter(qdr -> "3".equals(qdr.getQueryType())).collect(Collectors.toList());
|
|
queryDataResult = queryDataResult.stream().filter(qdr -> "3".equals(qdr.getQueryType())).collect(Collectors.toList());
|
|
} else {
|
|
} else {
|
|
List<String> treeIds = queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList());
|
|
List<String> treeIds = queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList());
|
|
- List<TreeContractFirst> firstList = jdbcTemplate.query("SELECT * FROM u_tree_contract_first WHERE is_deleted = 0 AND wbs_node_id IN (" + org.apache.commons.lang.StringUtils.join(treeIds, ",") + ")", new BeanPropertyRowMapper<>(TreeContractFirst.class));
|
|
|
|
|
|
+ List<TreeContractFirst> firstList = jdbcTemplate.query("SELECT wbs_node_id FROM u_tree_contract_first WHERE is_deleted = 0 AND wbs_node_id IN (" + org.apache.commons.lang.StringUtils.join(treeIds, ",") + ")", new BeanPropertyRowMapper<>(TreeContractFirst.class));
|
|
List<String> list = firstList.stream().map(fl -> (fl.getWbsNodeId() + "")).collect(Collectors.toList());
|
|
List<String> list = firstList.stream().map(fl -> (fl.getWbsNodeId() + "")).collect(Collectors.toList());
|
|
queryDataResult = queryDataResult.stream().filter(qdr -> list.contains(qdr.getPrimaryKeyId())).collect(Collectors.toList());
|
|
queryDataResult = queryDataResult.stream().filter(qdr -> list.contains(qdr.getPrimaryKeyId())).collect(Collectors.toList());
|
|
}
|
|
}
|
|
@@ -1306,6 +1319,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (submitNodeKeyIds.size() <= 0) {
|
|
|
|
+ throw new ServiceException("未获取到节点信息");
|
|
|
|
+ }
|
|
|
|
+
|
|
vo.setWbsIds(submitNodeKeyIds);
|
|
vo.setWbsIds(submitNodeKeyIds);
|
|
|
|
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(vo.getContractIdRelation())) {
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(vo.getContractIdRelation())) {
|
|
@@ -1337,9 +1354,24 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
vo.setTaskStatus(vo.getStatus().toString());
|
|
vo.setTaskStatus(vo.getStatus().toString());
|
|
}
|
|
}
|
|
|
|
|
|
- //获取全部数据
|
|
|
|
- List<InformationQuery> result = baseMapper.selectInformationQueryPageTwo(vo);
|
|
|
|
|
|
+ /*获取当前资料缓存*/
|
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
|
+ List<InformationQuery> result = localCacheQueryInfoAll.get(vo.getContractId().toString() + "_" + vo.getClassifyType());
|
|
|
|
+ if (result == null || result.size() <= 0) {
|
|
|
|
+ result = baseMapper.selectInformationQueryPageTwo(vo);
|
|
|
|
+ localCacheQueryInfoAll.put(vo.getContractId().toString() + "_" + vo.getClassifyType(), result);
|
|
|
|
+ }
|
|
|
|
+ long endTime = System.currentTimeMillis();
|
|
|
|
+ long executionTime = endTime - startTime;
|
|
|
|
+ _logger.info("合同段 " + node.getContractId() + " 获取当前资料缓存 执行时间:" + executionTime + " ms");
|
|
|
|
+
|
|
if (result != null && result.size() != 0) {
|
|
if (result != null && result.size() != 0) {
|
|
|
|
+
|
|
|
|
+ /*所查节点对应资料信息*/
|
|
|
|
+ result = result.stream()
|
|
|
|
+ .filter(informationQuery -> vo.getWbsIds().contains(informationQuery.getWbsId().toString()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
//属于待审批、已审批状态任务Task信息,以及当前任务对应的副任务TaskParallel信息
|
|
//属于待审批、已审批状态任务Task信息,以及当前任务对应的副任务TaskParallel信息
|
|
Map<String, List<Task>> taskMaps = new HashMap<>();
|
|
Map<String, List<Task>> taskMaps = new HashMap<>();
|
|
Map<String, List<TaskParallel>> taskParallelMaps = new HashMap<>();
|
|
Map<String, List<TaskParallel>> taskParallelMaps = new HashMap<>();
|
|
@@ -1364,7 +1396,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
}
|
|
}
|
|
List<InformationQuery> informationQueries = new ArrayList<>();
|
|
List<InformationQuery> informationQueries = new ArrayList<>();
|
|
if (ids.size() > 0) {
|
|
if (ids.size() > 0) {
|
|
- informationQueries = jdbcTemplate.query("SELECT * FROM u_information_query WHERE id IN(" + StringUtils.join(ids, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
|
|
|
+ informationQueries = jdbcTemplate.query("SELECT id FROM u_information_query WHERE id IN(" + StringUtils.join(ids, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
}
|
|
}
|
|
|
|
|
|
List<InformationQueryVO> voResult = JSONArray.parseArray(JSONObject.toJSONString(result), InformationQueryVO.class);
|
|
List<InformationQueryVO> voResult = JSONArray.parseArray(JSONObject.toJSONString(result), InformationQueryVO.class);
|
|
@@ -1449,17 +1481,13 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
return page;
|
|
return page;
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- /**
|
|
|
|
- * 资料查询
|
|
|
|
- * @author liuyc
|
|
|
|
- * @date 2024年1月6日10:23:14
|
|
|
|
- * @description
|
|
|
|
- * 处理资料查询,page资料填报数据与节点顺序同步展示问题,查询出当前选择节点下所有资料填报信息,
|
|
|
|
- * 然后匹配节点位置信息,不分页查询page数据,分页查询会导致数据匹配异常,处理完匹配后,再分页返回。
|
|
|
|
- */
|
|
|
|
- //获取选择的节点下的所有子节点信息
|
|
|
|
|
|
+ long startTime_1 = System.currentTimeMillis();
|
|
WbsTreeContract oldSelectedNode = BeanUtil.copyProperties(node, WbsTreeContract.class);
|
|
WbsTreeContract oldSelectedNode = BeanUtil.copyProperties(node, WbsTreeContract.class);
|
|
- List<WbsTreeContract> treeAll = this.getChildNodesZL(oldSelectedNode);
|
|
|
|
|
|
+ List<WbsTreeContract> treeAll = this.getChildNodesZL(oldSelectedNode); //按照顺序获取选择的节点下的所有子节点信息
|
|
|
|
+ long endTime_1 = System.currentTimeMillis();
|
|
|
|
+ long executionTime_1 = endTime_1 - startTime_1;
|
|
|
|
+ _logger.info("合同段 " + node.getContractId() + " 获取选择的节点下的所有子节点信息 执行时间:" + executionTime_1 + " ms");
|
|
|
|
+
|
|
if (treeAll == null) {
|
|
if (treeAll == null) {
|
|
treeAll = new ArrayList<>();
|
|
treeAll = new ArrayList<>();
|
|
}
|
|
}
|
|
@@ -1604,13 +1632,16 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
private void recursionGetChildNodesZL(List<WbsTreeContract> list, List<WbsTreeContract> result, String contractId) {
|
|
private void recursionGetChildNodesZL(List<WbsTreeContract> list, List<WbsTreeContract> result, String contractId) {
|
|
List<Long> ids = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
|
|
List<Long> ids = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
|
|
if (ids.size() > 0) {
|
|
if (ids.size() > 0) {
|
|
- //构建以parent_id为key的Map
|
|
|
|
Map<Long, List<WbsTreeContract>> queryMap = jdbcTemplate.query(
|
|
Map<Long, List<WbsTreeContract>> queryMap = jdbcTemplate.query(
|
|
"SELECT id,p_key_id,parent_id,sort,create_time," +
|
|
"SELECT id,p_key_id,parent_id,sort,create_time," +
|
|
"IFNULL(if(LENGTH (trim(full_name)) > 0, full_name, node_name), node_name) AS fullName " +
|
|
"IFNULL(if(LENGTH (trim(full_name)) > 0, full_name, node_name), node_name) AS fullName " +
|
|
- "FROM m_wbs_tree_contract WHERE type = 1 AND status = 1 AND is_deleted = 0 " +
|
|
|
|
|
|
+ "FROM m_wbs_tree_contract " +
|
|
|
|
+ "WHERE type = 1 " +
|
|
|
|
+ "AND status = 1 " +
|
|
|
|
+ "AND is_deleted = 0 " +
|
|
|
|
+ "AND contract_id = " + contractId + " " +
|
|
"AND parent_id IN (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ") " +
|
|
"AND parent_id IN (" + org.apache.commons.lang.StringUtils.join(ids, ",") + ") " +
|
|
- "AND contract_id = " + contractId + " ORDER BY sort,fullName,create_time",
|
|
|
|
|
|
+ "ORDER BY sort,fullName,create_time",
|
|
rs -> {
|
|
rs -> {
|
|
Map<Long, List<WbsTreeContract>> map = new LinkedHashMap<>();
|
|
Map<Long, List<WbsTreeContract>> map = new LinkedHashMap<>();
|
|
while (rs.next()) {
|
|
while (rs.next()) {
|
|
@@ -1629,7 +1660,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|
|
});
|
|
});
|
|
- //按照ids的顺序加入result
|
|
|
|
for (Long id : ids) {
|
|
for (Long id : ids) {
|
|
if (queryMap != null && queryMap.containsKey(id)) {
|
|
if (queryMap != null && queryMap.containsKey(id)) {
|
|
List<WbsTreeContract> nodes = queryMap.get(id);
|
|
List<WbsTreeContract> nodes = queryMap.get(id);
|
|
@@ -1640,5 +1670,4 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|