浏览代码

Merge remote-tracking branch 'origin/master'

lwhhszx 1 年之前
父节点
当前提交
ce108dfa14

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

@@ -128,8 +128,8 @@ public class PatentController {
     @Operation(summary = "根据专利号查询同族")
     @PostMapping("/selectKinByPatentNo")
     public Response selectKinByPatentNo(@RequestBody PatentKinVO vo) throws Exception {
-        List<PatentKinDTO> dto = patentService.selectKinByPatentNo(vo);
-        return Response.success(dto);
+        Records records = patentService.selectKinByPatentNo(vo);
+        return Response.success(records);
     }
 
     @Operation(summary = "查询分页信息")

+ 3 - 1
src/main/java/cn/cslg/pas/domain/business/AssoProjectFile.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import org.joda.time.DateTime;
 
+import java.util.Date;
+
 /**
  * <p>
  *     专利数据库/报告文件关联表
@@ -41,5 +43,5 @@ public class AssoProjectFile extends BaseEntity<AssoProjectFile> {
      * 创建时间
      */
     @TableField(value = "create_time")
-    private DateTime createTime;
+    private Date createTime;
 }

+ 32 - 0
src/main/java/cn/cslg/pas/factorys/PatentExportFactory/GetTextContentValue.java

@@ -0,0 +1,32 @@
+package cn.cslg.pas.factorys.PatentExportFactory;
+
+import cn.cslg.pas.common.model.cronModel.SystemFile;
+import cn.cslg.pas.domain.es.Text;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/2/20
+ */
+@Component
+public class GetTextContentValue implements GetValueImp{
+    @Override
+    public String getValue(Object value) {
+        try {
+            String text = JSONObject.toJSONString(value);
+            List<Text> texts = JSONObject.parseArray(text, Text.class);
+            if (!texts.isEmpty()) {
+                return texts.get(0).getTextContent();
+            } else {
+                return "";
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+}

+ 4 - 1
src/main/java/cn/cslg/pas/service/business/PatentDigProjectFilesService.java

@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -319,7 +320,9 @@ public class PatentDigProjectFilesService extends ServiceImpl<PatentDigProjectFi
         if (projectId == null) {
             throw new XiaoShiException("projectId为空");
         }
+        //流程id
         Integer processId = queryPatentDigProjectFilesDTO.getProcessId();
+        //任务id
         Integer taskId = queryPatentDigProjectFilesDTO.getTaskId();
         LambdaQueryWrapper<PatentDigProjectFiles> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(PatentDigProjectFiles::getProjectId, projectId);
@@ -379,7 +382,7 @@ public class PatentDigProjectFilesService extends ServiceImpl<PatentDigProjectFi
                 patentDigProjectFilesVO.setProjectId(projectId);
                 patentDigProjectFilesVO.setFileGuid(item.getFileGuid());
                 patentDigProjectFilesVO.setCreateId(item.getCreateId());
-                patentDigProjectFilesVO.setCreateTime(item.getCreateTime().toDate());
+                patentDigProjectFilesVO.setCreateTime(item.getCreateTime());
                 patentDigProjectFilesVOS.add(patentDigProjectFilesVO);
             });
         }

+ 4 - 2
src/main/java/cn/cslg/pas/service/business/PatentExportService.java

@@ -136,8 +136,10 @@ public class PatentExportService {
                         PatentConfigVO patentConfigVO = patentConfigVOS.stream().filter(item -> item.getValue().equals(column)).findFirst().orElse(null);
                         String exportClass = patentConfigVO.getExportClass();
                         GetValueImp getValueImp = patentExportFactory.getClass(exportClass);
-                        String reValue = getValueImp.getValue(value);
-                        map.put(patentExportVO.getName(), reValue);
+                        if (getValueImp != null) {
+                            String reValue = getValueImp.getValue(value);
+                            map.put(patentExportVO.getName(), reValue);
+                        }
                     }
                 }
                 //新建一普通行

