|
@@ -498,7 +498,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
|
|
|
|
try {
|
|
try {
|
|
//以下 ↓装载的是调用"获得中国专利著录"接口返回的专利相关数据
|
|
//以下 ↓装载的是调用"获得中国专利著录"接口返回的专利相关数据
|
|
- if (starPatent.getPatentNo().contains("CN")) {
|
|
|
|
|
|
+ if (appNo.contains("CN")) {
|
|
String chinaPatentZhuLuStr = patentStarApiService.getCnBibApi(appNo);
|
|
String chinaPatentZhuLuStr = patentStarApiService.getCnBibApi(appNo);
|
|
if (chinaPatentZhuLuStr != null && !chinaPatentZhuLuStr.trim().equals("") && !chinaPatentZhuLuStr.equals("{}")) {
|
|
if (chinaPatentZhuLuStr != null && !chinaPatentZhuLuStr.trim().equals("") && !chinaPatentZhuLuStr.equals("{}")) {
|
|
List<ChinaPatentZhuLu> chinaPatentZhuLus = JSON.parseArray(chinaPatentZhuLuStr, ChinaPatentZhuLu.class);
|
|
List<ChinaPatentZhuLu> chinaPatentZhuLus = JSON.parseArray(chinaPatentZhuLuStr, ChinaPatentZhuLu.class);
|
|
@@ -620,11 +620,11 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
uploadParamsVO.getPatent().setPriorityNo(worldPatentZhuLu.getPr());
|
|
uploadParamsVO.getPatent().setPriorityNo(worldPatentZhuLu.getPr());
|
|
}
|
|
}
|
|
//装载标题
|
|
//装载标题
|
|
- if (uploadParamsVO.getPatent().getName() == null && uploadParamsVO.getPatent().getName().equals("")) {
|
|
|
|
|
|
+ if (uploadParamsVO.getPatent().getName() == null || uploadParamsVO.getPatent().getName().equals("")) {
|
|
uploadParamsVO.getPatent().setName(worldPatentZhuLu.getTitle());
|
|
uploadParamsVO.getPatent().setName(worldPatentZhuLu.getTitle());
|
|
}
|
|
}
|
|
//装载摘要
|
|
//装载摘要
|
|
- if (uploadParamsVO.getPatent().getAbstractStr() == null && uploadParamsVO.getPatent().getAbstractStr().equals("")) {
|
|
|
|
|
|
+ if (uploadParamsVO.getPatent().getAbstractStr() == null || uploadParamsVO.getPatent().getAbstractStr().equals("")) {
|
|
uploadParamsVO.getPatent().setAbstractStr(worldPatentZhuLu.getAbstract());
|
|
uploadParamsVO.getPatent().setAbstractStr(worldPatentZhuLu.getAbstract());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -651,41 +651,43 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
|
|
|
|
//以下 ↓装载的是调用"获得中国专利法律状态"接口返回的专利相关数据
|
|
//以下 ↓装载的是调用"获得中国专利法律状态"接口返回的专利相关数据
|
|
try {
|
|
try {
|
|
- PatentAffair patentAffair = new PatentAffair();
|
|
|
|
- String cnLegalApiStr = patentStarApiService.getCnLegalApi(appNo);
|
|
|
|
- if (!cnLegalApiStr.equals("")) {
|
|
|
|
- List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
|
|
|
|
- if (chinaLeagalStatuses != null && chinaLeagalStatuses.size() > 0) {
|
|
|
|
- ArrayList<KeyValueVO> lst = new ArrayList<>();
|
|
|
|
- HashMap<Integer, String> nameMap = new HashMap<>();
|
|
|
|
- HashMap<Integer, String> contentMap = new HashMap<>();
|
|
|
|
- nameMap.put(0, "发生日期");
|
|
|
|
- nameMap.put(1, "法律状态");
|
|
|
|
- nameMap.put(2, "详细法律状态");
|
|
|
|
- nameMap.put(3, "详细信息");
|
|
|
|
- for (int i = 0; i < chinaLeagalStatuses.size(); i++) {
|
|
|
|
- if (i == 0) {
|
|
|
|
- patentAffair.setStatus(chinaLeagalStatuses.get(i).getLegalStatus());
|
|
|
|
- }
|
|
|
|
- contentMap.put(0, chinaLeagalStatuses.get(i).getLegalDate());
|
|
|
|
- contentMap.put(1, chinaLeagalStatuses.get(i).getLegalStatus());
|
|
|
|
- contentMap.put(2, chinaLeagalStatuses.get(i).getLegalStatusInfo());
|
|
|
|
- contentMap.put(3, chinaLeagalStatuses.get(i).getDETAIL());
|
|
|
|
- ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
|
|
|
|
- for (int j = 0; j < 4; j++) {
|
|
|
|
- KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
|
|
|
|
- inpadocData.setName(nameMap.get(j));
|
|
|
|
- inpadocData.setContent(contentMap.get(j));
|
|
|
|
- inpadocDatas.add(inpadocData);
|
|
|
|
|
|
+ if (appNo.contains("CN")) {
|
|
|
|
+ PatentAffair patentAffair = new PatentAffair();
|
|
|
|
+ String cnLegalApiStr = patentStarApiService.getCnLegalApi(appNo);
|
|
|
|
+ if (!cnLegalApiStr.equals("")) {
|
|
|
|
+ List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
|
|
|
|
+ if (chinaLeagalStatuses != null && chinaLeagalStatuses.size() > 0) {
|
|
|
|
+ ArrayList<KeyValueVO> lst = new ArrayList<>();
|
|
|
|
+ HashMap<Integer, String> nameMap = new HashMap<>();
|
|
|
|
+ HashMap<Integer, String> contentMap = new HashMap<>();
|
|
|
|
+ nameMap.put(0, "发生日期");
|
|
|
|
+ nameMap.put(1, "法律状态");
|
|
|
|
+ nameMap.put(2, "详细法律状态");
|
|
|
|
+ nameMap.put(3, "详细信息");
|
|
|
|
+ for (int i = 0; i < chinaLeagalStatuses.size(); i++) {
|
|
|
|
+ if (i == 0) {
|
|
|
|
+ patentAffair.setStatus(chinaLeagalStatuses.get(i).getLegalStatus());
|
|
|
|
+ }
|
|
|
|
+ contentMap.put(0, chinaLeagalStatuses.get(i).getLegalDate());
|
|
|
|
+ contentMap.put(1, chinaLeagalStatuses.get(i).getLegalStatus());
|
|
|
|
+ contentMap.put(2, chinaLeagalStatuses.get(i).getLegalStatusInfo());
|
|
|
|
+ contentMap.put(3, chinaLeagalStatuses.get(i).getDETAIL());
|
|
|
|
+ ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
|
|
|
|
+ for (int j = 0; j < 4; j++) {
|
|
|
|
+ KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
|
|
|
|
+ inpadocData.setName(nameMap.get(j));
|
|
|
|
+ inpadocData.setContent(contentMap.get(j));
|
|
|
|
+ inpadocDatas.add(inpadocData);
|
|
|
|
+ }
|
|
|
|
+ KeyValueVO keyValueVO = new KeyValueVO();
|
|
|
|
+ keyValueVO.setInpadocData(inpadocDatas);
|
|
|
|
+ lst.add(keyValueVO);
|
|
}
|
|
}
|
|
- KeyValueVO keyValueVO = new KeyValueVO();
|
|
|
|
- keyValueVO.setInpadocData(inpadocDatas);
|
|
|
|
- lst.add(keyValueVO);
|
|
|
|
|
|
+ //装载事务表的status(公开|授权|驳回|权力转移。。。)
|
|
|
|
+ String content = JSONObject.toJSONString(lst);
|
|
|
|
+ patentAffair.setContent(content);
|
|
|
|
+ uploadParamsVO.setPatentAffair(patentAffair);
|
|
}
|
|
}
|
|
- //装载事务表的status(公开|授权|驳回|权力转移。。。)
|
|
|
|
- String content = JSONObject.toJSONString(lst);
|
|
|
|
- patentAffair.setContent(content);
|
|
|
|
- uploadParamsVO.setPatentAffair(patentAffair);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -701,50 +703,62 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
* @param starPatent 专利之星著录对象
|
|
* @param starPatent 专利之星著录对象
|
|
* @param uploadParamsVO 专利实体类对象
|
|
* @param uploadParamsVO 专利实体类对象
|
|
*/
|
|
*/
|
|
- public void setPatentClaim(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
|
|
|
|
|
|
+ public Boolean setPatentClaim(StarPatentVO starPatent, UploadParamsVO uploadParamsVO, PQueueData pQueueData) throws IOException {
|
|
try {
|
|
try {
|
|
- String applicationNo = starPatent.getApplicationNo() + "";
|
|
|
|
- String appNo;
|
|
|
|
- if (starPatent.getApplicationNo().contains(".")) {
|
|
|
|
- appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
|
|
|
|
- } else {
|
|
|
|
- appNo = starPatent.getApplicationNo();
|
|
|
|
- }
|
|
|
|
- //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
|
|
|
|
- String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
|
|
|
|
+ if (starPatent.getApplicationNo().contains("CN")) {
|
|
|
|
+ String applicationNo = starPatent.getApplicationNo() + "";
|
|
|
|
+ String appNo;
|
|
|
|
+ if (starPatent.getApplicationNo().contains(".")) {
|
|
|
|
+ appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
|
|
|
|
+ } else {
|
|
|
|
+ appNo = starPatent.getApplicationNo();
|
|
|
|
+ }
|
|
|
|
|
|
- //若没有取到全文文本,即取不到权要,则将当前申请号或专利号和备注信息记录到问题记录表
|
|
|
|
- if (cnFullXmlStr.equals("")) {
|
|
|
|
- recordQuestionPatent(applicationNo, 2);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
|
|
|
|
+ String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
|
|
|
|
- //使用正则表达式拼接出权要原文
|
|
|
|
- String regex = "(?<=<claim id=.{1,110}>)[\\w\\W]+?(?=</claim>)";
|
|
|
|
- Pattern compile = Pattern.compile(regex);
|
|
|
|
- Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
|
|
- StringBuilder builder = new StringBuilder();
|
|
|
|
- while (matcher.find()) {
|
|
|
|
- String macherGroup = matcher.group();
|
|
|
|
- String right = macherGroup.replaceAll("<!--.*?-->", "").trim();
|
|
|
|
- right = right.replaceAll("<.*?>", "").trim();
|
|
|
|
- builder.append(right).append("\r\n");
|
|
|
|
- }
|
|
|
|
|
|
+ //若没有取到全文文本即取不到权要,则将该专利检索专利之星接口次数+1,重新丢入权要生产队列,将当前申请号或专利号和备注信息记录到问题记录表,返回false
|
|
|
|
+ if (cnFullXmlStr.equals("")) {
|
|
|
|
+ if (pQueueData != null && pQueueData.getCallNum() < 2) {
|
|
|
|
+ pQueueData.setCallNum(pQueueData.getCallNum() + 1);
|
|
|
|
+ pantentQueueService.rightToPQueue(pQueueData);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ recordQuestionPatent(applicationNo, 2);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //使用正则表达式拼接出权要原文
|
|
|
|
+ String regex = "(?<=<claim id=.{1,110}>)[\\w\\W]+?(?=</claim>)";
|
|
|
|
+ Pattern compile = Pattern.compile(regex);
|
|
|
|
+ Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
|
+ while (matcher.find()) {
|
|
|
|
+ String macherGroup = matcher.group();
|
|
|
|
+ String right = macherGroup.replaceAll("<!--.*?-->", "").trim();
|
|
|
|
+ right = right.replaceAll("<.*?>", "").trim();
|
|
|
|
+ builder.append(right).append("\r\n");
|
|
|
|
+ }
|
|
|
|
|
|
- String patentRightText = builder + "";
|
|
|
|
|
|
+ String patentRightText = builder + "";
|
|
|
|
|
|
- //使用工具类去除字符串文本中的所有HTML格式标签
|
|
|
|
- patentRightText = RemoveHtmlTagsUtils.removeHtmlTags(patentRightText);
|
|
|
|
- patentRightText = patentRightText.trim();
|
|
|
|
|
|
+ //使用工具类去除字符串文本中的所有HTML格式标签
|
|
|
|
+ patentRightText = RemoveHtmlTagsUtils.removeHtmlTags(patentRightText);
|
|
|
|
+ patentRightText = patentRightText.trim();
|
|
|
|
+
|
|
|
|
+ //装载权利要求原文
|
|
|
|
+ PatentRight patentRight = new PatentRight();
|
|
|
|
+ patentRight.setContent(patentRightText);
|
|
|
|
+ uploadParamsVO.setPatentRight(patentRight);
|
|
|
|
+ }
|
|
|
|
|
|
- //装载权利要求原文
|
|
|
|
- PatentRight patentRight = new PatentRight();
|
|
|
|
- patentRight.setContent(patentRightText);
|
|
|
|
- uploadParamsVO.setPatentRight(patentRight);
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return true;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -753,44 +767,55 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
* @param starPatent 专利之星著录对象
|
|
* @param starPatent 专利之星著录对象
|
|
* @param uploadParamsVO 专利实体类对象
|
|
* @param uploadParamsVO 专利实体类对象
|
|
*/
|
|
*/
|
|
- public void setPatentInstructionText(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
|
|
|
|
|
|
+ public Boolean setPatentInstructionText(StarPatentVO starPatent, UploadParamsVO uploadParamsVO, PQueueData pQueueData) throws IOException {
|
|
try {
|
|
try {
|
|
- String applicationNo = starPatent.getApplicationNo() + "";
|
|
|
|
- String appNo;
|
|
|
|
- if (starPatent.getApplicationNo().contains(".")) {
|
|
|
|
- appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
|
|
|
|
- } else {
|
|
|
|
- appNo = starPatent.getApplicationNo();
|
|
|
|
- }
|
|
|
|
- //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
|
|
|
|
- String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
|
|
|
|
+ if (starPatent.getApplicationNo().contains("CN")) {
|
|
|
|
+ String applicationNo = starPatent.getApplicationNo() + "";
|
|
|
|
+ String appNo;
|
|
|
|
+ if (starPatent.getApplicationNo().contains(".")) {
|
|
|
|
+ appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
|
|
|
|
+ } else {
|
|
|
|
+ appNo = starPatent.getApplicationNo();
|
|
|
|
+ }
|
|
|
|
|
|
- //若没有取到全文文本,即取不到说明书文本,则将当前申请号或专利号和备注信息记录到问题记录表
|
|
|
|
- if (cnFullXmlStr.equals("")) {
|
|
|
|
- recordQuestionPatent(applicationNo, 3);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
|
|
|
|
+ String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
|
|
+
|
|
|
|
+ //若没有取到全文文本,即取不到说明书文本,则将当前申请号或专利号和备注信息记录到问题记录表
|
|
|
|
+ if (cnFullXmlStr.equals("")) {
|
|
|
|
+ if (pQueueData != null && pQueueData.getCallNum() < 2) {
|
|
|
|
+ pQueueData.setCallNum(pQueueData.getCallNum() + 1);
|
|
|
|
+ pantentQueueService.rightToPQueue(pQueueData);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ recordQuestionPatent(applicationNo, 3);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //使用正则表达式拼接出说明书文本全文
|
|
|
|
+ String regex = "(?<=<description>)[\\w\\W]+?(?=</description>)";
|
|
|
|
+ Pattern compile = Pattern.compile(regex);
|
|
|
|
+ Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
|
|
+ String text = "";
|
|
|
|
+ while (matcher.find()) {
|
|
|
|
+ text = matcher.group();
|
|
|
|
+ text = text.replaceAll("<invention-title[^>]*>.*?(\\n{0,}|\\s{0,}?)</invention-title>", "");
|
|
|
|
+ text = text.replaceAll("<br/>", "");
|
|
|
|
+ text = text.replaceAll("\\s", "");
|
|
|
|
+ }
|
|
|
|
|
|
- //使用正则表达式拼接出说明书文本全文
|
|
|
|
- String regex = "(?<=<description>)[\\w\\W]+?(?=</description>)";
|
|
|
|
- Pattern compile = Pattern.compile(regex);
|
|
|
|
- Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
|
|
- String text = "";
|
|
|
|
- while (matcher.find()) {
|
|
|
|
- text = matcher.group();
|
|
|
|
- text = text.replaceAll("<invention-title[^>]*>.*?(\\n{0,}|\\s{0,}?)</invention-title>", "");
|
|
|
|
- text = text.replaceAll("<br/>", "");
|
|
|
|
- text = text.replaceAll("\\s", "");
|
|
|
|
|
|
+ //装载说明书文本全文
|
|
|
|
+ PatentInstructionText patentInstructionText = new PatentInstructionText();
|
|
|
|
+ patentInstructionText.setManual(text.trim());
|
|
|
|
+ uploadParamsVO.setPatentInstructionText(patentInstructionText);
|
|
}
|
|
}
|
|
|
|
|
|
- //装载说明书文本全文
|
|
|
|
- PatentInstructionText patentInstructionText = new PatentInstructionText();
|
|
|
|
- patentInstructionText.setManual(text.trim());
|
|
|
|
- uploadParamsVO.setPatentInstructionText(patentInstructionText);
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ return true;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -822,8 +847,10 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
pdfUrl1 = pdfUrlArr[0].substring(pdfUrlArr[0].indexOf("http"), pdfUrlArr[0].indexOf("?"));
|
|
pdfUrl1 = pdfUrlArr[0].substring(pdfUrlArr[0].indexOf("http"), pdfUrlArr[0].indexOf("?"));
|
|
pdfUrlArr[1] = "http" + pdfUrlArr[1];
|
|
pdfUrlArr[1] = "http" + pdfUrlArr[1];
|
|
pdfUrl2 = pdfUrlArr[1].substring(pdfUrlArr[1].indexOf("http"), pdfUrlArr[1].indexOf("?"));
|
|
pdfUrl2 = pdfUrlArr[1].substring(pdfUrlArr[1].indexOf("http"), pdfUrlArr[1].indexOf("?"));
|
|
|
|
+
|
|
UploadFileDTO fileDTO = downLoadPdf(pdfUrl1);
|
|
UploadFileDTO fileDTO = downLoadPdf(pdfUrl1);
|
|
UploadFileDTO fileDTO2 = downLoadPdf(pdfUrl2);
|
|
UploadFileDTO fileDTO2 = downLoadPdf(pdfUrl2);
|
|
|
|
+
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
uploadParamsVO.setPdf1FileDTO(fileDTO);
|
|
uploadParamsVO.setPdf1FileDTO(fileDTO);
|
|
uploadParamsVO.setPdf2FileDTO(fileDTO2);
|
|
uploadParamsVO.setPdf2FileDTO(fileDTO2);
|