liuyc 2 年之前
父節點
當前提交
f22ed5c050

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSamplingRecordVO.java

@@ -40,7 +40,7 @@ public class TrialSamplingRecordVO implements Serializable {
     /**
      * 试样数量
      */
-    private Integer materialCount;
+    private String materialCount;
 
     /**
      * 是否委外 '0'=否 '1'=是

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

@@ -1362,7 +1362,6 @@ public class InformationWriteQueryController extends BladeController {
             if (ObjectUtil.isEmpty(needCopyChildNodes) || needCopyChildNodes.size() == 0) {
                 //最下层级节点复制
                 needCopyChildNodes = new ArrayList<>();
-                needCopyChildNodes.add(needCopyNode);
             }
             needCopyChildNodes.add(needCopyNode);
             List<WbsTreeContract> nodeChildAll = new ArrayList<>(needCopyChildNodes);

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java

@@ -139,7 +139,7 @@ public class TrialDetectionController extends BladeController {
     @PostMapping("/self/submit")
     @ApiOperationSupport(order = 11)
     @ApiOperation(value = "自检记录新增或修改", notes = "传入TrialSelfInspectionRecordDTO")
-    public R<Object> selfSubmit(@Valid @RequestBody TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
+    public R<Object> selfSubmit(@Valid @RequestBody TrialSelfInspectionRecordDTO dto){
         return R.data(iTrialSelfInspectionRecordService.selfSubmit(dto));
     }
 

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSelfInspectionRecordService.java

@@ -15,7 +15,7 @@ public interface ITrialSelfInspectionRecordService extends BaseService<TrialSelf
 
     IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException;
 
-    String selfSubmit(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException;
+    String selfSubmit(TrialSelfInspectionRecordDTO dto);
 
     List<TrialSampleInfoVO> selfSampleList(String id);
 

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDetectionDataServiceImpl.java

@@ -224,7 +224,7 @@ public class TrialDetectionDataServiceImpl extends BaseServiceImpl<TrialDetectio
 
         List<Map<String, String>> resultMapList = new ArrayList<>();
         //获取当前合同段下的试验节点下的表
-        WbsTreePrivate trialNode = jdbcTemplate.query("select * from m_wbs_tree_private where p_key_id =" + nodePKeyId, new BeanPropertyRowMapper<>(WbsTreePrivate.class)).stream().findAny().orElse(null);
+        WbsTreePrivate trialNode = jdbcTemplate.query("select id,project_id,wbs_id,wbs_type from m_wbs_tree_private where p_key_id =" + nodePKeyId, new BeanPropertyRowMapper<>(WbsTreePrivate.class)).stream().findAny().orElse(null);
         if (trialNode != null) {
             List<WbsTreePrivate> trialNodeTabs = jdbcTemplate.query("select p_key_id,html_url from m_wbs_tree_private where html_url is not null and is_deleted = 0 and status = 1 and type = 2 and parent_id =" + trialNode.getId() + " and project_id =" + trialNode.getProjectId() + " and wbs_id = " + trialNode.getWbsId() + " and wbs_type = " + trialNode.getWbsType() + " and (trial_tab_contract_id is null OR (trial_tab_contract_id = " + contractId + "))", new BeanPropertyRowMapper<>(WbsTreePrivate.class));
             for (WbsTreePrivate trialNodeTab : trialNodeTabs) {

+ 7 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -184,11 +184,11 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
             }
             this.saveOrUpdate(trialSampleInfo);
 
-            if (obj.getId() != null && obj.getMobilizationId() != null && obj.getMobilizationId() != -1) {
-                TrialSamplingRecord trialSamplingRecord = trialSamplingRecordMapper.selectByMobilizationIdAndSampleInfoId(obj.getMobilizationId(), obj.getId());
+            if (trialSampleInfo.getId() != null && obj.getMobilizationId() != null && obj.getMobilizationId() != -1) {
+                TrialSamplingRecord trialSamplingRecord = trialSamplingRecordMapper.selectByMobilizationIdAndSampleInfoId(obj.getMobilizationId(), trialSampleInfo.getId());
                 if (trialSamplingRecord == null) {
-                    trialSamplingRecordMapper.deleteBySampleInfoId(obj.getId());
-                    trialSamplingRecordMapper.insertRecord(SnowFlakeUtil.getId(), obj.getMobilizationId(), obj.getId());
+                    trialSamplingRecordMapper.deleteBySampleInfoId(trialSampleInfo.getId());
+                    trialSamplingRecordMapper.insertRecord(SnowFlakeUtil.getId(), obj.getMobilizationId(), trialSampleInfo.getId());
                 }
             }
         }
@@ -267,6 +267,9 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
         data.forEach(excel -> {
             TrialSampleInfo trialSampleInfo = BeanUtil.copyProperties(excel, TrialSampleInfo.class);
             if (trialSampleInfo != null) {
+                if (StringUtils.isNotEmpty(excel.getMaterialCount())) {
+                    trialSampleInfo.setMaterialCount(excel.getMaterialCount());
+                }
                 List<TrialSampleInfo> query = jdbcTemplate.query("select id,material_name from u_trial_sample_info where is_deleted = 0 and specification_number = '" + trialSampleInfo.getSpecificationNumber() + "' and contract_id = " + contractId, new BeanPropertyRowMapper<>(TrialSampleInfo.class));
                 if (query.size() > 0) {
                     TrialSampleInfo obj = query.stream().findAny().orElse(null);

+ 17 - 16
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -45,6 +45,7 @@ import org.springblade.system.entity.Dict;
 import org.springblade.system.feign.IDictClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springframework.cloud.openfeign.BladeFeignClientsRegistrar;
 import org.springframework.context.annotation.Bean;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -872,7 +873,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String selfSubmit(TrialSelfInspectionRecordDTO dto) throws FileNotFoundException {
+    public String selfSubmit(TrialSelfInspectionRecordDTO dto){
         //------初始当前填报的表pKeyIds------
         this.initTrialTabIds(dto);
 
@@ -885,26 +886,26 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
         if (ObjectUtil.isNotEmpty(dto.getId())) {
             //------获取最新试验记录------
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
-
-            //------编辑时记录表编号或报告单编号为Null的重新生成------
-            this.reBuildNumber(obj, dto);
-
-            //------保存实体表数据、试验记录信息、生成PDF------
             try {
+                //------编辑时记录表编号或报告单编号为Null的重新生成------
+                this.reBuildNumber(obj, dto);
+
+                //------保存实体表数据、试验记录信息、生成PDF------
                 this.submitTrialData(obj, dto);
-            } catch (Exception e) {
-                e.printStackTrace();
-                throw new RuntimeException("保存试验记录信息失败,请联系管理员 " + e.getMessage());
-            }
 
-            //------关联原材料检测报告------
-            this.rawMaterialSubmitRelation(dto, obj);
+                //------关联原材料检测报告------
+                this.rawMaterialSubmitRelation(dto, obj);
+
+                //------关联取样信息------
+                this.recordSampleSubmit(dto, obj);
 
-            //------关联取样信息------
-            this.recordSampleSubmit(dto, obj);
+                //------关联新增设备使用记录信息------
+                this.trialDeviceUseService.addDeviceUseInfo(dto);
 
-            //------关联新增设备使用记录信息------
-            this.trialDeviceUseService.addDeviceUseInfo(dto);
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RuntimeException(e.getMessage());
+            }
         }
         return dto.getId().toString();
     }

+ 26 - 37
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
@@ -74,47 +75,35 @@ public class ExcelTabClientImpl implements ExcelTabClient {
             TableInfo tableInfo = tableInfoList.stream().findAny().orElse(null);
             if (tableInfo != null && tabIds.contains(tableInfo.getPkeyId())) {
                 //构造pdf
-                excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id, 0, 0, dto);
-
-                //重新合并pdf
-                List<TrialSelfDataRecord> query = jdbcTemplate.query("select pdf_url from u_trial_self_data_record where record_id = " + id, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
-                List<String> pdfList = query.stream().map(TrialSelfDataRecord::getPdfUrl).collect(Collectors.toList());
-
-                String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-                String pdfPath = file_path + "/pdf//" + id + "_2.pdf";
-                File tabPdf = ResourceUtil.getFile(pdfPath);
-                if (tabPdf.exists()) {
-                    tabPdf.delete();
-                }
-                FileUtils.mergePdfPublicMethods(pdfList, pdfPath);
-                BladeFile bladeFile = newIOSSClient.uploadFile(id + "2.pdf", pdfPath);
-
-                jdbcTemplate.execute("update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "' where id = " + id);
-
-                //获取试验记录id的试验项目名称,重新合并pdf集合(解决单表保存后上报找不到题名问题)
-                TrialSelfInspectionRecord obj = jdbcTemplate.query("select trial_project_name from u_trial_self_inspection_record where id = " + id, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
-                List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
-                if (obj != null && query2.size() > 0) {
-                    jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + obj.getTrialProjectName() + "'  where classify='" + type + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'");
-                } else {
-                    if (obj != null) {
-                        informationQueryClient.saveData(id.toString(), projectId, contractId, type.toString(), bladeFile.getLink(), obj.getTrialProjectName());
+                String bussPDFTrial = excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id, 0, 0, dto);
+                if (StringUtils.isNotEmpty(bussPDFTrial)){
+                    //重新合并pdf
+                    List<TrialSelfDataRecord> query = jdbcTemplate.query("select pdf_url from u_trial_self_data_record where record_id = " + id, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
+                    List<String> pdfList = query.stream().map(TrialSelfDataRecord::getPdfUrl).collect(Collectors.toList());
+                    String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+                    String pdfPath = file_path + "/pdf//" + id + "_2.pdf";
+                    File tabPdf = ResourceUtil.getFile(pdfPath);
+                    if (tabPdf.exists()) {
+                        tabPdf.delete();
+                    }
+                    FileUtils.mergePdfPublicMethods(pdfList, pdfPath);
+                    BladeFile bladeFile = newIOSSClient.uploadFile(id + "2.pdf", pdfPath);
+                    if (bladeFile != null) {
+                        //重新合并pdf集合(解决单表保存后上报找不到题名问题)
+                        List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify ='" + type + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
+                        if (query2.size() > 0) {
+                            jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + (StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "") + "'  where classify='" + type + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'");
+                        } else {
+                            informationQueryClient.saveData(id.toString(), projectId, contractId, type.toString(), bladeFile.getLink(), (StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : ""));
+                        }
+                        pdfUrl = bladeFile.getLink();
                     }
                 }
             }
 
         } else if (isBatchSave == 1) {
-            /**
-             * ------多表PDF保存------
-             * tableType=表类型 1=记录表 2=报告单
-             * type=所属方 1=施工质检 2=监理抽检
-             * contractId=合同段id
-             * projectId=项目id
-             * id=记录id
-             * tabIds=表的pKeyIds
-             */
-            pdfUrl = excelTabService.getBussPDFSTrial(nodeId, tableType, String.valueOf(type), contractId, projectId, id, tabIds,dto);
-
+            //------多表PDF保存------
+            pdfUrl = excelTabService.getBussPDFSTrial(nodeId, tableType, String.valueOf(type), contractId, projectId, id, tabIds, dto);
         }
         return pdfUrl;
     }