+ 10 - 5
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -173,7 +173,7 @@ public class EsPatentService {
     public List<String> loadName(List<PatentPerson> list) {
         List<String> collect = new ArrayList<>();
         if (!CollectionUtils.isEmpty(list)) {
-            collect = list.stream().map(PatentPerson::getName).collect(Collectors.toList());
+            collect = list.stream().filter(i -> StringUtils.isNotEmpty(i.getName())).map(PatentPerson::getName).collect(Collectors.toList());
         }
         return collect;
     }
@@ -339,7 +339,7 @@ public class EsPatentService {
      * @return
      * @throws IOException
      */
-    public List<PatentKinDTO> selectKinByPatentNo(PatentKinVO vo) throws IOException {
+    public Records selectKinByPatentNo(PatentKinVO vo) throws IOException {
         //1.根据专利号查询出同族
         String no = vo.getNo();
         Integer pageNum = vo.getPageNum();
@@ -395,7 +395,12 @@ public class EsPatentService {
                 }
             }
         }
-        return kinDTOS;
+        Records records = new Records();
+        records.setCurrent(vo.getPageNum().longValue());
+        records.setSize(vo.getPageSize().longValue());
+        records.setData(kinDTOS);
+        records.setTotal(Long.valueOf(String.valueOf(kinDTOS.size())));
+        return records;
     }
 
     public List<PatentKinDTO> selectPatentKindDetail(PatentKinDetailVO vo, String patentNo) throws IOException {
@@ -406,9 +411,9 @@ public class EsPatentService {
         //设置查询索引
         builder.index("patent");
         //申请号
-        Query q1 = QueryBuilders.term(t -> t.field("patent_no.keyword").value(vo.getAppNo()));
+        Query q1 = QueryBuilders.term(t -> t.field("app_no.keyword").value(vo.getAppNo()));
         //公开号
-        Query q2 = QueryBuilders.term(t -> t.field("patent_no.keyword").value(vo.getPublicNo()));
+        Query q2 = QueryBuilders.term(t -> t.field("public_no.keyword").value(vo.getPublicNo()));
         //授权号
 //        Query q3 = QueryBuilders.term(t -> t.field("patent_no.keyword").value(vo.getGrantNo()));
         Query bool = null;

+ 22 - 20
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -1032,34 +1032,36 @@ public class PatentStarApiService {
         QueryExternalFamilyDTO familyDTO = JSONObject.parseObject(family, QueryExternalFamilyDTO.class);
         String familyInfos = familyDTO.getFamilyinfo();
         List<String> publicNos = new ArrayList<>();
-        if (StringUtils.isNotEmpty(familyInfos) && familyInfos.equals("{}")) {
+        if (StringUtils.isNotEmpty(familyInfos) && !familyInfos.equals("{}")) {
             publicNos = Arrays.asList(familyInfos.split(";"));
         }
 
-        String pubNo = "";
+        List<PatentColumnDTO> list = new ArrayList<>();
         if (!CollectionUtils.isEmpty(publicNos)) {
-            int count = publicNos.size() - 1;
-            for (int i = 0; i < publicNos.size(); i++) {
-                String s = publicNos.get(i);
-                if (i == count) {
-                    pubNo = pubNo + s;
+            for (String publicNo : publicNos) {
+                PatentStarListDTO patentStarListDTO = new PatentStarListDTO();
+                String condition = "PN=" + publicNo;
+                patentStarListDTO.setCurrentQuery(condition);
+                String index = publicNo.substring(0, 2);
+                if (index.equals("CN")) {
+                    patentStarListDTO.setDBType("CN");
                 } else {
-                    pubNo = pubNo + s + " " + "OR" + " ";
+                    patentStarListDTO.setDBType("WD");
                 }
+                patentStarListDTO.setOrderBy("AD");
+                patentStarListDTO.setOrderByType("DESC");
+                patentStarListDTO.setPageNum(vo.getPageNum());
+                patentStarListDTO.setRowCount(vo.getPageSize());
+                records = this.patentStarSearchLocal(patentStarListDTO);
+                list.addAll((Collection<? extends PatentColumnDTO>) records.getData());
             }
         }
-        if (StringUtils.isNotEmpty(pubNo)) {
-            PatentStarListDTO patentStarListDTO = new PatentStarListDTO();
-            String condition = "PN=" + "(" + pubNo + ")";
-            patentStarListDTO.setCurrentQuery(condition);
-            patentStarListDTO.setDBType("CN");
-            patentStarListDTO.setOrderBy("AD");
-            patentStarListDTO.setOrderByType("DESC");
-            patentStarListDTO.setPageNum(vo.getPageNum());
-            patentStarListDTO.setRowCount(vo.getPageSize());
-            records = this.patentStarSearchLocal(patentStarListDTO);
-        }
-        return records;
+        Records record = new Records();
+        record.setCurrent(vo.getPageNum().longValue());
+        record.setSize(vo.getPageSize().longValue());
+        record.setData(list);
+        record.setTotal(Long.valueOf(String.valueOf(list.size())));
+        return record;
     }
 
     /**

+ 4 - 2
src/main/resources/jsons/patent.json

@@ -151,7 +151,8 @@
     "defaultHidden": "true",
     "ifStats": "false",
     "groupBy": "text",
-    "ifSort": "true"
+    "ifSort": "true",
+    "exportClass": "getTextContentValue"
   },
   {
     "name": "标题",
@@ -166,7 +167,8 @@
     "ifAsCondition": "true",
     "ifStats": "false",
     "groupBy": "text",
-    "ifSort": "false"
+    "ifSort": "false",
+    "exportClass": "getTextContentValue"
   },
   {
     "name": "申请人",

+ 11 - 4
src/test/java/cn/cslg/pas/service/EventServiceTests.java

@@ -27,6 +27,7 @@ import cn.cslg.pas.service.business.es.EsCountService;
 import cn.cslg.pas.service.business.es.EsCustomFieldService;
 import cn.cslg.pas.service.business.es.EsService;
 import cn.cslg.pas.service.business.es.EsPatentService;
+import cn.cslg.pas.service.common.FileManagerService;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.http.entity.ContentType;
 import org.junit.jupiter.api.Test;
@@ -67,8 +68,8 @@ public class EventServiceTests {
     private EsCustomFieldService esCustomFieldService;
     @Autowired
     private MergePersonService mergePersonService;
-
-
+    @Autowired
+    private FileManagerService fileManagerService;
     @Autowired
     private ProductMarketDataService productMarketDataService;
     @Autowired
@@ -277,8 +278,8 @@ public class EventServiceTests {
         vo.setPageNum(1);
         vo.setPageSize(10);
         vo.setType("inpadoc");
-        List<PatentKinDTO> kinDTOS = patentService.selectKinByPatentNo(vo);
-        System.out.println(kinDTOS);
+        Records records = patentService.selectKinByPatentNo(vo);
+        System.out.println(records);
     }
 
     @Test
@@ -500,4 +501,10 @@ public class EventServiceTests {
         System.out.println(collect);
     }
 
+    @Test
+    public void test103() throws IOException {
+        List<String> fms = Arrays.asList("CN200880110903.8_p");
+        String systemFileFromFMS = fileManagerService.getSystemFileFromFMS(fms);
+        System.out.println(systemFileFromFMS);
+    }
 }