|
@@ -18,12 +18,14 @@ import cn.cslg.pas.domain.es.ESCustomField;
|
|
import cn.cslg.pas.domain.es.EsProjectTask;
|
|
import cn.cslg.pas.domain.es.EsProjectTask;
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
import cn.cslg.pas.domain.es.PatentJoin;
|
|
import cn.cslg.pas.domain.es.PatentJoin;
|
|
|
|
+import cn.cslg.pas.exception.ExceptionEnum;
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
import cn.cslg.pas.service.business.ImportTaskService;
|
|
import cn.cslg.pas.service.business.ImportTaskService;
|
|
import cn.cslg.pas.service.common.PatentStarApiService;
|
|
import cn.cslg.pas.service.common.PatentStarApiService;
|
|
import cn.cslg.pas.service.importPatent.ImportSinglePatentService;
|
|
import cn.cslg.pas.service.importPatent.ImportSinglePatentService;
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
|
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
|
|
|
+import co.elastic.clients.elasticsearch._types.ElasticsearchException;
|
|
import co.elastic.clients.elasticsearch._types.SortOptions;
|
|
import co.elastic.clients.elasticsearch._types.SortOptions;
|
|
import co.elastic.clients.elasticsearch._types.SortOrder;
|
|
import co.elastic.clients.elasticsearch._types.SortOrder;
|
|
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
|
|
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
|
|
@@ -289,7 +291,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
long total = response.hits().total().value();
|
|
long total = response.hits().total().value();
|
|
System.out.println("total:" + total);
|
|
System.out.println("total:" + total);
|
|
@@ -336,7 +338,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -403,7 +405,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
long total = response.hits().total().value();
|
|
long total = response.hits().total().value();
|
|
System.out.println("total:" + total);
|
|
System.out.println("total:" + total);
|
|
@@ -452,7 +454,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -519,7 +521,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -566,7 +568,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -584,7 +586,7 @@ public class EsExportService {
|
|
|
|
|
|
public void loadExport(List<String> list) throws Exception {
|
|
public void loadExport(List<String> list) throws Exception {
|
|
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
|
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
|
- List<String> headers = Arrays.asList("专利号");
|
|
|
|
|
|
+ List<String> headers = Arrays.asList("专利号","位数");
|
|
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();//新建工作簿
|
|
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();//新建工作簿
|
|
HSSFSheet sheet = hssfWorkbook.createSheet();//新建sheet页
|
|
HSSFSheet sheet = hssfWorkbook.createSheet();//新建sheet页
|
|
sheet.setDefaultColumnWidth(30);
|
|
sheet.setDefaultColumnWidth(30);
|
|
@@ -613,6 +615,12 @@ public class EsExportService {
|
|
commonCellStyle.setWrapText(true);
|
|
commonCellStyle.setWrapText(true);
|
|
cell.setCellStyle(commonCellStyle);
|
|
cell.setCellStyle(commonCellStyle);
|
|
cell.setCellValue(no);
|
|
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);
|
|
hssfWorkbook.write(out);
|
|
byte[] bytes = out.toByteArray();
|
|
byte[] bytes = out.toByteArray();
|
|
@@ -650,7 +658,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
return response.hits().total().value();
|
|
return response.hits().total().value();
|
|
}
|
|
}
|
|
@@ -682,7 +690,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
return response.hits().total().value();
|
|
return response.hits().total().value();
|
|
}
|
|
}
|
|
@@ -716,7 +724,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<EsExportRefreshVO> list = new ArrayList<>();
|
|
List<EsExportRefreshVO> list = new ArrayList<>();
|
|
@@ -870,7 +878,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
long total = response.hits().total().value();
|
|
long total = response.hits().total().value();
|
|
if (total > 1) {
|
|
if (total > 1) {
|
|
@@ -900,8 +908,10 @@ public class EsExportService {
|
|
.readTimeout(60, TimeUnit.SECONDS)
|
|
.readTimeout(60, TimeUnit.SECONDS)
|
|
.build();
|
|
.build();
|
|
Request request = new Request.Builder()
|
|
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)
|
|
.post(requestBody)
|
|
.build();
|
|
.build();
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
@@ -934,7 +944,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
long total = response.hits().total().value();
|
|
long total = response.hits().total().value();
|
|
System.out.println("total:" + total);
|
|
System.out.println("total:" + total);
|
|
@@ -982,7 +992,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -1024,7 +1034,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
long total = response.hits().total().value();
|
|
long total = response.hits().total().value();
|
|
System.out.println("total:" + total);
|
|
System.out.println("total:" + total);
|
|
@@ -1073,7 +1083,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
@@ -1096,13 +1106,22 @@ public class EsExportService {
|
|
}
|
|
}
|
|
String newPatentId = "";
|
|
String newPatentId = "";
|
|
if (patentNo.startsWith("CN")) {
|
|
if (patentNo.startsWith("CN")) {
|
|
|
|
+ if (patentNo.length() == 13 && patentNo.contains("W")) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
//中国专利
|
|
//中国专利
|
|
if (patentNo.length() == 12 && patentNo.contains(".")) {
|
|
if (patentNo.length() == 12 && patentNo.contains(".")) {
|
|
String newPatentNo = this.formatCnNumber(patentNo);
|
|
String newPatentNo = this.formatCnNumber(patentNo);
|
|
newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
- } else if (patentNo.length() == 15){
|
|
|
|
|
|
+ } else if (patentNo.length() == 15 && !patentNo.contains(".")){
|
|
String newPatentNo = this.formatNumber(patentNo);
|
|
String newPatentNo = this.formatNumber(patentNo);
|
|
newPatentId = this.queryNewByPatentNo(newPatentNo, oldPatentId);
|
|
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 {
|
|
} else {
|
|
newPatentId = this.queryNewByPatentNo(patentNo, oldPatentId);
|
|
newPatentId = this.queryNewByPatentNo(patentNo, oldPatentId);
|
|
}
|
|
}
|
|
@@ -1129,6 +1148,19 @@ public class EsExportService {
|
|
str.substring(14, 15);
|
|
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) {
|
|
public String formatCnNumber(String str) {
|
|
StringBuilder builder = new StringBuilder();
|
|
StringBuilder builder = new StringBuilder();
|
|
builder.append(str, 0, 2);
|
|
builder.append(str, 0, 2);
|
|
@@ -1182,7 +1214,12 @@ public class EsExportService {
|
|
builder.index("patent");
|
|
builder.index("patent");
|
|
Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(oldPatentNo));
|
|
Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(oldPatentNo));
|
|
builder.query(query);
|
|
builder.query(query);
|
|
- SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
|
|
|
+ SearchResponse<Patent> response = null;
|
|
|
|
+ try {
|
|
|
|
+ response = client.search(builder.build(), Patent.class);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
|
|
|
|
+ }
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
patentId = hits.get(0).id();
|
|
patentId = hits.get(0).id();
|
|
@@ -1198,23 +1235,28 @@ public class EsExportService {
|
|
builder.index("patent");
|
|
builder.index("patent");
|
|
Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(newPatentNo));
|
|
Query query = QueryBuilders.term(t -> t.field("patent_no.keyword").value(newPatentNo));
|
|
builder.query(query);
|
|
builder.query(query);
|
|
- SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
|
|
|
+ SearchResponse<Patent> response = null;
|
|
|
|
+ try {
|
|
|
|
+ response = client.search(builder.build(), Patent.class);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
|
|
|
|
+ }
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
String newPatentId = "";
|
|
String newPatentId = "";
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
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)) {
|
|
if (StringUtils.isEmpty(newPatentId)) {
|
|
Hit<Patent> hit = hits.stream().filter(i -> !i.id().equals(oldPatentId)).findFirst().orElse(null);
|
|
Hit<Patent> hit = hits.stream().filter(i -> !i.id().equals(oldPatentId)).findFirst().orElse(null);
|
|
if (ObjectUtils.isNotEmpty(hit) && hit != null) {
|
|
if (ObjectUtils.isNotEmpty(hit) && hit != null) {
|
|
@@ -1223,7 +1265,7 @@ public class EsExportService {
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
-// this.importPatent(Collections.singletonList(newPatentNo), 614);
|
|
|
|
|
|
+// this.importPatent(Collections.singletonList(newPatentNo), 5473);
|
|
// Thread.sleep(3000);
|
|
// Thread.sleep(3000);
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
// }
|
|
// }
|
|
@@ -1239,7 +1281,7 @@ public class EsExportService {
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
newPatentId = this.queryWDExtra(newPatentNo);
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
// Boolean flag = this.queryExtra(newPatentNo);
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
// if (Boolean.TRUE.equals(flag)) {
|
|
-// this.importPatent(Collections.singletonList(newPatentNo), 614);
|
|
|
|
|
|
+// this.importPatent(Collections.singletonList(newPatentNo), 5473);
|
|
// Thread.sleep(3000);
|
|
// Thread.sleep(3000);
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
// newPatentId = this.queryOldByPatentNo(newPatentNo);
|
|
// }
|
|
// }
|
|
@@ -1275,6 +1317,8 @@ public class EsExportService {
|
|
String patentId = "";
|
|
String patentId = "";
|
|
PatentStarListDTO vo = new PatentStarListDTO();
|
|
PatentStarListDTO vo = new PatentStarListDTO();
|
|
vo.setCurrentQuery("F XX (" + patentNo + "/PN-CN/GJ)");
|
|
vo.setCurrentQuery("F XX (" + patentNo + "/PN-CN/GJ)");
|
|
|
|
+// vo.setCurrentQuery("F XX (" + patentNo + "/AN)");
|
|
|
|
+// vo.setDBType("CN");
|
|
vo.setDBType("WD");
|
|
vo.setDBType("WD");
|
|
vo.setPageNum(1);
|
|
vo.setPageNum(1);
|
|
vo.setRowCount(10);
|
|
vo.setRowCount(10);
|
|
@@ -1324,7 +1368,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1359,7 +1403,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1396,7 +1440,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1424,7 +1468,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1459,7 +1503,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1494,7 +1538,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
if (!CollectionUtils.isEmpty(hits)) {
|
|
@@ -1520,7 +1564,7 @@ public class EsExportService {
|
|
response = client.search(builder.build(), Patent.class);
|
|
response = client.search(builder.build(), Patent.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- throw new XiaoShiException(e.getMessage());
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
|
|
}
|
|
}
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|