Kaynağa Gözat

试验-保存
1、保存时过滤隐藏表单

LHB 12 saat önce
ebeveyn
işleme
0ad4050a40

+ 16 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -371,7 +371,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 /*用来保存日志执行情况*/
                 FormulaLog log = new FormulaLog();
                 /*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
-                List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type,tableInfoList.get(0).getClassify());
+                List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type,tableInfoList.get(0).getClassify(), tableInfoList.get(0).getTestGroupId());
                 if (tableAll.size() > tableInfoList.size()) {
                     TableInfo example = tableInfoList.get(0);
 
@@ -479,7 +479,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             JSONObject tableInfo = dataArray.getJSONObject(0);
             Long nodeId = tableInfo.getLong("nodeId");
             List<TableInfo> tableInfoList = this.getTableInfoList(dataArray);
-            List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type,tableInfoList.get(0).getClassify());
+            List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type,tableInfoList.get(0).getClassify(), null);
             String tableNames = tableAll.stream().map(NodeTable::getInitTableName).distinct().collect(Collectors.joining("','"));
             /*当前工序包含的所有元素信息,还未包含数据*/
             List<FormData> processFds = this.formulaService.createFormDataByTableName(tableNames);
@@ -541,7 +541,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
     }
 
-    private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type ,String tableOwner) {
+    private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type ,String tableOwner, String recordId) {
         List<NodeTable> tableAll = new ArrayList<>();
         if (type.equals(ExecuteType.INSPECTION)) {
             List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), tableOwner, contractId, projectId, null);
@@ -551,6 +551,19 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             List<WbsTreePrivateVO4> wbsTreePrivateVO = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "10", contractId, projectId, null, null);
             wbsTreePrivateVO4s.addAll(wbsTreePrivateVO);
             tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s, NodeTable.class);
+            if(recordId != null){
+                tableAll = tableAll.stream().filter(e -> e.getIsBussShow() == 1).collect(Collectors.toList());
+                List<NodeTable> nodeTables = new ArrayList<>();
+                //处理试验 过滤掉隐藏表单
+                tableAll.forEach(e -> {
+                    String sql = "select tab_id,is_buss_show,is_tab_pdf,is_tab_file_type from u_trial_self_data_record where record_id = " + recordId + " and tab_id = " + e.getPKeyId();
+                    TrialSelfDataRecord query = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
+                    if(query != null && query.getIsBussShow() == 1){
+                        nodeTables.add(e);
+                    }
+                });
+                tableAll = nodeTables;
+            }
         }
         return tableAll;
     }