|
@@ -3,10 +3,7 @@ package cn.cslg.pas.service.common;
|
|
|
import cn.cslg.pas.common.config.XDns;
|
|
|
|
|
|
import cn.cslg.pas.common.core.IgnoreDTDEntityResolver;
|
|
|
-import cn.cslg.pas.common.dto.PatentColumnDTO;
|
|
|
-import cn.cslg.pas.common.dto.PatentStarDTO;
|
|
|
-import cn.cslg.pas.common.dto.PatentStarListDTO;
|
|
|
-import cn.cslg.pas.common.dto.QueryExternalFamilyDTO;
|
|
|
+import cn.cslg.pas.common.dto.*;
|
|
|
import cn.cslg.pas.common.dto.business.SelectClaimDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
@@ -49,6 +46,7 @@ import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.io.Reader;
|
|
|
import java.io.StringReader;
|
|
@@ -1041,4 +1039,81 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
return pubTextList;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得中国专利pdf全文
|
|
|
+ *
|
|
|
+ * @param appNo
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ public List<InnerPatentPdfDTO> getExternalTextPdf(String appNo, String rowApplicationNo) throws IOException {
|
|
|
+ List<InnerPatentPdfDTO> list = new ArrayList<>();
|
|
|
+ String pdfUrl = "", pdfUrl1 = "", pdfUrl2 = "";
|
|
|
+ if (StringUtils.isNotEmpty(appNo) && appNo.contains("CN")) {
|
|
|
+ String pdfUrlStr = this.getCnPdfApi(rowApplicationNo);
|
|
|
+ //若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
|
|
|
+ if (StringUtils.isNotEmpty(pdfUrlStr)) {
|
|
|
+ if (pdfUrlStr.contains("|http")) { //若包含公开和授权两个pdf
|
|
|
+ String[] pdfUrlArr = pdfUrlStr.split("\\|http");
|
|
|
+ pdfUrl1 = pdfUrlArr[0].substring(pdfUrlArr[0].indexOf("http"), pdfUrlArr[0].indexOf("?"));
|
|
|
+ pdfUrlArr[1] = "http" + pdfUrlArr[1];
|
|
|
+ pdfUrl2 = pdfUrlArr[1].substring(pdfUrlArr[1].indexOf("http"), pdfUrlArr[1].indexOf("?"));
|
|
|
+
|
|
|
+ if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(appNo, 0);
|
|
|
+ if (StringUtils.isNotEmpty(guid1)) {
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
+ dto.setPdfGuid(guid1);
|
|
|
+ dto.setType(0);
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+ //授权说明书pdf
|
|
|
+ String guid2 = FormatUtil.getPDFFormat(appNo, 1);
|
|
|
+ if (StringUtils.isNotEmpty(guid2)) {
|
|
|
+ InnerPatentPdfDTO dto1 = new InnerPatentPdfDTO();
|
|
|
+ dto1.setPdfGuid(guid2);
|
|
|
+ dto1.setType(1);
|
|
|
+ list.add(dto1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(appNo, 1);
|
|
|
+ if (StringUtils.isNotEmpty(guid1)) {
|
|
|
+ InnerPatentPdfDTO dto1 = new InnerPatentPdfDTO();
|
|
|
+ dto1.setPdfGuid(guid1);
|
|
|
+ dto1.setType(1);
|
|
|
+ list.add(dto1);
|
|
|
+ }
|
|
|
+ String guid2 = FormatUtil.getPDFFormat(appNo, 0);
|
|
|
+ if (StringUtils.isNotEmpty(guid2)) {
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
+ dto.setPdfGuid(guid2);
|
|
|
+ dto.setType(0);
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else { //若只有一个
|
|
|
+ pdfUrl1 = pdfUrlStr.substring(pdfUrlStr.indexOf("http"), pdfUrlStr.indexOf("?"));
|
|
|
+ if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(appNo, 0);
|
|
|
+ if (StringUtils.isNotEmpty(guid1)) {
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
+ dto.setPdfGuid(guid1);
|
|
|
+ dto.setType(0);
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(appNo, 1);
|
|
|
+ if (StringUtils.isNotEmpty(guid1)) {
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
+ dto.setPdfGuid(guid1);
|
|
|
+ dto.setType(1);
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|