瀏覽代碼

编写查询专题库专利pdf首页图片清单接口(已完成)

chendayu 2 年之前
父節點
當前提交
40c4cdd9ec
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      PAS/src/main/java/cn/cslg/pas/service/PatentInstructionService.java

+ 3 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentInstructionService.java

@@ -562,6 +562,7 @@ public class PatentInstructionService extends ServiceImpl<PatentInstructionMappe
 
         //遍历专利,装载数据
         for (Patent patent : patents) {
+            PatentDTO patentDTO = new PatentDTO();
             String patentNo = patent.getPatentNo();
             List<PatentInstruction> patentInstructionList = patentInstructions.stream().filter(patentInstruction -> patentInstruction.getPatentNo().equals(patentNo)).collect(Collectors.toList());
             PatentInstruction patentInstruction = new PatentInstruction();
@@ -574,6 +575,8 @@ public class PatentInstructionService extends ServiceImpl<PatentInstructionMappe
             String filePath = fileUtils.getSystemPath() + patentInstruction.getUrl();
             File pdfFile = new File(filePath);
             if (patentInstructionList.size() == 0 || !pdfFile.exists()) {  //若没有pdf或pdf文件不存在了,则跳过当前专利
+                BeanUtils.copyProperties(patent, patentDTO);
+                patentDTOs.add(patentDTO);
                 continue;
             }
 
@@ -588,7 +591,6 @@ public class PatentInstructionService extends ServiceImpl<PatentInstructionMappe
                 cyCacheUtil.deleteImgData(patentNo);  //清除缓存
             }
 
-            PatentDTO patentDTO = new PatentDTO();
             BeanUtils.copyProperties(patent, patentDTO);
             patentDTO.setPdfFirstPage(imgData);
             patentDTOs.add(patentDTO);