@@ -126,7 +115,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
 
     @Override
     public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, String id, String tabIds) throws Exception {
-        return excelTabService.getBussPDFSTrial(nodeId, tableType, classify, contractId, projectId, Long.parseLong(id), tabIds,null);
+        return excelTabService.getBussPDFSTrial(nodeId, tableType, classify, contractId, projectId, Long.parseLong(id), tabIds, null);
     }
 
 

+ 129 - 131
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -329,9 +329,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 /*用来保存日志执行情况*/
                 StringBuilder log = new StringBuilder();
                 /*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
-                List<NodeTable> tableAll = createNodeTables(nodeId,tableInfoList.get(0).getContractId(),tableInfoList.get(0).getProjectId(),type);
+                List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type);
                 StopWatch stopWatch = new StopWatch();
-                List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId),type);
+                List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId), type);
                 if (Func.isNotEmpty(keyMappers)) {
                     Map<String, Map<String, String>> coordinateMap = createCoordinateMap(keyMappers);
                     stopWatch.start("公式处理");
@@ -354,21 +354,21 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     StaticLog.info("公式执行用时:{}", totalTime);
                     updateFormulaLog(log, wtc);
                 }
-            }catch (Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
     }
 
 
-    private  List<NodeTable> createNodeTables(Long nodeId,String contractId,String projectId,ExecuteType type){
-        List<NodeTable> tableAll =new ArrayList<>();
-        if(type.equals(ExecuteType.INSPECTION)){
+    private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type) {
+        List<NodeTable> tableAll = new ArrayList<>();
+        if (type.equals(ExecuteType.INSPECTION)) {
             List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId);
-            tableAll = BeanUtil.copyProperties(treeNode,NodeTable.class);
-        }else if(type.equals(ExecuteType.TESTING)){
+            tableAll = BeanUtil.copyProperties(treeNode, NodeTable.class);
+        } else if (type.equals(ExecuteType.TESTING)) {
             List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "9", contractId, projectId, null, null);
-             tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s,NodeTable.class);
+            tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s, NodeTable.class);
         }
         return tableAll;
     }
@@ -379,7 +379,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             if (!coordinateMap.containsKey(keyMapper.getTableName())) {
                 WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                         .eq(WbsTreeContract::getPKeyId, keyMapper.getPkId()));
-                if(wbsTreeContract!=null&&Func.isNotBlank(wbsTreeContract.getHtmlUrl())) {
+                if (wbsTreeContract != null && Func.isNotBlank(wbsTreeContract.getHtmlUrl())) {
                     coordinateMap.put(keyMapper.getTableName(), FormulaUtils.getElementCell(wbsTreeContract.getHtmlUrl()));
                 }
             }
@@ -548,7 +548,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 URL url = new URL(downloadUri);
                 String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
                 String filecode = SnowFlakeUtil.getId() + "";
-                String dataUrl=file_path + "/excel/" + filecode + ".pdf";
+                String dataUrl = file_path + "/excel/" + filecode + ".pdf";
                 java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
                 connection.setRequestMethod("GET");
                 connection.setConnectTimeout(5 * 1000);
@@ -559,8 +559,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 String tabId = callback.getKey();
                 if (tabId == null) {
                     throw new Exception("excel为空");
-                }else{
-                    tabId = tabId.substring(0,tabId.lastIndexOf("_"));
+                } else {
+                    tabId = tabId.substring(0, tabId.lastIndexOf("_"));
                 }
                 //获取数据库信息
                 ExcelTab excelTab = baseMapper.selectById(Long.parseLong(tabId));
@@ -578,7 +578,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 excelTab.setFileUrl(bladeFile.getLink());
                 baseMapper.updateById(excelTab);
                 File file = new File(dataUrl);
-                if(file.exists()){
+                if (file.exists()) {
                     file.delete();
                 }
                 System.out.println("123456");
@@ -716,7 +716,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
 
                         //获取上传的文件相关
-                            String sourceUrl = tableInfoList.get(0).getSourceUrl(),
+                        String sourceUrl = tableInfoList.get(0).getSourceUrl(),
                                 pdfUrl = tableInfoList.get(0).getPdfUrl(),
                                 firstFileName = tableInfoList.get(0).getFirstFileName();
 
@@ -956,32 +956,32 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             return dataMap;
         }
         File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
-        if(file1.exists()){
-
-
-        FileInputStream fileInputStream = new FileInputStream(file1);
-        String htmlString = IoUtil.readToString(fileInputStream);
-        Document doc = Jsoup.parse(htmlString);
-        Element table = doc.select("table").first();
-        Elements trs = table.select("tr");
-
-        for (int i = 0; i <= trs.size() - 1; i++) {
-            Element tr = trs.get(i);
-            Elements tds = tr.select("td");
-            for (int j = 0; j < tds.size(); j++) {
-                Element data = tds.get(j);
-                if (!data.children().isEmpty()) {
-                    String keyVal = i + "_" + j;
-                    String keyname = data.children().get(0).attr("keyname");
-                    if (StringUtils.isNotEmpty(keyname)) {
-                        String[] keys = keyname.split("__");
-                        String datakey = keys[0];
-                        dataMap.merge(datakey, keyVal, (v1, v2) -> v1 + ";" + v2);
+        if (file1.exists()) {
+
+
+            FileInputStream fileInputStream = new FileInputStream(file1);
+            String htmlString = IoUtil.readToString(fileInputStream);
+            Document doc = Jsoup.parse(htmlString);
+            Element table = doc.select("table").first();
+            Elements trs = table.select("tr");
+
+            for (int i = 0; i <= trs.size() - 1; i++) {
+                Element tr = trs.get(i);
+                Elements tds = tr.select("td");
+                for (int j = 0; j < tds.size(); j++) {
+                    Element data = tds.get(j);
+                    if (!data.children().isEmpty()) {
+                        String keyVal = i + "_" + j;
+                        String keyname = data.children().get(0).attr("keyname");
+                        if (StringUtils.isNotEmpty(keyname)) {
+                            String[] keys = keyname.split("__");
+                            String datakey = keys[0];
+                            dataMap.merge(datakey, keyVal, (v1, v2) -> v1 + ";" + v2);
+                        }
                     }
                 }
             }
         }
-        }
         return dataMap;
     }
 
@@ -1014,102 +1014,102 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         // 匹配关联
         try {
             File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
-            if(file1.exists()){
+            if (file1.exists()) {
 
-            String htmlString = IoUtil.readToString(new FileInputStream(file1));
-            Document doc = Jsoup.parse(htmlString);
+                String htmlString = IoUtil.readToString(new FileInputStream(file1));
+                Document doc = Jsoup.parse(htmlString);
 
-            // 解析
-            // 模糊匹配
-            Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
-            Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
-            Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
-            sgtitle.addAll(sgtitle1);
+                // 解析
+                // 模糊匹配
+                Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
+                Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
+                Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
+                sgtitle.addAll(sgtitle1);
 
-            Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
-            Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
-            htdtitle.addAll(htdtitle1);
+                Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
+                Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
+                htdtitle.addAll(htdtitle1);
 
-            Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
+                Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
 
-            Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
-            Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
-            bhtitle.addAll(bhtitle1);
+                Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+                Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
+                bhtitle.addAll(bhtitle1);
 
 
-            Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
+                Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
 
 
-            // Elements title = doc.select("el-input[placeholder~=^编号]");
+                // Elements title = doc.select("el-input[placeholder~=^编号]");
 
-            /**
-             * 承包单位 承包单位、施工单位:引用施工单位名称 ,
-             * 监理单位:引用监理单位名称
-             * 合同段、所属建设项目(合同段):引用合同段编号
-             *
-             * 施工单位:施工单位 和 安装单位
-             *
-             */
-            ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
-            // 施工单位名称
-            if (dwtitle.size() >= 1) {
-                int y = Integer.parseInt(dwtitle.attr("trindex"));
-                if (y <= 10) {
-                    reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
-                }
+                /**
+                 * 承包单位 承包单位、施工单位:引用施工单位名称 ,
+                 * 监理单位:引用监理单位名称
+                 * 合同段、所属建设项目(合同段):引用合同段编号
+                 *
+                 * 施工单位:施工单位 和 安装单位
+                 *
+                 */
+                ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
+                // 施工单位名称
+                if (dwtitle.size() >= 1) {
+                    int y = Integer.parseInt(dwtitle.attr("trindex"));
+                    if (y <= 10) {
+                        reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                    }
 
-            }
-            if (sgtitle.size() >= 1) {
-                int y = Integer.parseInt(sgtitle.attr("trindex"));
-                if (y <= 10) {
-                    reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                 }
-            }
+                if (sgtitle.size() >= 1) {
+                    int y = Integer.parseInt(sgtitle.attr("trindex"));
+                    if (y <= 10) {
+                        reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                    }
+                }
 
-            // 合同段名称
-            if (htdtitle.size() >= 1) {
-                for (Element element : htdtitle) {
-                    int trindex = Integer.parseInt(element.attr("trindex"));
-                    if (trindex <= 8) {
-                        reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                // 合同段名称
+                if (htdtitle.size() >= 1) {
+                    for (Element element : htdtitle) {
+                        int trindex = Integer.parseInt(element.attr("trindex"));
+                        if (trindex <= 8) {
+                            reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                        }
                     }
                 }
-            }
-            // 监理单位名称
-            if (jltitle.size() >= 1) {
+                // 监理单位名称
+                if (jltitle.size() >= 1) {
 
-                for (Element element : jltitle) {
-                    int trindex = Integer.parseInt(element.attr("trindex"));
-                    if (trindex <= 10) {
-                        reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
+                    for (Element element : jltitle) {
+                        int trindex = Integer.parseInt(element.attr("trindex"));
+                        if (trindex <= 10) {
+                            reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
+                        }
                     }
                 }
-            }
-            //获取父节点划分编号
-            WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                    .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
-                    .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
-            // 编号
-            if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
-                for (Element element : bhtitle) {
-                    int trindex = Integer.parseInt(element.attr("trindex"));
-                    if (trindex <= 10) {
-                        reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
+                //获取父节点划分编号
+                WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                        .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
+                        .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
+                // 编号
+                if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
+                    for (Element element : bhtitle) {
+                        int trindex = Integer.parseInt(element.attr("trindex"));
+                        if (trindex <= 10) {
+                            reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
+                        }
                     }
                 }
-            }
 
-            // 项目名称
-            if (xmtitle.size() >= 1) {
-                for (Element element : xmtitle) {
-                    int trindex = Integer.parseInt(element.attr("trindex"));
-                    if (trindex <= 6) {
-                        ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
-                        reData.put(element.attr("keyName"), projectInfo.getProjectName());
+                // 项目名称
+                if (xmtitle.size() >= 1) {
+                    for (Element element : xmtitle) {
+                        int trindex = Integer.parseInt(element.attr("trindex"));
+                        if (trindex <= 6) {
+                            ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+                            reData.put(element.attr("keyName"), projectInfo.getProjectName());
+                        }
                     }
                 }
             }
-            }
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
@@ -1170,7 +1170,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                 String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
 
                                 reData.put(key + "__" + tabData[1], strings);
-                            }else {
+                            } else {
                                 reData.put(key + "__" + tabData[1], tabData[0]);
                             }
                         }
@@ -1332,7 +1332,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                                     x1 = 1;
                                                 }
                                                 String myData = DataInfo.get(val) + "";
-                                                if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)){
+                                                if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
                                                     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                                                     sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
                                                     SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
@@ -1356,13 +1356,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                                     }
                                                 }
 
