|
@@ -584,7 +584,7 @@ public class EsExportService {
|
|
|
|
|
|
public void loadExport(List<String> list) throws Exception {
|
|
|
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
|
|
- List<String> headers = Arrays.asList("专利号");
|
|
|
+ List<String> headers = Arrays.asList("专利号","位数");
|
|
|
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();//新建工作簿
|
|
|
HSSFSheet sheet = hssfWorkbook.createSheet();//新建sheet页
|
|
|
sheet.setDefaultColumnWidth(30);
|
|
@@ -613,6 +613,12 @@ public class EsExportService {
|
|
|
commonCellStyle.setWrapText(true);
|
|
|
cell.setCellStyle(commonCellStyle);
|
|
|
cell.setCellValue(no);
|
|
|
+ HSSFCell cell1 = row.createCell(1);
|
|
|
+ ExcelUtils.setExcelCellStyle(commonCellStyle);
|
|
|
+ commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
|
|
+ commonCellStyle.setWrapText(true);
|
|
|
+ cell1.setCellStyle(commonCellStyle);
|
|
|
+ cell1.setCellValue(no.length());
|
|
|
}
|
|
|
hssfWorkbook.write(out);
|
|
|
byte[] bytes = out.toByteArray();
|
|
@@ -900,8 +906,10 @@ public class EsExportService {
|
|
|
.readTimeout(60, TimeUnit.SECONDS)
|
|
|
.build();
|
|
|
Request request = new Request.Builder()
|
|
|
- .url("http://192.168.2.107:8087/api/xiaoshi/importTask/addImportTask")
|
|
|
- .addHeader("Cookie", "token=5T_nvys1wCh4QKm4t_XYSxxNz0Me6O4PrV__")
|
|
|
+ .url("https://xsip.cn/api/xiaoshi/importTask/addImportTask")
|
|
|
+// .url("http://192.168.2.107:8087/api/xiaoshi/importTask/addImportTask")
|
|
|
+ .addHeader("Cookie", "_ga=GA1.1.1311128280.1715044933; _ga_73YJPXJTLX=GS1.1.1732081012.6.0.1732081012.0.0.0; token=DS_hs9LNS6qwwZsd8_wnRUpFiOw3oZjMwN__")
|
|
|
+// .addHeader("Cookie", "token=5T_nvys1wCh4QKm4t_XYSxxNz0Me6O4PrV__")
|
|
|
.post(requestBody)
|
|
|
.build();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
@@ -1096,13 +1104,22 @@ public class EsExportService {
|
|
|
}
|
|
|
String newPatentId = "";
|
|
|
if (patentNo.startsWith("CN")) {
|
|
|
+ if (patentNo.length() == 13 && patentNo.contains("W")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//中国专利
|
|
|
if (patentNo.length() == 12 && patentNo.contains(".")) {
|
|
|
String newPatentNo = this.formatCnNumber(patentNo);
|
|
|
newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
|
- } else if (patentNo.length() == 15){
|
|
|
+ } else if (patentNo.length() == 15 && !patentNo.contains(".")){
|
|
|
String newPatentNo = this.formatNumber(patentNo);
|
|
|
newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
|
+ } else if (patentNo.length() == 15 && patentNo.contains(".")) {
|
|
|
+ String newPatentNo = this.formatNumber1(patentNo);
|
|
|
+ newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
|
+ } else if (patentNo.length() == 14) {
|
|
|
+ String newPatentNo = this.formatNumber2(patentNo);
|
|
|
+ newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
|
} else {
|
|
|
newPatentId = this.queryNewByPatentNo(patentNo, oldPatentId);
|
|
|
}
|
|
@@ -1129,6 +1146,19 @@ public class EsExportService {
|
|
|
str.substring(14, 15);
|
|
|
}
|
|
|
|
|
|
+ public String formatNumber1(String str) {
|
|
|
+ String s1 = str.substring(0, 7) + "0" + str.substring(7, str.indexOf("."));
|
|
|
+ String s2 = s1.substring(2);
|
|
|
+ char c = calculateChecksum(s2);
|
|
|
+ return s1 + "." + c;
|
|
|
+// String s = str.substring(str.indexOf(".") + 1);
|
|
|
+// return str.substring(0, 13) + s + ".0";
|
|
|
+ }
|
|
|
+
|
|
|
+ public String formatNumber2(String str) {
|
|
|
+ return str + ".0";
|
|
|
+ }
|
|
|
+
|
|
|
public String formatCnNumber(String str) {
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
builder.append(str, 0, 2);
|
|
@@ -1203,18 +1233,18 @@ public class EsExportService {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
String newPatentId = "";
|
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
|
- for (Hit<Patent> hit : hits) {
|
|
|
- String patentId = hit.id();
|
|
|
- if (!patentId.equals(oldPatentId)) {
|
|
|
- Patent patent = hit.source();
|
|
|
- if (!CollectionUtils.isEmpty(patent.getApplicant()) &&
|
|
|
- !CollectionUtils.isEmpty(patent.getRightHolder()) &&
|
|
|
- !CollectionUtils.isEmpty(patent.getInventor())) {
|
|
|
- newPatentId = patentId;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// for (Hit<Patent> hit : hits) {
|
|
|
+// String patentId = hit.id();
|
|
|
+// if (!patentId.equals(oldPatentId)) {
|
|
|
+// Patent patent = hit.source();
|
|
|
+// if (!CollectionUtils.isEmpty(patent.getApplicant()) &&
|
|
|
+// !CollectionUtils.isEmpty(patent.getRightHolder()) &&
|
|
|
+// !CollectionUtils.isEmpty(patent.getInventor())) {
|
|
|
+// newPatentId = patentId;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
if (StringUtils.isEmpty(newPatentId)) {
|
|
|
Hit<Patent> hit = hits.stream().filter(i -> !i.id().equals(oldPatentId)).findFirst().orElse(null);
|
|
|
if (ObjectUtils.isNotEmpty(hit) && hit != null) {
|
|
@@ -1223,7 +1253,7 @@ public class EsExportService {
|
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
|
-// this.importPatent(Collections.singletonList(newPatentNo), 614);
|
|
|
+// this.importPatent(Collections.singletonList(newPatentNo), 5473);
|
|
|
// Thread.sleep(3000);
|
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
|
// }
|
|
@@ -1239,7 +1269,7 @@ public class EsExportService {
|
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
|
-// this.importPatent(Collections.singletonList(newPatentNo), 614);
|
|
|
+// this.importPatent(Collections.singletonList(newPatentNo), 5473);
|
|
|
// Thread.sleep(3000);
|
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
|
// }
|
|
@@ -1275,6 +1305,8 @@ public class EsExportService {
|
|
|
String patentId = "";
|
|
|
PatentStarListDTO vo = new PatentStarListDTO();
|
|
|
vo.setCurrentQuery("F XX (" + patentNo + "/PN-CN/GJ)");
|
|
|
+// vo.setCurrentQuery("F XX (" + patentNo + "/AN)");
|
|
|
+// vo.setDBType("CN");
|
|
|
vo.setDBType("WD");
|
|
|
vo.setPageNum(1);
|
|
|
vo.setRowCount(10);
|