浏览代码

7/28日修改bug

chendayu 2 年之前
父节点
当前提交
ecacbb3d65

+ 8 - 9
PAS/src/main/java/cn/cslg/pas/common/utils/PatentRightUtils.java

@@ -21,7 +21,6 @@ public class PatentRightUtils {
 
     public static List<PatentRight> formatPatentRight(PatentRightParams params) {
         try {
-
             //国家
             String country = params.getPatentNo().substring(0, 2);
             //原文
@@ -29,19 +28,19 @@ public class PatentRightUtils {
             //译文
             String contentOut = params.getContentOut();
 
-            //创建一个权要集合
+            //创建一个权要集合用于返回结果
             ArrayList<PatentRight> patentRights = new ArrayList<>();
 
-            //若原文为null或空串,则直接结束并返回空集合;若译文为null,则置为空串
+            //若原文为null或空串,则直接结束并返回空集合;
             if (content == null || content.equals("")) {
                 return patentRights;
             }
-
+            //若译文为null,则置为空串
             if (contentOut == null) {
                 contentOut = "";
             }
 
-            //将原文和译文的所有换行符 "\r\n"或是"\n" 替换成 "@",这样首先可以使得全文连在一起,其次再根据特殊符号@拆分权要
+            //将原文和译文的所有换行符 "\r\n"或是"\n" 替换成 "@"(先使得全文连在一起,再根据特殊符号@拆分权要)
             if (content.contains("\r\n")) {
                 content = content.replaceAll("\r\n", "@");
             }
@@ -63,13 +62,13 @@ public class PatentRightUtils {
             if (country.equals("CN") || country.equals("JP") || country.equals("KR") || content.contains("权利要求")) {
                 String regex;
                 if (content.contains("@2")) {
-                    regex = "@[0-9]+";
+                    regex = "@[1-9]+";
                 } else if (content.contains("@[00")) {
                     regex = "@\\[[0-9]+]";
                 } else if (content.contains("@請求項")) {
-                    regex = "@【請求項[0-9]+】";
+                    regex = "@【請求項[1-9]+】";
                 } else if (content.contains("@청구항")) {
-                    regex = "@청구항 [0-9]+";
+                    regex = "@청구항 [1-9]+";
                 } else {
                     regex = "";
                 }
@@ -185,7 +184,7 @@ public class PatentRightUtils {
 
                 String regex;
                 if (content.contains("@")) {
-                    regex = "@[0-9]+";
+                    regex = "@[1-9]+";
                 } else if (content.contains("[001]")) {
                     regex = "\\[[0-9]+]";
                 } else {

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

@@ -448,10 +448,10 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
             PatentRight patentRight = new PatentRight()
                     .setPatentId(params.getPatentId())
                     .setContent(params.getContent())
-                    .setContentOut(params.getContentOut())
-                    .setType(1)
-                    .setSort(0)
-                    .setParentSort("-1");
+                    .setContentOut(params.getContentOut());
+            //.setType(1)
+            //.setSort(0)
+            //.setParentSort("-1");
             if (patentRight.getContent() != null && !patentRight.getContent().equals("")) {
                 this.deleteByPatentId(patentRight.getPatentId());
                 this.saveOrUpdate(patentRight);

+ 4 - 0
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/ExcutePatentDataExcel.java

@@ -61,6 +61,10 @@ public class ExcutePatentDataExcel implements IExcutePatentData {
                 PatentData patentData = ReadExcelUtils.readExcelOneRow(filePath, sheet, i + 1);
                 //调用装载数据类(根据数据源配置文件对象和专利源数据生成专利数据)
                 UploadParamsVO uploadParamsVO = excuteDataToVOService.fileToPatentVO(patentData, jsonData);
+                //如果是中国专利,就将申请号作为专利号
+                if (uploadParamsVO.getPatent().getPatentNo().contains("CN")) {
+                    uploadParamsVO.getPatent().setPatentNo(uploadParamsVO.getPatent().getApplicationNo());  //将申请号设为专利号patentNo
+                }
 
                 //专利丢入消费者队列,并唤醒消费者线程
                 pantentQueueService.patentToQueue(task, uploadParamsVO);

+ 6 - 4
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/ExcutePatentDataStar.java

@@ -723,9 +723,10 @@ public class ExcutePatentDataStar implements IExcutePatentData {
                     if (pQueueData != null && pQueueData.getCallNum() < 2) {
                         pQueueData.setCallNum(pQueueData.getCallNum() + 1);
                         pantentQueueService.rightToPQueue(pQueueData);
+                        recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 2);
                         return false;
                     }
-                    recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 2);
+                    recordQuestionPatent(applicationNo, null, 2);
                     return true;
                 }
 
@@ -789,9 +790,10 @@ public class ExcutePatentDataStar implements IExcutePatentData {
                     if (pQueueData != null && pQueueData.getCallNum() < 2) {
                         pQueueData.setCallNum(pQueueData.getCallNum() + 1);
                         pantentQueueService.rightToPQueue(pQueueData);
+                        recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 3);
                         return false;
                     }
-                    recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 3);
+                    recordQuestionPatent(applicationNo, null, 3);
                     return true;
                 }
 
@@ -848,7 +850,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
 
                     //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
                     if (pdfUrlStr.equals("")) {
-                        recordQuestionPatent(starPatent.getPatentNo(), task.getId(), 4);
+                        recordQuestionPatent(starPatent.getApplicationNo(), task.getId(), 4);
                         return;
                     }
 
@@ -884,7 +886,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
 
                     //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
                     if (pdfUrl.equals("") || pdfUrl.equals("{}")) {
-                        recordQuestionPatent(starPatent.getPatentNo(), task.getId(), 4);
+                        recordQuestionPatent(starPatent.getApplicationNo(), task.getId(), 4);
                         return;
                     }
 

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/PantentQueueService.java

@@ -842,7 +842,7 @@ public class PantentQueueService {
      */
     public void saveQuestionRecord(QueueData queueData, Integer cell) {
         QuestionRecord questionRecord = new QuestionRecord()
-                .setPatentNo(queueData.getUploadParamsVO().getPatent().getPatentNo())
+                .setPatentNo(queueData.getUploadParamsVO().getPatent().getApplicationNo())
                 .setTaskId(queueData.getTask().getId())
                 .setCell(cell);
         questionRecordService.save(questionRecord);