chendayu 2 سال پیش
والد
کامیت
c7afde08ec

+ 6 - 5
PAS/src/main/java/cn/cslg/pas/service/getPatentStarPart/GetPatentStarPartService.java

@@ -13,9 +13,9 @@ import cn.cslg.pas.service.upLoadPatent.ExcutePatentDataStar;
 import com.alibaba.fastjson.JSON;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
-import sun.misc.BASE64Encoder;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -132,7 +132,7 @@ public class GetPatentStarPartService {
 
             //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
             if (pdfUrlStr.equals("")) {
-                excutePatentDataStar.recordQuestionPatent(applicationNo, 4);
+                excutePatentDataStar.recordQuestionPatent(applicationNo, null, 4);
                 return new PatentDTO();
             }
 
@@ -177,7 +177,7 @@ public class GetPatentStarPartService {
 
             //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
             if (pdfUrl.equals("") || pdfUrl.equals("{}")) {
-                excutePatentDataStar.recordQuestionPatent(applicationNo, 4);
+                excutePatentDataStar.recordQuestionPatent(applicationNo, null, 4);
                 return new PatentDTO();
             }
 
@@ -422,8 +422,9 @@ public class GetPatentStarPartService {
         in.close();
 
         byte[] bytes = outputStream.toByteArray();
-        BASE64Encoder encoder = new BASE64Encoder();
-        String data = encoder.encode(bytes);
+        //BASE64Encoder encoder = new BASE64Encoder();
+        //String data = encoder.encode(bytes);
+        String data = Base64.encodeBase64String(bytes);
         return data;
     }
 

+ 8 - 7
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/ExcutePatentDataStar.java

@@ -724,7 +724,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
                         pantentQueueService.rightToPQueue(pQueueData);
                         return false;
                     }
-                    recordQuestionPatent(applicationNo, 2);
+                    recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 2);
                     return true;
                 }
 
@@ -790,7 +790,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
                         pantentQueueService.rightToPQueue(pQueueData);
                         return false;
                     }
-                    recordQuestionPatent(applicationNo, 3);
+                    recordQuestionPatent(applicationNo, pQueueData.getTask().getId(), 3);
                     return true;
                 }
 
@@ -827,7 +827,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
      * @param starPatent     专利之星著录对象
      * @param uploadParamsVO 专利实体类对象
      */
-    public void setPatentInstructionPDF(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
+    public void setPatentInstructionPDF(StarPatentVO starPatent, UploadParamsVO uploadParamsVO, Task task) throws IOException {
         try {
             String pdfUrl = "", pdfUrl1 = "", pdfUrl2 = "";
             if ((starPatent.getPatentNo() != null && !starPatent.getPatentNo().equals("")) || (starPatent.getApplicationNo() != null && !starPatent.getApplicationNo().equals(""))) {
@@ -841,7 +841,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
 
                     //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
                     if (pdfUrlStr.equals("")) {
-                        recordQuestionPatent(starPatent.getPatentNo(), 4);
+                        recordQuestionPatent(starPatent.getPatentNo(), task.getId(), 4);
                         return;
                     }
 
@@ -877,7 +877,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
 
                     //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
                     if (pdfUrl.equals("") || pdfUrl.equals("{}")) {
-                        recordQuestionPatent(starPatent.getPatentNo(), 4);
+                        recordQuestionPatent(starPatent.getPatentNo(), task.getId(), 4);
                         return;
                     }
 
@@ -1108,13 +1108,14 @@ public class ExcutePatentDataStar implements IExcutePatentData {
      * 记录没有数据的专利信息
      *
      * @param applicationNoOrPatentNo 公开号/申请号
+     * @param taskId                  任务id
      * @param cell                    失败字段(1著录 2权要 3说明书文本 4说明书pdf 5摘要附图)
      */
-    public void recordQuestionPatent(String applicationNoOrPatentNo, int cell) {
+    public void recordQuestionPatent(String applicationNoOrPatentNo, Integer taskId, int cell) {
         QuestionRecord questionRecord = new QuestionRecord()
                 .setPatentNo(applicationNoOrPatentNo)
                 .setCell(cell)
-                .setTaskId(-1)
+                .setTaskId(taskId)
                 .setRemark("该申请号的该字段(2权要 3说明书文本 4说明书pdf)接口检索返回原始数据为空");
         List<QuestionRecord> questionRecords = questionRecordService.list(new LambdaQueryWrapper<QuestionRecord>().eq(QuestionRecord::getPatentNo, applicationNoOrPatentNo).eq(QuestionRecord::getCell, cell).eq(QuestionRecord::getTaskId, -1));
         if (questionRecords == null || questionRecords.size() == 0) {

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

@@ -299,7 +299,7 @@ public class PantentQueueService {
 
                     //专利之星
                     if (task.getType() == 4) {
-                        excutePatentDataStar.setPatentInstructionPDF(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO());
+                        excutePatentDataStar.setPatentInstructionPDF(pQueueData.getStarPatent(), pQueueData.getUploadParamsVO(), task);
                     }
 
                     queueData.setUploadParamsVO(pQueueData.getUploadParamsVO());