|
@@ -669,7 +669,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
//设置查询索引
|
|
//设置查询索引
|
|
builder.index("patent");
|
|
builder.index("patent");
|
|
- Query mustQ = QueryBuilders.hasChild(i -> i.type("project").query(j -> j.term(n -> n.field("project_id").value(projectId))));
|
|
|
|
|
|
+// Query mustQ = QueryBuilders.hasChild(i -> i.type("project").query(j -> j.term(n -> n.field("project_id").value(projectId))));
|
|
if (!CollectionUtils.isEmpty(conditionList)) {
|
|
if (!CollectionUtils.isEmpty(conditionList)) {
|
|
for (String name : conditionList) {
|
|
for (String name : conditionList) {
|
|
List<Query> queries = new ArrayList<>();
|
|
List<Query> queries = new ArrayList<>();
|
|
@@ -696,15 +696,15 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
Query childQ = QueryBuilders.hasChild(i -> i.type("merge_inventor").query(query));
|
|
Query childQ = QueryBuilders.hasChild(i -> i.type("merge_inventor").query(query));
|
|
queries.add(childQ);
|
|
queries.add(childQ);
|
|
}
|
|
}
|
|
- Query bool = QueryBuilders.bool(i -> i.must(mustQ).should(queries));
|
|
|
|
-// builder.size(99);
|
|
|
|
|
|
+ Query bool = QueryBuilders.bool(i -> i.should(queries));
|
|
builder.query(bool);
|
|
builder.query(bool);
|
|
//分页
|
|
//分页
|
|
if (pageNum > 0 && pageSize > 0) {
|
|
if (pageNum > 0 && pageSize > 0) {
|
|
builder.from((pageNum.intValue() - 1) * pageSize.intValue()).size(pageSize.intValue());
|
|
builder.from((pageNum.intValue() - 1) * pageSize.intValue()).size(pageSize.intValue());
|
|
}
|
|
}
|
|
- builder.trackTotalHits(i -> i.enabled(true));
|
|
|
|
|
|
+// builder.trackTotalHits(i -> i.enabled(true));
|
|
SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
|
|
|
|
+ total = response.hits().total().value();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
List<Hit<Patent>> hits = response.hits().hits();
|
|
Map<String, Patent> map = new HashMap<>();
|
|
Map<String, Patent> map = new HashMap<>();
|
|
for (Hit<Patent> hit : hits) {
|
|
for (Hit<Patent> hit : hits) {
|
|
@@ -895,8 +895,10 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- List<GetAllPersonDTO> collect = personList.stream().sorted(Comparator.comparing(GetAllPersonDTO::getName)).collect(Collectors.toList());
|
|
|
|
- personDTOList.addAll(collect);
|
|
|
|
|
|
+ List<GetAllPersonDTO> collect = personList.stream().filter(i -> !StringUtils.isEmpty(i.getName())).collect(Collectors.toList());
|
|
|
|
+ List<GetAllPersonDTO> list = collect.stream().sorted(Comparator.comparing(GetAllPersonDTO::getName)).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ personDTOList.addAll(list);
|
|
}
|
|
}
|
|
|
|
|
|
// List<GetAllPersonDTO> collect = personDTOList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
// List<GetAllPersonDTO> collect = personDTOList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
@@ -1103,13 +1105,18 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
Map<String, List<PatentMergePerson>> inventorMap = this.getChildMergePerson(id, projectId, "merge_inventor");
|
|
Map<String, List<PatentMergePerson>> inventorMap = this.getChildMergePerson(id, projectId, "merge_inventor");
|
|
if (!CollectionUtils.isEmpty(inventorMap)) {
|
|
if (!CollectionUtils.isEmpty(inventorMap)) {
|
|
for (String inventorId : inventorMap.keySet()) {
|
|
for (String inventorId : inventorMap.keySet()) {
|
|
- if (CollectionUtils.isEmpty(nameDatas)) {
|
|
|
|
- this.delSingleMerge(inventorId, type, name);
|
|
|
|
- }
|
|
|
|
|
|
+// if (CollectionUtils.isEmpty(nameDatas)) {
|
|
|
|
+// this.delSingleMerge(inventorId, type, name);
|
|
|
|
+// }
|
|
|
|
|
|
ArrayList<PatentMergePerson> inventorMergeList = new ArrayList<>(mergePersonList);
|
|
ArrayList<PatentMergePerson> inventorMergeList = new ArrayList<>(mergePersonList);
|
|
List<PatentMergePerson> inventorList = inventorMap.get(inventorId);
|
|
List<PatentMergePerson> inventorList = inventorMap.get(inventorId);
|
|
inventorMergeList.addAll(inventorList);
|
|
inventorMergeList.addAll(inventorList);
|
|
|
|
+ if (CollectionUtils.isEmpty(nameDatas)) {
|
|
|
|
+ if (!CollectionUtils.isEmpty(inventorMergeList)) {
|
|
|
|
+ inventorMergeList.removeIf(inventor -> inventor.getName().equals(name));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//添加子文档
|
|
//添加子文档
|
|
Patent newPatent = new Patent();
|
|
Patent newPatent = new Patent();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
@@ -1214,13 +1221,13 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
Map<String, List<PatentMergePerson>> appMap = this.getChildMergePerson(id, projectId, "merge_applicant");
|
|
Map<String, List<PatentMergePerson>> appMap = this.getChildMergePerson(id, projectId, "merge_applicant");
|
|
if (!CollectionUtils.isEmpty(appMap)) {
|
|
if (!CollectionUtils.isEmpty(appMap)) {
|
|
for (String appId : appMap.keySet()) {
|
|
for (String appId : appMap.keySet()) {
|
|
- if (StringUtils.isNotEmpty(name)) {
|
|
|
|
- this.delSingleMerge(appId, type, name);
|
|
|
|
- }
|
|
|
|
|
|
|
|
List<PatentMergePerson> appMergeList = new ArrayList<>(mergePersonList);
|
|
List<PatentMergePerson> appMergeList = new ArrayList<>(mergePersonList);
|
|
List<PatentMergePerson> appList = appMap.get(appId);
|
|
List<PatentMergePerson> appList = appMap.get(appId);
|
|
appMergeList.addAll(appList);
|
|
appMergeList.addAll(appList);
|
|
|
|
+ if (!CollectionUtils.isEmpty(appMergeList)) {
|
|
|
|
+ appMergeList.removeIf(app -> app.getName().equals(name));
|
|
|
|
+ }
|
|
//添加子文档
|
|
//添加子文档
|
|
Patent newPatent = new Patent();
|
|
Patent newPatent = new Patent();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
@@ -1243,13 +1250,13 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
Map<String, List<PatentMergePerson>> rightMap = this.getChildMergePerson(id, projectId, "merge_right_holder");
|
|
Map<String, List<PatentMergePerson>> rightMap = this.getChildMergePerson(id, projectId, "merge_right_holder");
|
|
if (!CollectionUtils.isEmpty(rightMap)) {
|
|
if (!CollectionUtils.isEmpty(rightMap)) {
|
|
for (String rightId : rightMap.keySet()) {
|
|
for (String rightId : rightMap.keySet()) {
|
|
- if (StringUtils.isNotEmpty(name)) {
|
|
|
|
- this.delSingleMerge(rightId, type, name);
|
|
|
|
- }
|
|
|
|
|
|
|
|
ArrayList<PatentMergePerson> rightMergeList = new ArrayList<>(mergePersonList);
|
|
ArrayList<PatentMergePerson> rightMergeList = new ArrayList<>(mergePersonList);
|
|
List<PatentMergePerson> rightList = rightMap.get(rightId);
|
|
List<PatentMergePerson> rightList = rightMap.get(rightId);
|
|
rightMergeList.addAll(rightList);
|
|
rightMergeList.addAll(rightList);
|
|
|
|
+ if (!CollectionUtils.isEmpty(rightMergeList)) {
|
|
|
|
+ rightMergeList.removeIf(right -> right.getName().equals(name));
|
|
|
|
+ }
|
|
//添加子文档
|
|
//添加子文档
|
|
Patent newPatent = new Patent();
|
|
Patent newPatent = new Patent();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
@@ -1270,13 +1277,13 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
|
|
Map<String, List<PatentMergePerson>> inventorMap = this.getChildMergePerson(id, projectId, "merge_inventor");
|
|
Map<String, List<PatentMergePerson>> inventorMap = this.getChildMergePerson(id, projectId, "merge_inventor");
|
|
if (!CollectionUtils.isEmpty(inventorMap)) {
|
|
if (!CollectionUtils.isEmpty(inventorMap)) {
|
|
for (String inventorId : inventorMap.keySet()) {
|
|
for (String inventorId : inventorMap.keySet()) {
|
|
- if (StringUtils.isNotEmpty(name)) {
|
|
|
|
- this.delSingleMerge(inventorId, type, name);
|
|
|
|
- }
|
|
|
|
|
|
|
|
ArrayList<PatentMergePerson> inventorMergeList = new ArrayList<>(mergePersonList);
|
|
ArrayList<PatentMergePerson> inventorMergeList = new ArrayList<>(mergePersonList);
|
|
List<PatentMergePerson> inventorList = inventorMap.get(inventorId);
|
|
List<PatentMergePerson> inventorList = inventorMap.get(inventorId);
|
|
inventorMergeList.addAll(inventorList);
|
|
inventorMergeList.addAll(inventorList);
|
|
|
|
+ if (!CollectionUtils.isEmpty(inventorMergeList)) {
|
|
|
|
+ inventorMergeList.removeIf(inventor -> inventor.getName().equals(name));
|
|
|
|
+ }
|
|
//添加子文档
|
|
//添加子文档
|
|
Patent newPatent = new Patent();
|
|
Patent newPatent = new Patent();
|
|
PatentJoin patentJoin = new PatentJoin();
|
|
PatentJoin patentJoin = new PatentJoin();
|