瀏覽代碼

优化节点复制数据时节点参数元素判断逻辑

lvy 5 天之前
父節點
當前提交
cb0f601cae

+ 4 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -2643,16 +2643,16 @@ private Map<String, String> reviseValue(WbsTreeContract wtc, WbsTreeContract par
 //                    map.putAll(paramKey.stream().map(m -> m.get("ek").toString()).collect(Collectors.toMap(s -> s, s -> StringPool.NULL)));
 //                }
             // 关联了节点参数公式的元素在打开表单的时候会去执行公式
-            Long privateKeyId = wtc.getIsTypePrivatePid();
-            if (privateKeyId != null && privateKeyId > 0) {
+            if (parent != null && parent.getIsTypePrivatePid() != null && parent.getIsTypePrivatePid() > 0) {
+                Long privateKeyId = parent.getIsTypePrivatePid();
                 List<WbsTreePrivate> query = jdbcTemplate.query("select * from m_wbs_tree_private where p_key_id= ? and is_deleted = 0 limit 1", new Object[]{privateKeyId},
                         new BeanPropertyRowMapper<>(WbsTreePrivate.class));
                 if (!query.isEmpty() && query.get(0) != null) {
                     WbsTreePrivate publicWtp = query.get(0);
                     List<Map<String, Object>> paramKey = this.jdbcTemplate.queryForList("select DISTINCT b.e_key ek from m_table_info a  join m_wbs_form_element b on a.id=b.f_id  " +
                             "join m_element_formula_mapping c on b.id = c.element_id where a.tab_en_name='" + tableName + "' and b.is_deleted=0 and c.scope=35 and c.is_deleted=0" +
-                            " and c.param_id in ( select id from m_wbs_param where node_id in ( ? , ? , ?) and type = 1 and is_deleted = 0 )",
-                            publicWtp.getTreePId(), publicWtp.getId(), privateKeyId);
+                            " and c.param_id in ( select id from m_wbs_param where node_id in ( ? , ?) and type = 1 and is_deleted = 0 )",
+                            publicWtp.getTreePId(), privateKeyId);
                     if (!paramKey.isEmpty()) {
                         map.putAll(paramKey.stream().map(m -> m.get("ek").toString()).collect(Collectors.toMap(s -> s, s -> StringPool.NULL)));
                     }