|
@@ -315,12 +315,14 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
} else if (fromIndex == isAddPatentNos.size() - 1) {
|
|
} else if (fromIndex == isAddPatentNos.size() - 1) {
|
|
isAddPatentNos = Arrays.asList(isAddPatentNos.get(isAddPatentNos.size() - 1));
|
|
isAddPatentNos = Arrays.asList(isAddPatentNos.get(isAddPatentNos.size() - 1));
|
|
}
|
|
}
|
|
- //若是检索页面网站导入,则isAddPatentNos是前台传的多个申请号,即包含"."
|
|
|
|
- if (isAddPatentNos.get(0).contains(".")) {
|
|
|
|
- downLoadIsAddPatentNos(isAddPatentNos, task, orderBy, orderByType, dbType, cells, null);
|
|
|
|
- } else {
|
|
|
|
- //若是多个专利号导入的下载,则isAddPatentNos是多个专利号,不包含"."
|
|
|
|
|
|
+
|
|
|
|
+ //判断isAdd中的多个专利号或申请号,即判断是检索页面手动勾选的多个专利下载/还是多个专利号导入的下载任务
|
|
|
|
+ if (task.getIsAddType() != null && task.getIsAddType().equals(2)) {
|
|
|
|
+ //若是多个专利号导入的下载
|
|
downLoadIsAddPatentNos(isAddPatentNos, task, orderBy, orderByType, dbType, cells, conditions);
|
|
downLoadIsAddPatentNos(isAddPatentNos, task, orderBy, orderByType, dbType, cells, conditions);
|
|
|
|
+ } else {
|
|
|
|
+ //若是检索页面手动勾选的多个专利的下载
|
|
|
|
+ downLoadIsAddPatentNos(isAddPatentNos, task, orderBy, orderByType, dbType, cells, null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -579,41 +581,57 @@ public class ExcutePatentDataStar implements IExcutePatentData {
|
|
String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
|
|
|
|
|
|
//使用正则表达式拼接出说明书文本全文
|
|
//使用正则表达式拼接出说明书文本全文
|
|
- String regex = "(?<=<p id=\"p)[\\w\\W]+?(?=</p>)";
|
|
|
|
|
|
+ String regex = "(?<=<description>)[\\w\\W]+?(?=</description>)";
|
|
Pattern compile = Pattern.compile(regex);
|
|
Pattern compile = Pattern.compile(regex);
|
|
Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
Matcher matcher = compile.matcher(cnFullXmlStr);
|
|
- StringBuilder builder = new StringBuilder();
|
|
|
|
|
|
+// StringBuilder builder = new StringBuilder();
|
|
|
|
+// String regexTable = "(?<=<tables[^>]{1,50}>)[\\w\\W]+?(?=</tables>)";
|
|
|
|
+// Pattern compileTable = Pattern.compile(regexTable);
|
|
|
|
+ String text = "";
|
|
while (matcher.find()) {
|
|
while (matcher.find()) {
|
|
- String oldRow = matcher.group();
|
|
|
|
-// if (oldRow.contains("\r\n")) {
|
|
|
|
-// oldRow = oldRow.replace("\r\n", "");
|
|
|
|
|
|
+ text = matcher.group();
|
|
|
|
+ text = text.replaceAll("<invention-title(.*?)</invention-title>", "");
|
|
|
|
+ text = text.replaceAll("<br/>", "");
|
|
|
|
+ text = text.replaceAll("\\s", "");
|
|
|
|
+ }
|
|
|
|
+// String oldRow = matcher.group();
|
|
|
|
+// oldRow = oldRow.replaceAll("\\s", "");
|
|
|
|
+// if (oldRow.contains("num=\"n")) {
|
|
|
|
+// oldRow = oldRow.substring(oldRow.indexOf("num=\"n") + 6);
|
|
|
|
+// oldRow = "[" + oldRow;
|
|
|
|
+// oldRow = oldRow.replace("\">", "]");
|
|
|
|
+// } else if (oldRow.contains("num=")) {
|
|
|
|
+// oldRow = oldRow.substring(oldRow.indexOf("num=") + 5);
|
|
|
|
+// oldRow = "[" + oldRow;
|
|
|
|
+// oldRow = oldRow.replace("\">", "]");
|
|
|
|
+// } else {
|
|
|
|
+// oldRow = oldRow.substring(oldRow.indexOf("\">") + 2);
|
|
|
|
+// }
|
|
|
|
+// Matcher matcherTable = compileTable.matcher(oldRow);
|
|
|
|
+// StringBuilder builder1 = new StringBuilder();
|
|
|
|
+// while (matcherTable.find()) {
|
|
|
|
+// String tableGroup = matcherTable.group();
|
|
|
|
+// tableGroup = tableGroup.replaceAll("<tgroup[^>]*>", "").replaceAll("</tgroup >", "").replaceAll("<colspec[^>]*>", "").
|
|
|
|
+// replaceAll("</colspec>", "").replaceAll("<colspec", "<td").replaceAll("row", "tr").
|
|
|
|
+// replaceAll("entry", "td");
|
|
|
|
+// builder1.append(tableGroup);
|
|
// }
|
|
// }
|
|
-// if (oldRow.contains("\n")) {
|
|
|
|
-// oldRow = oldRow.replace("\n", "");
|
|
|
|
|
|
+// if ((builder1 + "").length() > 0) {
|
|
|
|
+// oldRow = builder1 + "";
|
|
// }
|
|
// }
|
|
- if (oldRow.contains("num=\"n")) {
|
|
|
|
- oldRow = oldRow.substring(oldRow.indexOf("num=\"n") + 6);
|
|
|
|
- oldRow = "[" + oldRow;
|
|
|
|
- oldRow = oldRow.replace("\">", "]");
|
|
|
|
- } else if (oldRow.contains("num=")) {
|
|
|
|
- oldRow = oldRow.substring(oldRow.indexOf("num=") + 5);
|
|
|
|
- oldRow = "[" + oldRow;
|
|
|
|
- oldRow = oldRow.replace("\">", "]");
|
|
|
|
- } else {
|
|
|
|
- oldRow = oldRow.substring(oldRow.indexOf("\">") + 2);
|
|
|
|
- }
|
|
|
|
- builder.append(oldRow).append("\r\n");
|
|
|
|
- }
|
|
|
|
|
|
|
|
- String instructionText = builder + "";
|
|
|
|
|
|
+// builder.append(oldRow).append("\r\n");
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// String instructionText = builder + "";
|
|
|
|
|
|
//使用工具类去除字符串文本中的所有HTML格式标签
|
|
//使用工具类去除字符串文本中的所有HTML格式标签
|
|
- instructionText = RemoveHtmlTagsUtils.removeHtmlTags(instructionText);
|
|
|
|
- instructionText = instructionText.trim();
|
|
|
|
|
|
+// instructionText = RemoveHtmlTagsUtils.removeHtmlTags(instructionText);
|
|
|
|
+// instructionText = instructionText.trim();
|
|
|
|
|
|
//装载说明书文本全文
|
|
//装载说明书文本全文
|
|
PatentInstructionText patentInstructionText = new PatentInstructionText();
|
|
PatentInstructionText patentInstructionText = new PatentInstructionText();
|
|
- patentInstructionText.setManual(instructionText);
|
|
|
|
|
|
+ patentInstructionText.setManual(text.trim());
|
|
uploadParamsVO.setPatentInstructionText(patentInstructionText);
|
|
uploadParamsVO.setPatentInstructionText(patentInstructionText);
|
|
|
|
|
|
}
|
|
}
|