|
@@ -189,6 +189,93 @@ public class EsPatentService {
|
|
|
return collect;
|
|
|
}
|
|
|
|
|
|
+ //获取合并申请人
|
|
|
+ public List<String> getMergeApp(Integer projectId, String id) throws IOException {
|
|
|
+ SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
|
+ //设置查询索引
|
|
|
+ builder.index("patent");
|
|
|
+ Query q1 = QueryBuilders.term(i -> i.field("merge_applicant.project_id").value(projectId));
|
|
|
+ Query exist1 = QueryBuilders.exists(i -> i.field("merge_applicant"));
|
|
|
+ Query bool = QueryBuilders.bool(i -> i.must(q1, exist1));
|
|
|
+ Query nested = QueryBuilders.nested(i -> i.path("merge_applicant").query(bool));
|
|
|
+ Query ids = QueryBuilders.ids(i -> i.values(Arrays.asList(id)));
|
|
|
+ Query query = QueryBuilders.hasParent(i -> i.parentType("patent").query(ids));
|
|
|
+ Query q = QueryBuilders.bool(i -> i.must(nested, query));
|
|
|
+ builder.query(q);
|
|
|
+ SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
+ List<Hit<Patent>> hits = response.hits().hits();
|
|
|
+ List<PatentMergePerson> list = new ArrayList<>();
|
|
|
+ for (Hit<Patent> hit : hits) {
|
|
|
+ Patent patent = hit.source();
|
|
|
+ if (!CollectionUtils.isEmpty(patent.getMergeApplicant())) {
|
|
|
+ list.addAll(patent.getMergeApplicant());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
+ data = this.loadMergeName(list);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取合并权利人
|
|
|
+ public List<String> getMergeRight(Integer projectId, String id) throws IOException {
|
|
|
+ SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
|
+ //设置查询索引
|
|
|
+ builder.index("patent");
|
|
|
+ Query q1 = QueryBuilders.term(i -> i.field("merge_right_holder.project_id").value(projectId));
|
|
|
+ Query exist1 = QueryBuilders.exists(i -> i.field("merge_right_holder"));
|
|
|
+ Query bool = QueryBuilders.bool(i -> i.must(q1, exist1));
|
|
|
+ Query nested = QueryBuilders.nested(i -> i.path("merge_right_holder").query(bool));
|
|
|
+ Query ids = QueryBuilders.ids(i -> i.values(Arrays.asList(id)));
|
|
|
+ Query query = QueryBuilders.hasParent(i -> i.parentType("patent").query(ids));
|
|
|
+ Query q = QueryBuilders.bool(i -> i.must(nested, query));
|
|
|
+ builder.query(q);
|
|
|
+ SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
+ List<Hit<Patent>> hits = response.hits().hits();
|
|
|
+ List<PatentMergePerson> list = new ArrayList<>();
|
|
|
+ for (Hit<Patent> hit : hits) {
|
|
|
+ Patent patent = hit.source();
|
|
|
+ if (!CollectionUtils.isEmpty(patent.getMergeApplicant())) {
|
|
|
+ list.addAll(patent.getMergeApplicant());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
+ data = this.loadMergeName(list);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取合并发明人
|
|
|
+ public List<String> getMergeInventor(Integer projectId, String id) throws IOException {
|
|
|
+ SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
|
+ //设置查询索引
|
|
|
+ builder.index("patent");
|
|
|
+ Query q1 = QueryBuilders.term(i -> i.field("merge_inventor.project_id").value(projectId));
|
|
|
+ Query exist1 = QueryBuilders.exists(i -> i.field("merge_inventor"));
|
|
|
+ Query bool = QueryBuilders.bool(i -> i.must(q1, exist1));
|
|
|
+ Query nested = QueryBuilders.nested(i -> i.path("merge_inventor").query(bool));
|
|
|
+ Query ids = QueryBuilders.ids(i -> i.values(Arrays.asList(id)));
|
|
|
+ Query query = QueryBuilders.hasParent(i -> i.parentType("patent").query(ids));
|
|
|
+ Query q = QueryBuilders.bool(i -> i.must(nested, query));
|
|
|
+ builder.query(q);
|
|
|
+ SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
+ List<Hit<Patent>> hits = response.hits().hits();
|
|
|
+ List<PatentMergePerson> list = new ArrayList<>();
|
|
|
+ for (Hit<Patent> hit : hits) {
|
|
|
+ Patent patent = hit.source();
|
|
|
+ if (!CollectionUtils.isEmpty(patent.getMergeApplicant())) {
|
|
|
+ list.addAll(patent.getMergeApplicant());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> data = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
+ data = this.loadMergeName(list);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获得中国专利pdf全文
|
|
|
*
|