Kaynağa Gözat

根据多个专利号生成这些专利的说明书pdf首页,拼成的一个大pdf

chendayu 2 yıl önce
ebeveyn
işleme
0d48bd7b3f

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/common/PatentRightContent.java

@@ -32,7 +32,7 @@ public class PatentRightContent implements Serializable {
      */
     private String contentOut;
     /**
-     * 类型
+     * 类型(1主权要 0附权要 -1出错权要)
      */
     private Integer type;
 

+ 12 - 8
PAS/src/main/java/cn/cslg/pas/service/PatentRightService.java

@@ -502,6 +502,8 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
 
         //装载权要原文
         PatentRightParams params = new PatentRightParams();
+        params.setPatentId(patentId);
+        params.setPatentNo(patent.getPatentNo());
         //对获得的权利要求集合,判断集合元素个数若为1则为原文文本;若大于1则为已经拆分了的多个权要文本,此时就将其合并回原文文本
         if (patentRights.size() == 1) {
             params.setContent(patentRights.get(0).getContent());
@@ -520,20 +522,22 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
 
         List<TreeNode> treeNodeList = new ArrayList<>();
 
-        //判断若处理后的权要集合只有1个元素,则表示本次权要处理失败,则直接返回整个权要
-        if (patentRightContents.size() == 1) {
-            ArrayList<Integer> parentSorts = new ArrayList<>();
-            parentSorts.add(-1);
-            treeNodeList.add(new TreeNode(0, parentSorts, patentRightContents.get(0).getContent()).setChildren(new ArrayList<TreeNode>()));
+        //判断若处理后的权要集合只有1个元素并且类型type=-1、排序号sort=-1,则表示本次拆分失败,则直接返回整个权要
+        if (patentRightContents.size() == 1 && patentRightContents.get(0).getType() == -1 && patentRightContents.get(0).getSort() == -1) {
+            treeNodeList.add(new TreeNode(patentRightContents.get(0).getSort(), null, patentRightContents.get(0).getContent()));
             return treeNodeList;
         }
 
-        //开始进行权要树装载
         for (PatentRightContent patentRightContent : patentRightContents) {
             treeNodeList.add(new TreeNode(patentRightContent.getSort(), patentRightContent.getParentSorts(), patentRightContent.getContent()));
         }
-        TreeBuild treeBuild = new TreeBuild(treeNodeList);
-        treeNodeList = treeBuild.buildTree();
+        //开始进行权要树装载
+        try {
+            TreeBuild treeBuild = new TreeBuild(treeNodeList);
+            treeNodeList = treeBuild.buildTree();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         return treeNodeList;
 
     }

+ 13 - 1
PAS/src/main/java/cn/cslg/pas/service/patentRightSplit/PatentRightSplitCNService.java

@@ -2,6 +2,9 @@ package cn.cslg.pas.service.patentRightSplit;
 
 import cn.cslg.pas.common.PatentRightContent;
 import cn.cslg.pas.common.model.params.PatentRightParams;
+import cn.cslg.pas.domain.QuestionRecord;
+import cn.cslg.pas.service.upLoadPatent.QuestionRecordService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -15,8 +18,10 @@ import java.util.regex.Pattern;
  * @author chenyu
  * @date 2023/8/30
  */
+@RequiredArgsConstructor
 @Service
 public class PatentRightSplitCNService implements PatentRightSplitService {
+    private final QuestionRecordService questionRecordService;
 
     @Override
     public List<PatentRightContent> formatPatentRight(PatentRightParams params) {
@@ -127,8 +132,15 @@ public class PatentRightSplitCNService implements PatentRightSplitService {
             return patentRightContents;
         } catch (Exception e) {
             e.printStackTrace();
+            //1.记录当前拆分出错专利,记住问题记录表"question_records"
+            QuestionRecord questionRecord = new QuestionRecord()
+                    .setPatentNo(params.getPatentNo())
+                    .setRemark("查询权要树时拆分出错")
+                    .setCell(-1);
+            questionRecordService.save(questionRecord);
+            //2.返回原文
             ArrayList<PatentRightContent> patentRightContents = new ArrayList<>();
-            patentRightContents.add(new PatentRightContent().setContent(params.getContent()));
+            patentRightContents.add(new PatentRightContent().setSort(-1).setType(-1).setContent(params.getContent()));
             return patentRightContents;
         }
 

+ 13 - 1
PAS/src/main/java/cn/cslg/pas/service/patentRightSplit/PatentRightSplitENService.java

@@ -2,6 +2,9 @@ package cn.cslg.pas.service.patentRightSplit;
 
 import cn.cslg.pas.common.PatentRightContent;
 import cn.cslg.pas.common.model.params.PatentRightParams;
+import cn.cslg.pas.domain.QuestionRecord;
+import cn.cslg.pas.service.upLoadPatent.QuestionRecordService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -15,8 +18,10 @@ import java.util.regex.Pattern;
  * @author chenyu
  * @date 2023/8/30
  */
+@RequiredArgsConstructor
 @Service
 public class PatentRightSplitENService implements PatentRightSplitService {
+    private final QuestionRecordService questionRecordService;
 
     @Override
     public List<PatentRightContent> formatPatentRight(PatentRightParams params) {
@@ -122,8 +127,15 @@ public class PatentRightSplitENService implements PatentRightSplitService {
             return patentRightContents;
         } catch (Exception e) {
             e.printStackTrace();
+            //1.记录当前拆分出错专利,记住问题记录表"question_records"
+            QuestionRecord questionRecord = new QuestionRecord()
+                    .setPatentNo(params.getPatentNo())
+                    .setRemark("查询权要树时拆分出错")
+                    .setCell(-1);
+            questionRecordService.save(questionRecord);
+            //2.返回原文
             ArrayList<PatentRightContent> patentRightContents = new ArrayList<>();
-            patentRightContents.add(new PatentRightContent().setContent(params.getContent()));
+            patentRightContents.add(new PatentRightContent().setSort(-1).setType(-1).setContent(params.getContent()));
             return patentRightContents;
         }
 

+ 13 - 1
PAS/src/main/java/cn/cslg/pas/service/patentRightSplit/PatentRightSplitJPService.java

@@ -2,6 +2,9 @@ package cn.cslg.pas.service.patentRightSplit;
 
 import cn.cslg.pas.common.PatentRightContent;
 import cn.cslg.pas.common.model.params.PatentRightParams;
+import cn.cslg.pas.domain.QuestionRecord;
+import cn.cslg.pas.service.upLoadPatent.QuestionRecordService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -15,8 +18,10 @@ import java.util.regex.Pattern;
  * @author chenyu
  * @date 2023/8/30
  */
+@RequiredArgsConstructor
 @Service
 public class PatentRightSplitJPService implements PatentRightSplitService {
+    private final QuestionRecordService questionRecordService;
 
     @Override
     public List<PatentRightContent> formatPatentRight(PatentRightParams params) {
@@ -108,8 +113,15 @@ public class PatentRightSplitJPService implements PatentRightSplitService {
             return patentRightContents;
         } catch (Exception e) {
             e.printStackTrace();
+            //1.记录当前拆分出错专利,记住问题记录表"question_records"
+            QuestionRecord questionRecord = new QuestionRecord()
+                    .setPatentNo(params.getPatentNo())
+                    .setRemark("查询权要树时拆分出错")
+                    .setCell(-1);
+            questionRecordService.save(questionRecord);
+            //2.返回原文
             ArrayList<PatentRightContent> patentRightContents = new ArrayList<>();
-            patentRightContents.add(new PatentRightContent().setContent(params.getContent()));
+            patentRightContents.add(new PatentRightContent().setSort(-1).setType(-1).setContent(params.getContent()));
             return patentRightContents;
         }
 

+ 13 - 1
PAS/src/main/java/cn/cslg/pas/service/patentRightSplit/PatentRightSplitKRService.java

@@ -3,6 +3,9 @@ package cn.cslg.pas.service.patentRightSplit;
 import cn.cslg.pas.common.PatentRightContent;
 import cn.cslg.pas.common.model.params.PatentRightParams;
 import cn.cslg.pas.domain.PatentRight;
+import cn.cslg.pas.domain.QuestionRecord;
+import cn.cslg.pas.service.upLoadPatent.QuestionRecordService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -16,8 +19,10 @@ import java.util.regex.Pattern;
  * @author chenyu
  * @date 2023/8/30
  */
+@RequiredArgsConstructor
 @Service
 public class PatentRightSplitKRService implements PatentRightSplitService {
+    private final QuestionRecordService questionRecordService;
 
     @Override
     public List<PatentRightContent> formatPatentRight(PatentRightParams params) {
@@ -126,8 +131,15 @@ public class PatentRightSplitKRService implements PatentRightSplitService {
             return patentRightContents;
         } catch (Exception e) {
             e.printStackTrace();
+            //1.记录当前拆分出错专利,记住问题记录表"question_records"
+            QuestionRecord questionRecord = new QuestionRecord()
+                    .setPatentNo(params.getPatentNo())
+                    .setRemark("查询权要树时拆分出错")
+                    .setCell(-1);
+            questionRecordService.save(questionRecord);
+            //2.返回原文
             ArrayList<PatentRightContent> patentRightContents = new ArrayList<>();
-            patentRightContents.add(new PatentRightContent().setContent(params.getContent()));
+            patentRightContents.add(new PatentRightContent().setSort(-1).setType(-1).setContent(params.getContent()));
             return patentRightContents;
         }