zero 1 سال پیش
والد
کامیت
c931e339ab

+ 4 - 2
src/main/java/cn/cslg/pas/common/dto/PatentKinDTO.java

@@ -11,7 +11,7 @@ import java.util.List;
 public class PatentKinDTO {
 
     //摘要
-    private ContentVO abstractStr;
+    private List<Text> abstractStr;
 
     //专利号
     private String patentNo;
@@ -32,5 +32,7 @@ public class PatentKinDTO {
     private List<String> rightHolder;
 
     //标题--专利名称
-    private ContentVO title;
+    private List<Text> title;
+    //摘要附图
+    private String pictureGuid;
 }

+ 2 - 1
src/main/java/cn/cslg/pas/controller/PatentController.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.PatentColumnDTO;
 import cn.cslg.pas.common.dto.PatentDetailDTO;
 import cn.cslg.pas.common.dto.PatentKinDTO;
 import cn.cslg.pas.common.dto.business.EsCountDTO;
@@ -61,7 +62,7 @@ public class PatentController {
     @Operation(summary = "查询专利详情")
     @PostMapping("/selectPatentDetail")
     public Response selectPatentDetail(@RequestBody PatentNoVO vo) throws Exception {
-        PatentDetailDTO dto = patentService.selectPatentDetail(vo);
+        PatentColumnDTO dto = patentService.selectPatentDetail(vo);
         return Response.success(dto);
     }
 

+ 9 - 20
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -11,6 +11,7 @@ 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;
@@ -39,6 +40,7 @@ import com.alibaba.fastjson2.JSONObject;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -63,8 +65,8 @@ public class EsPatentService {
      * @return
      * @throws IOException
      */
-    public PatentDetailDTO selectPatentDetail(PatentNoVO vo) throws IOException {
-        PatentDetailDTO dto = new PatentDetailDTO();
+    public PatentColumnDTO selectPatentDetail(PatentNoVO vo) throws IOException {
+        PatentColumnDTO dto = new PatentColumnDTO();
         SearchRequest.Builder builder = new SearchRequest.Builder();
         //设置查询索引
         builder.index("patent");
@@ -76,19 +78,8 @@ public class EsPatentService {
         for (Hit<Patent> hit : hits) {
             Patent esMess = hit.source();
             BeanUtils.copyProperties(esMess, dto);
-            dto.setMipc(esMess.getMipc());
-            dto.setLegalStatus(esMess.getLegalStatus());
-            dto.setSimpleStatus(esMess.getSimpleStatus());
-            dto.setPatentType(esMess.getPatentType());
-            if (!CollectionUtils.isEmpty(esMess.getTitle())) {
-                dto.setTitle(this.loadContent(esMess.getTitle()));
-            }
-            if (!CollectionUtils.isEmpty(esMess.getAbstractStr())) {
-                dto.setAbstractStr(this.loadContent(esMess.getAbstractStr()));
-            }
-            if (!CollectionUtils.isEmpty(esMess.getClaim())) {
-                dto.setClaim(this.loadContent(esMess.getClaim()));
-            }
+            dto.setRightHolderAddr(esMess.getRightHolderAddr());
+            dto.setApplicantAddr(esMess.getApplicantAddr());
             if (!CollectionUtils.isEmpty(esMess.getApplicant())) {
                 dto.setApplicant(this.loadName(esMess.getApplicant()));
             }
@@ -99,6 +90,7 @@ public class EsPatentService {
                 dto.setInventor(this.loadName(esMess.getInventor()));
             }
         }
+        dto.setPictureGuid(FormatUtil.getPictureFormat(dto.getAppNo()));
         return dto;
     }
 
@@ -176,9 +168,6 @@ public class EsPatentService {
         //设置查询索引
         builder.index("patent");
         //申请号
-        if (StringUtils.isNotEmpty(vo.getAppNo())) {
-
-        }
         Query q1 = QueryBuilders.term(t -> t.field("patent_no.keyword").value(vo.getAppNo()));
         //公开号
         Query q2 = QueryBuilders.term(t -> t.field("patent_no.keyword").value(vo.getPublicNo()));
@@ -196,8 +185,8 @@ public class EsPatentService {
                 kinDTO.setAppNo(patent.getAppNo());
                 kinDTO.setPublicNo(patent.getPublicNo());
                 kinDTO.setGrantNo(patent.getGrantNo());
-                kinDTO.setTitle(this.loadContent(patent.getTitle()));
-                kinDTO.setAbstractStr(this.loadContent(patent.getAbstractStr()));
+                kinDTO.setTitle(patent.getTitle());
+                kinDTO.setAbstractStr(patent.getAbstractStr());
                 kinDTO.setApplicant(this.loadName(patent.getApplicant()));
                 kinDTO.setRightHolder(this.loadName(patent.getRightHolder()));
                 list.add(kinDTO);

+ 9 - 1
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -54,6 +54,8 @@ public class EsService {
     private FormatQueryService formatQueryService;
     @Autowired
     private PatentStarApiService patentStarApiService;
+    @Autowired
+    private EsPatentService esPatentService;
 
 
     /**
@@ -241,7 +243,7 @@ public class EsService {
         SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
         List<PatentColumnDTO> list = new ArrayList<>();
         long total = 0L;
-        if (StringUtils.isNotEmpty(groupField)) {
+        if (StringUtils.isNotEmpty(esField)) {
             Aggregate agg = response.aggregations().get("Agg");
             List<FiltersBucket> buckets = agg.filters().buckets().array();
             for (FiltersBucket bucket : buckets) {
@@ -256,6 +258,9 @@ public class EsService {
                         Patent patent1 = JSONObject.parseObject(String.valueOf(data), Patent.class);
                         PatentColumnDTO columnDTO = new PatentColumnDTO();
                         BeanUtils.copyProperties(patent1, columnDTO);
+                        columnDTO.setApplicant(esPatentService.loadName(patent1.getApplicant()));
+                        columnDTO.setRightHolder(esPatentService.loadName(patent1.getRightHolder()));
+                        columnDTO.setInventor(esPatentService.loadName(patent1.getInventor()));
                         list.add(columnDTO);
                     });
                 }
@@ -268,6 +273,9 @@ public class EsService {
                 PatentColumnDTO columnDTO = new PatentColumnDTO();
 //            columnDTO.setPatentNo(esMess.getPatentNo());
                 BeanUtils.copyProperties(esMess, columnDTO);
+                columnDTO.setApplicant(esPatentService.loadName(esMess.getApplicant()));
+                columnDTO.setRightHolder(esPatentService.loadName(esMess.getRightHolder()));
+                columnDTO.setInventor(esPatentService.loadName(esMess.getInventor()));
                 list.add(columnDTO);
 
             }

+ 2 - 1
src/test/java/cn/cslg/pas/service/EventServiceTests.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.service;
 
+import cn.cslg.pas.common.dto.PatentColumnDTO;
 import cn.cslg.pas.common.dto.PatentDTO;
 import cn.cslg.pas.common.dto.PatentDetailDTO;
 import cn.cslg.pas.common.dto.PatentKinDTO;
@@ -257,7 +258,7 @@ public class EventServiceTests {
     void test9() throws IOException {
         PatentNoVO vo = new PatentNoVO();
         vo.setPatentNo("CN201910069334.7");
-        PatentDetailDTO columnDTO = patentService.selectPatentDetail(vo);
+        PatentColumnDTO columnDTO = patentService.selectPatentDetail(vo);
         System.out.println(columnDTO);
 
 //        String s = "asfassafsafe";