Bladeren bron

解决内存溢出问题

chendayu 2 jaren geleden
bovenliggende
commit
abebf601a4
1 gewijzigde bestanden met toevoegingen van 14 en 14 verwijderingen
  1. 14 14
      PAS/src/main/java/cn/cslg/pas/service/patentPDF/PatentPDFService.java

+ 14 - 14
PAS/src/main/java/cn/cslg/pas/service/patentPDF/PatentPDFService.java

@@ -30,26 +30,26 @@ import java.util.List;
 @Slf4j
 @Service
 public class PatentPDFService extends ServiceImpl<PatentInstructionMapper, PatentInstruction> {
-    private final PatentInstructionService patentInstructionService;
+    //private final PatentInstructionService patentInstructionService;
     private final FileUtils fileUtils;
 
     public void queryPatentPdfFirstPages(List<String> patentNos) throws IOException {
         log.info("开始处理【导出多件专利pdf首页】的业务,业务参数为patentNos:{}", patentNos);
 
         //根据专利号patentNos查询出所有pdf文档数据
-        List<PatentInstruction> patentInstructions = patentInstructionService.list(new LambdaQueryWrapper<PatentInstruction>().in(PatentInstruction::getPatentNo, patentNos));
-
-        for (PatentInstruction patentInstruction : patentInstructions) {
-            String filePath = fileUtils.getSystemPath() + patentInstruction.getUrl();
-            PDDocument doc = PDDocument.load(new File(filePath));
-            Splitter splitter = new Splitter();
-            splitter.setStartPage(1);
-            splitter.setEndPage(1);
-            PDDocument neededDoc = splitter.split(doc).get(0);
-            File pdfFirstPageFile = new File("合并多件专利的pdf首页.pdf");
-            neededDoc.save(pdfFirstPageFile);
-
-        }
+//        List<PatentInstruction> patentInstructions = patentInstructionService.list(new LambdaQueryWrapper<PatentInstruction>().in(PatentInstruction::getPatentNo, patentNos));
+//
+//        for (PatentInstruction patentInstruction : patentInstructions) {
+//            String filePath = fileUtils.getSystemPath() + patentInstruction.getUrl();
+//            PDDocument doc = PDDocument.load(new File(filePath));
+//            Splitter splitter = new Splitter();
+//            splitter.setStartPage(1);
+//            splitter.setEndPage(1);
+//            PDDocument neededDoc = splitter.split(doc).get(0);
+//            File pdfFirstPageFile = new File("合并多件专利的pdf首页.pdf");
+//            neededDoc.save(pdfFirstPageFile);
+//
+//        }
 
     }