-                                                if(myData.indexOf("lang.String")>=0){
-                                                    String[]  dataDate = (String[]) DataInfo.get(val);
-                                                    myData = dataDate[0]+" - "+dataDate[1].trim();
+                                                if (myData.indexOf("lang.String") >= 0) {
+                                                    String[] dataDate = (String[]) DataInfo.get(val);
+                                                    myData = dataDate[0] + " - " + dataDate[1].trim();
                                                 }
 
                                                 //https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
-                                                if ((myData.indexOf("https") >= 0 ||myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
+                                                if ((myData.indexOf("https") >= 0 || myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
 
                                                     InputStream imageIn = CommonUtil.getOSSInputStream(myData);
 
@@ -2036,7 +2036,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
         }
 
-        org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
+        org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStream(excelTab.getFileUrl())));
         Sheet sheet = workbook.getSheetAt(0);
         sheet.setForceFormulaRecalculation(true);
         Header header = sheet.getHeader();
@@ -2386,7 +2386,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     //没有excel表单的不生成pdf
                     if (StringUtils.isNotEmpty(record.getHtmlUrl())) {
                         //生成记录表pdf
-                        String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount,null);
+                        String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount, null);
                         if (StringUtils.isNotEmpty(bussPdfInfo)) {
                             dataPdfUrls.add(bussPdfInfo);
                         }
@@ -2402,21 +2402,19 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
         FileUtils.mergePdfPublicMethods(dataPdfUrls, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
-
-        //获取试验记录id的试验项目名称
-        String trialProjectName = baseMapper.selectTrialRecordOne(id);
-
-        //修改合并后的pdf路径
-        String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
-        List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
-        if (query.size() > 0) {
-            String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + (StringUtils.isNotEmpty(trialProjectName) ? trialProjectName : "") + "'  where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
-            jdbcTemplate.execute(updateSql);
-        } else {
-            informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(trialProjectName) ? trialProjectName : "");
+        if (bladeFile != null) {
+            //修改合并后的pdf路径
+            String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
+            List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
+            if (query.size() > 0) {
+                String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + (StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "") + "'  where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
+                jdbcTemplate.execute(updateSql);
+            } else {
+                informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "");
+            }
+            return bladeFile.getLink();
         }
-
-        return bladeFile.getLink();
+        return "";
     }
 
     /**