|
@@ -72,6 +72,7 @@ import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.jdbc.core.SingleColumnRowMapper;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -726,7 +727,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
String sql = "SELECT is_custom,p_key_id,contract_id," +
|
|
|
"(SELECT is_reference_number FROM m_contract_info WHERE id="+contractId+") AS isReferenceNumber,"+
|
|
|
"(SELECT id FROM u_contract_tree_drawings WHERE process_id = p_key_id AND is_deleted = 0 limit 1) AS drawingsId," +
|
|
|
- "id,parent_id,node_type,type,wbs_type,is_buss_show as isBussShow,is_concrete,major_data_type,class_name,unit_name,node_class,unit_num,excellent_num,is_classifition,digitize_time,partition_code,old_id,contract_id_relation,is_concealed_works_node,wbs_id,sort,create_time," +
|
|
|
+ "id,parent_id,node_type,type,wbs_type,is_buss_show as isBussShow,is_concrete,major_data_type,class_name,unit_name,node_class,unit_num,excellent_num,is_classifition,digitize_time,partition_code,old_id,contract_id_relation,is_concealed_works_node,wbs_id,sort,create_time,is_type_private_pid," +
|
|
|
"CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) " +
|
|
|
"WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title," +
|
|
|
"(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1" +
|
|
@@ -810,6 +811,24 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
}
|
|
|
}
|
|
|
for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
|
|
|
+ if(lazyNodeVO.getIsCustom()!=null&&lazyNodeVO.getIsCustom()==1){
|
|
|
+ lazyNodeVO.setPrivateTemplate("当前节点为自定义节点,无法定位后管位置");
|
|
|
+ }else {
|
|
|
+ try {
|
|
|
+ if(lazyNodeVO.getIsTypePrivatePid()!=null){
|
|
|
+ String privateSql="select ancestors_p_id from m_wbs_tree_private where p_key_id="+lazyNodeVO.getIsTypePrivatePid()+" and is_deleted=0";
|
|
|
+ String ancestorsPId = jdbcTemplate.queryForObject(privateSql,new SingleColumnRowMapper<>(String.class));
|
|
|
+ String privateNodeNameSql="select node_name from m_wbs_tree_private where p_key_id in ("+ancestorsPId+")";
|
|
|
+ List<String> wbsTreePrivates = jdbcTemplate.query(privateNodeNameSql,new SingleColumnRowMapper<>(String.class));
|
|
|
+ if(wbsTreePrivates.size()>0){
|
|
|
+ String result = wbsTreePrivates.stream().collect(Collectors.joining("/"));
|
|
|
+ lazyNodeVO.setPrivateTemplate(result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ lazyNodeVO.setPrivateTemplate("");
|
|
|
+ }
|
|
|
+ }
|
|
|
lazyNodeVO.setNotExsitChild(!lazyNodeVO.getHasChildren().equals(1));
|
|
|
lazyNodeVO.setPrimaryKeyId(lazyNodeVO.getPKeyId());
|
|
|
if (lazyNodeVO.getParentId() == 0L) {
|
|
@@ -834,6 +853,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
lazyNodeVO.setColorStatus(lowestNode.getColorStatus());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return lazyNodes;
|
|
@@ -864,7 +884,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
String sql = "SELECT is_custom,p_key_id,contract_id," +
|
|
|
"(SELECT is_reference_number FROM m_contract_info WHERE id="+contractId+") AS isReferenceNumber,"+
|
|
|
"(SELECT id FROM u_contract_tree_drawings WHERE process_id = p_key_id AND is_deleted = 0 limit 1) AS drawingsId," +
|
|
|
- "id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,class_name,unit_name,node_class,unit_num,excellent_num,is_classifition,digitize_time,partition_code,old_id,contract_id_relation,is_concealed_works_node,wbs_id,sort,create_time," +
|
|
|
+ "id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,class_name,unit_name,node_class,unit_num,excellent_num,is_classifition,digitize_time,partition_code,old_id,contract_id_relation,is_concealed_works_node,wbs_id,sort,create_time,is_type_private_pid," +
|
|
|
"CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) " +
|
|
|
"WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title," +
|
|
|
"(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1" +
|
|
@@ -926,6 +946,24 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
}
|
|
|
|
|
|
for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
|
|
|
+ if(lazyNodeVO.getIsCustom()!=null&&lazyNodeVO.getIsCustom()==1){
|
|
|
+ lazyNodeVO.setPrivateTemplate("当前节点为自定义节点,无法定位后管位置");
|
|
|
+ }else {
|
|
|
+ try {
|
|
|
+ if(lazyNodeVO.getIsTypePrivatePid()!=null){
|
|
|
+ String privateSql="select ancestors_p_id from m_wbs_tree_private where p_key_id="+lazyNodeVO.getIsTypePrivatePid()+" and is_deleted=0";
|
|
|
+ String ancestorsPId = jdbcTemplate.queryForObject(privateSql,new SingleColumnRowMapper<>(String.class));
|
|
|
+ String privateNodeNameSql="select node_name from m_wbs_tree_private where p_key_id in ("+ancestorsPId+")";
|
|
|
+ List<String> wbsTreePrivates = jdbcTemplate.query(privateNodeNameSql,new SingleColumnRowMapper<>(String.class));
|
|
|
+ if(wbsTreePrivates.size()>0){
|
|
|
+ String result = wbsTreePrivates.stream().collect(Collectors.joining("/"));
|
|
|
+ lazyNodeVO.setPrivateTemplate(result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ lazyNodeVO.setPrivateTemplate("");
|
|
|
+ }
|
|
|
+ }
|
|
|
lazyNodeVO.setType(lazyNodeVO.getNodeType());
|
|
|
lazyNodeVO.setNotExsitChild(!lazyNodeVO.getHasChildren().equals(1));
|
|
|
lazyNodeVO.setPrimaryKeyId(lazyNodeVO.getPKeyId());
|
|
@@ -951,6 +989,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
lazyNodeVO.setColorStatus(lowestNode.getColorStatus());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
lazyNodesAll.addAll(lazyNodes);
|