|
@@ -4,21 +4,14 @@ import cn.cslg.pas.common.core.base.IfConstant;
|
|
|
import cn.cslg.pas.common.dto.GetUnselectedDTO;
|
|
|
import cn.cslg.pas.common.dto.PatentColumnDTO;
|
|
|
import cn.cslg.pas.common.dto.PatentDTO;
|
|
|
-//import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
|
-import cn.cslg.pas.common.dto.PatentStarListDTO;
|
|
|
-import cn.cslg.pas.common.dto.business.ContentDetailDTO;
|
|
|
import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
|
import cn.cslg.pas.common.dto.business.SelectClaimDTO;
|
|
|
-import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
|
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
|
|
|
import cn.cslg.pas.common.model.request.MapRequest;
|
|
|
import cn.cslg.pas.common.model.request.OrderDTO;
|
|
|
import cn.cslg.pas.common.model.request.QueryRequest;
|
|
|
import cn.cslg.pas.common.model.request.StringRequest;
|
|
|
import cn.cslg.pas.common.utils.FormatUtil;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
|
|
|
import cn.cslg.pas.common.vo.*;
|
|
|
import cn.cslg.pas.common.vo.es.EsCustomFieldBatchVO;
|
|
|
import cn.cslg.pas.common.vo.es.EsPatentCommonVO;
|
|
@@ -36,7 +29,6 @@ import co.elastic.clients.elasticsearch.core.*;
|
|
|
import co.elastic.clients.elasticsearch.core.search.Hit;
|
|
|
import co.elastic.clients.json.JsonData;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.rabbitmq.client.impl.nio.WriteRequest;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -235,7 +227,7 @@ public class EsService {
|
|
|
return dto;
|
|
|
}
|
|
|
|
|
|
- //获取通用部分方法--检索专利
|
|
|
+ //获取通用检索专利方法--服务检索专利清单
|
|
|
public SearchRequest.Builder getCommonPatent(EsPatentCommonVO commonVO) throws Exception {
|
|
|
String esField = commonVO.getEsField();
|
|
|
Long current = commonVO.getCurrent();
|
|
@@ -268,32 +260,13 @@ public class EsService {
|
|
|
}
|
|
|
|
|
|
//排序
|
|
|
- List<SortOptions> optionsList = new ArrayList<>();
|
|
|
List<OrderDTO> dtoList = commonVO.getOrderDTOList();
|
|
|
- if (!CollectionUtils.isEmpty(dtoList)) {
|
|
|
- String json = CommonService.readJsonFile("patent.json");
|
|
|
- List<EsConfigVO> esConfigVOS = JSON.parseArray(json, EsConfigVO.class);
|
|
|
- for (OrderDTO orderDTO : dtoList) {
|
|
|
- EsConfigVO configVO = esConfigVOS.stream().filter(item -> item.getField().equals(orderDTO.getOrderBy())).findFirst().orElse(null);
|
|
|
- if (configVO != null) {
|
|
|
- if (orderDTO.getOrderType().equals(IfConstant.NO)) {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Asc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- } else {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Desc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field("patent_no.keyword").order(SortOrder.Desc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- }
|
|
|
+ List<SortOptions> optionsList = this.getCommonSortMethod(dtoList);
|
|
|
builder.sort(optionsList);
|
|
|
return builder;
|
|
|
}
|
|
|
|
|
|
- //获取通用部分方法--批量删除、标引、查询价值曲线
|
|
|
+ //获取通用检索专利方法--服务于批量删除、标引、查询价值曲线、导出excel、pdf首页
|
|
|
public SearchRequest.Builder getCommonPatentByGroup(EsPatentCommonVO commonVO) throws Exception {
|
|
|
String esField = commonVO.getEsField();
|
|
|
Long current = commonVO.getCurrent();
|
|
@@ -319,27 +292,8 @@ public class EsService {
|
|
|
}
|
|
|
|
|
|
//排序
|
|
|
- List<SortOptions> optionsList = new ArrayList<>();
|
|
|
List<OrderDTO> dtoList = commonVO.getOrderDTOList();
|
|
|
- if (!CollectionUtils.isEmpty(dtoList)) {
|
|
|
- String json = CommonService.readJsonFile("patent.json");
|
|
|
- List<EsConfigVO> esConfigVOS = JSON.parseArray(json, EsConfigVO.class);
|
|
|
- for (OrderDTO orderDTO : dtoList) {
|
|
|
- EsConfigVO configVO = esConfigVOS.stream().filter(item -> item.getField().equals(orderDTO.getOrderBy())).findFirst().orElse(null);
|
|
|
- if (configVO != null) {
|
|
|
- if (orderDTO.getOrderType().equals(IfConstant.NO)) {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Asc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- } else {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Desc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field("patent_no.keyword").order(SortOrder.Desc).missing(-1)));
|
|
|
- optionsList.add(sortOptions);
|
|
|
- }
|
|
|
+ List<SortOptions> optionsList = this.getCommonSortMethod(dtoList);
|
|
|
builder.sort(optionsList);
|
|
|
return builder;
|
|
|
}
|
|
@@ -387,6 +341,35 @@ public class EsService {
|
|
|
return dto;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取公共排序方法
|
|
|
+ * @param dtoList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<SortOptions> getCommonSortMethod(List<OrderDTO> dtoList) {
|
|
|
+ List<SortOptions> optionsList = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(dtoList)) {
|
|
|
+ String json = CommonService.readJsonFile("patent.json");
|
|
|
+ List<EsConfigVO> esConfigVOS = JSON.parseArray(json, EsConfigVO.class);
|
|
|
+ for (OrderDTO orderDTO : dtoList) {
|
|
|
+ EsConfigVO configVO = esConfigVOS.stream().filter(item -> item.getField().equals(orderDTO.getOrderBy())).findFirst().orElse(null);
|
|
|
+ if (configVO != null) {
|
|
|
+ if (orderDTO.getOrderType().equals(IfConstant.NO)) {
|
|
|
+ SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Asc).missing(-1)));
|
|
|
+ optionsList.add(sortOptions);
|
|
|
+ } else {
|
|
|
+ SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field(configVO.getEsField()).order(SortOrder.Desc).missing(-1)));
|
|
|
+ optionsList.add(sortOptions);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ SortOptions sortOptions = SortOptions.of(i -> i.field(j -> j.field("patent_no.keyword").order(SortOrder.Desc).missing(-1)));
|
|
|
+ optionsList.add(sortOptions);
|
|
|
+ }
|
|
|
+ return optionsList;
|
|
|
+ }
|
|
|
+
|
|
|
//装载专利清单列表的数据
|
|
|
public PatentColumnDTO getPatentColumnDTO(Patent patent, Integer projectId, String id) {
|
|
|
PatentColumnDTO columnDTO = new PatentColumnDTO();
|
|
@@ -514,6 +497,7 @@ public class EsService {
|
|
|
return builder.toString();
|
|
|
}
|
|
|
|
|
|
+ //拼接自定义栏位
|
|
|
public void appendStr(EsCustomFieldValueDTO customField, StringBuilder builder, int m, boolean ifHaveChild,
|
|
|
Integer projectId, Integer taskId) throws Exception {
|
|
|
builder.append("field").append("=").append(customField.getFieldId());
|
|
@@ -565,7 +549,7 @@ public class EsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //拼接ids
|
|
|
+ //拼接专利ids
|
|
|
public String appendIds(List<String> nos) {
|
|
|
String str = "ids = ";
|
|
|
if (nos.size() > 1) {
|
|
@@ -586,7 +570,7 @@ public class EsService {
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
- //拼接NOS
|
|
|
+ //拼接专利号NOS
|
|
|
public String appendNOS(List<String> nos) {
|
|
|
String str = "NO = ";
|
|
|
if (nos.size() > 1) {
|
|
@@ -1581,6 +1565,11 @@ public class EsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 装载条件
|
|
|
+ * @param queryRequest
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public EsPatentCommonVO tranPatentRequestToComVO(QueryRequest queryRequest) {
|
|
|
StringRequest stringRequest = (StringRequest) queryRequest;
|
|
|
EsPatentCommonVO commonVO = new EsPatentCommonVO();
|