Browse Source

导出FTO报告

lwhhszx 1 năm trước cách đây
mục cha
commit
3e205cce94
34 tập tin đã thay đổi với 857 bổ sung157 xóa
  1. 8 0
      src/main/java/cn/cslg/pas/common/core/base/FamilyType.java
  2. 5 0
      src/main/java/cn/cslg/pas/common/core/base/PatentDictionary.java
  3. 4 0
      src/main/java/cn/cslg/pas/common/core/base/RedisConf.java
  4. 15 0
      src/main/java/cn/cslg/pas/common/dto/AddBatchLiteratureDTO.java
  5. 1 0
      src/main/java/cn/cslg/pas/common/dto/AddSelfFieldDTO.java
  6. 5 5
      src/main/java/cn/cslg/pas/common/dto/CompareLiteratureDTO.java
  7. 2 2
      src/main/java/cn/cslg/pas/common/dto/PatentColumnDTO.java
  8. 18 0
      src/main/java/cn/cslg/pas/common/dto/QueryFieldsDTO.java
  9. 18 0
      src/main/java/cn/cslg/pas/common/dto/patentCount/AddPatentCountDTO.java
  10. 15 0
      src/main/java/cn/cslg/pas/common/dto/patentCount/GetAllPatentCountDTO.java
  11. 15 0
      src/main/java/cn/cslg/pas/common/dto/patentCount/GetTabelColumDTO.java
  12. 0 17
      src/main/java/cn/cslg/pas/common/vo/ConditionVO.java
  13. 14 2
      src/main/java/cn/cslg/pas/common/vo/PersonSelfFieldVO.java
  14. 19 0
      src/main/java/cn/cslg/pas/common/vo/QueryFieldVO.java
  15. 2 2
      src/main/java/cn/cslg/pas/common/vo/EntityVO.java
  16. 20 0
      src/main/java/cn/cslg/pas/common/vo/QueryFiledVO.java
  17. 31 0
      src/main/java/cn/cslg/pas/common/vo/patentCount/GetAllPatentCountVO.java
  18. 26 21
      src/main/java/cn/cslg/pas/controller/CommonController.java
  19. 0 10
      src/main/java/cn/cslg/pas/controller/ImportTaskController.java
  20. 101 0
      src/main/java/cn/cslg/pas/controller/PersonFieldController.java
  21. 0 3
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEntrustGroup.java
  22. 6 10
      src/main/java/cn/cslg/pas/service/business/CommonService.java
  23. 6 1
      src/main/java/cn/cslg/pas/service/business/CustomFieldService.java
  24. 2 0
      src/main/java/cn/cslg/pas/service/business/FTOCompareRecordService.java
  25. 3 0
      src/main/java/cn/cslg/pas/service/business/ProductService.java
  26. 8 0
      src/main/java/cn/cslg/pas/service/business/ProjectTaskService.java
  27. 0 10
      src/main/java/cn/cslg/pas/service/business/es/EsService.java
  28. 1 12
      src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java
  29. 381 19
      src/main/java/cn/cslg/pas/service/common/PersonFieldService.java
  30. 51 6
      src/main/java/cn/cslg/pas/service/importPatent/GetPatentFromExcelThread.java
  31. 30 16
      src/main/resources/jsons/patent.json
  32. 27 13
      src/main/resources/jsons/product.json
  33. 16 8
      src/main/resources/jsons/treeNode.json
  34. 7 0
      src/main/resources/mapper/FTOCompareRecordMapper.xml

+ 8 - 0
src/main/java/cn/cslg/pas/common/core/base/FamilyType.java

@@ -0,0 +1,8 @@
+package cn.cslg.pas.common.core.base;
+
+public class FamilyType {
+    public static final String SIMPLE = "simple";
+    public static final String INPADOC = "inpadoc";
+    public static final String PATSNAP = "patsnap";
+
+}

+ 5 - 0
src/main/java/cn/cslg/pas/common/core/base/PatentDictionary.java

@@ -0,0 +1,5 @@
+package cn.cslg.pas.common.core.base;
+
+public class PatentDictionary {
+    public  static final String NAME="patent";
+}

+ 4 - 0
src/main/java/cn/cslg/pas/common/core/base/RedisConf.java

@@ -19,4 +19,8 @@ public class RedisConf {
     public final static String USER_IMPORT = "user-import";
     public final static String PROJECT_FIELD_ORDER="project_field_order";
     public final static String TASK_FIELD_ORDER="task_field_order";
+    public final static  String PATENT_COUNT="patent-count";
+    public final static String TASK_FIELD_COUNT="task_field_count";
+    public final static String PROJECT_FIELD_COUNT="project_field_count";
+    public final static String FIELD_COUNT="field_count";
 }

+ 15 - 0
src/main/java/cn/cslg/pas/common/dto/AddBatchLiteratureDTO.java

@@ -0,0 +1,15 @@
+package cn.cslg.pas.common.dto;
+
+import lombok.Data;
+
+@Data
+public class AddBatchLiteratureDTO {
+
+    private String name; //文件名称
+    private String fileGuid; //文件guid
+    private String description; //描述
+    private Integer projectId; //报告id
+    private String authorName; //作者
+    private Integer type;//类型
+
+}

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/AddSelfFieldDTO.java

@@ -12,5 +12,6 @@ import java.util.List;
 public class AddSelfFieldDTO {
     private String tableName;
     private List<PersonSelfFieldVO> value;
+    private Integer projectId;
 
 }

+ 5 - 5
src/main/java/cn/cslg/pas/common/dto/CompareLiteratureDTO.java

@@ -5,9 +5,9 @@ import lombok.Data;
 @Data
 public class CompareLiteratureDTO {
 
-     private String   fileName;
-     private String    fileGuid;
-     private String   description;
-     private Integer   projectId;
-
+     private String   name; //文件名称
+     private String    fileGuid; //文件guid
+     private String   description; //描述
+     private Integer   projectId; //报告id
+     private String authorName; //作者
 }

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

@@ -22,7 +22,7 @@ public class PatentColumnDTO {
     /**
      * 标题
      */
-    private ContentVO title;
+    private List<Text> title;
 
     /**
      * 公开说明书文本
@@ -37,7 +37,7 @@ public class PatentColumnDTO {
     /**
      * 摘要
      */
-    private ContentVO abstractStr;
+    private List<Text> abstractStr;
 
     /**
      * 申请人地址

+ 18 - 0
src/main/java/cn/cslg/pas/common/dto/QueryFieldsDTO.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.common.dto;
+
+import cn.cslg.pas.domain.es.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class QueryFieldsDTO {
+ private String tableName;
+ private Integer projectId;
+}

+ 18 - 0
src/main/java/cn/cslg/pas/common/dto/patentCount/AddPatentCountDTO.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.common.dto.patentCount;
+
+import cn.cslg.pas.common.vo.PersonSelfFieldVO;
+import cn.cslg.pas.common.vo.patentCount.GetAllPatentCountVO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 实体类表以及栏位信息
+ */
+@Data
+public class AddPatentCountDTO {
+    private List<GetAllPatentCountVO> value;
+    private Integer projectId;
+    private Integer taskId;
+
+}

+ 15 - 0
src/main/java/cn/cslg/pas/common/dto/patentCount/GetAllPatentCountDTO.java

@@ -0,0 +1,15 @@
+package cn.cslg.pas.common.dto.patentCount;
+
+import lombok.Data;
+
+/**
+ * 查询所有统计字段
+ */
+@Data
+public class GetAllPatentCountDTO {
+    //专题库id
+    private  Integer projectId;
+    //任务id
+    private Integer taskId;
+
+}

+ 15 - 0
src/main/java/cn/cslg/pas/common/dto/patentCount/GetTabelColumDTO.java

@@ -0,0 +1,15 @@
+package cn.cslg.pas.common.dto.patentCount;
+
+import lombok.Data;
+
+/**
+ * 查询所有统计字段
+ */
+@Data
+public class GetTabelColumDTO {
+    //专题库id
+    private  Integer projectId;
+    //任务id
+    private Integer taskId;
+    private String tableName;
+}

+ 0 - 17
src/main/java/cn/cslg/pas/common/vo/ConditionVO.java

@@ -1,17 +0,0 @@
-package cn.cslg.pas.common.vo;
-
-import lombok.Data;
-
-/**
- * 实体类栏位信息
- */
-@Data
-public class ConditionVO {
-    private String name;
-    private String type;
-    private String value;
-    private Boolean ifSearch;
-    private Boolean ifGroup;
-    private Boolean ifShow;
-
-}

+ 14 - 2
src/main/java/cn/cslg/pas/common/vo/PersonSelfFieldVO.java

@@ -7,14 +7,26 @@ import lombok.Data;
  */
 @Data
 public class PersonSelfFieldVO {
+    /**栏位名称
+     *
+     */
     private String name;
+    /**
+     * 栏位值类型
+     */
     private String type;
+    /**
+     * 返回值名
+     */
     private String value;
+    /**
+     * 排序
+     */
     private Integer order;
-    private Boolean ifSearch;
+
     private Boolean ifShow;
     private Boolean ifHidden;
-    private Boolean defaultHidden;
     private Integer createType;
+    private Boolean  DefaultHidden;
 
 }

+ 19 - 0
src/main/java/cn/cslg/pas/common/vo/QueryFieldVO.java

@@ -0,0 +1,19 @@
+package cn.cslg.pas.common.vo;
+
+import lombok.Data;
+
+/**
+ * 实体类栏位信息
+ */
+@Data
+public class QueryFieldVO {
+    private String name;
+    private String type;
+    private String field;
+    private Boolean ifSearch;
+    private Boolean ifGroup;
+    //栏位类型  -1著录 0数字,1日期,2文本,4单选,5多选,6树,7产品8产品类别9技术分类
+    private Integer fieldType;
+
+
+}

+ 2 - 2
src/main/java/cn/cslg/pas/common/vo/EntityVO.java

@@ -8,8 +8,8 @@ import java.util.List;
  * 实体类表以及栏位信息
  */
 @Data
-public class EntityVO {
+public class QueryFieldsVO {
     private String tableName;
-    private List<ConditionVO> conditionDTOList;
+    private List<QueryFiledVO> conditionDTOList;
 
 }

+ 20 - 0
src/main/java/cn/cslg/pas/common/vo/QueryFiledVO.java

@@ -0,0 +1,20 @@
+package cn.cslg.pas.common.vo;
+
+import lombok.Data;
+
+/**
+ * 实体类栏位信息
+ */
+@Data
+public class QueryFiledVO {
+    private String name;
+    private String type;
+    private String field;
+    private Boolean ifSearch;
+    private Boolean ifGroup;
+    //-1专利著录 0自定义字段 7产品 8产品类别 9技术分类
+    private Integer filedKind;
+    //栏位选项查询参数
+    private String fieldOptionQueryParam;
+    private String group;
+}

+ 31 - 0
src/main/java/cn/cslg/pas/common/vo/patentCount/GetAllPatentCountVO.java

@@ -0,0 +1,31 @@
+package cn.cslg.pas.common.vo.patentCount;
+
+import lombok.Data;
+
+/**
+ * 查询所有统计字段
+ */
+@Data
+public class GetAllPatentCountVO {
+    /**栏位名称
+     *
+     */
+    private String name;
+    /**
+     * 栏位值类型
+     */
+    private String type;
+    /**
+     * 返回值名
+     */
+    private String value;
+
+    /**
+     * 是否统计
+     */
+    private Boolean ifStats;
+
+    //-1专利著录 0自定义字段 7产品 8产品类别 9技术分类
+    private Integer filedKind;
+    private Boolean defaultShowStats;
+}

+ 26 - 21
src/main/java/cn/cslg/pas/controller/CommonController.java

@@ -2,16 +2,13 @@ package cn.cslg.pas.controller;
 
 
 import cn.cslg.pas.common.core.base.Constants;
-import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.dto.QueryFieldsDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.utils.StringUtils;
 import cn.cslg.pas.common.dto.AddSelfFieldDTO;
-import cn.cslg.pas.common.vo.EntityVO;
+import cn.cslg.pas.common.vo.QueryFieldsVO;
 import cn.cslg.pas.common.vo.PersonSelfFieldVO;
-import cn.cslg.pas.common.vo.business.ScenarioVO;
-import cn.cslg.pas.domain.business.AssoScenarioMatter;
-import cn.cslg.pas.domain.business.Matter;
 import cn.cslg.pas.domain.business.SystemDict;
 import cn.cslg.pas.service.business.AssoScenarioMatterService;
 import cn.cslg.pas.service.business.CommonService;
@@ -49,14 +46,14 @@ public class CommonController {
 
     @PostMapping("getOsSystemDict")
     @Operation(summary = "根据类型获取所有字典项")
-    public Response getOSSystemDict(@RequestBody List<String> types){
+    public Response getOSSystemDict(@RequestBody List<String> types) {
         return Response.success(systemDictService.getOsSystemDict(types));
     }
 
     @PostMapping("getParams")
     @Operation(summary = "获得实体类栏位信息")
     public Response getQueryConditions(@RequestBody List<String> tables) {
-        List<EntityVO> vos = commonService.getQueryConditions(tables);
+        List<QueryFieldsVO> vos = commonService.getQueryConditions(tables);
         return Response.success(vos);
     }
 
@@ -75,15 +72,14 @@ public class CommonController {
 
     @GetMapping("getCustomField")
     @Operation(summary = "查询个人栏位配置")
-    public Response getCustomField(String tableName) {
+    public Response getCustomField(String tableName, Integer projectId) {
         try {
-          List<PersonSelfFieldVO> personSelfFieldVOS= personFieldService.getCustomField(tableName);
-            Records records =new Records();
+            List<PersonSelfFieldVO> personSelfFieldVOS = personFieldService.getCustomField(tableName, projectId);
+            Records records = new Records();
             records.setData(personSelfFieldVOS);
             return Response.success(records);
-        }
-        catch (Exception e){
-                return Response.error(e.getMessage());
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
         }
 
     }
@@ -93,19 +89,19 @@ public class CommonController {
     @Operation(summary = "设置个人栏位配置")
     public Response setCustomField(@RequestBody AddSelfFieldDTO addSelfFieldDTO) {
         try {
-            List<PersonSelfFieldVO> personSelfFieldVOS= personFieldService.setCustomField(addSelfFieldDTO);
-            Records records =new Records();
+            List<PersonSelfFieldVO> personSelfFieldVOS = personFieldService.setCustomField(addSelfFieldDTO);
+            Records records = new Records();
             records.setData(personSelfFieldVOS);
             return Response.success(records);
-        }
-        catch (Exception e){
+        } catch (Exception e) {
             return Response.error(e.getMessage());
         }
 
     }
+
     @GetMapping("/scenario")
     @Operation(summary = "查询应用场景")
-    public Response queryAllScenario(){
+    public Response queryAllScenario() {
         Records records = new Records();
         records.setData(scenarioService.queryAll());
         return Response.success(records);
@@ -113,7 +109,7 @@ public class CommonController {
 
     @PostMapping("/matter")
     @Operation(summary = "查询处理事项")
-    public Response queryMatter(@RequestBody List<Integer> scenarioIds){
+    public Response queryMatter(@RequestBody List<Integer> scenarioIds) {
         Records records = new Records();
         records.setData(assoScenarioMatterService.queryMatterIds(scenarioIds));
         return Response.success(records);
@@ -121,7 +117,7 @@ public class CommonController {
 
     @GetMapping("/queryCrons")
     @Operation(summary = "查找核心结论")
-    public Response queryCrons(Integer reportType){
+    public Response queryCrons(Integer reportType) {
         Records records = new Records();
         records.setData(systemDictService.getCrons(reportType));
         return Response.success(records);
@@ -130,10 +126,19 @@ public class CommonController {
 
     @GetMapping("/getExcelConfig")
     @Operation(summary = "查找excel导入配置")
-    public Response getExcelConfig(){
+    public Response getExcelConfig() {
         Records records = new Records();
         records.setData(commonService.getExcelConfig());
         return Response.success(records);
     }
 
+    @PostMapping("getQueryFields")
+    @Operation(summary = "获得检索栏位")
+    public Response getQueryFields(@RequestBody List<QueryFieldsDTO> queryFieldsDTOs) {
+        List<QueryFieldsVO> queryFieldsVOS = personFieldService.getQueryFields(queryFieldsDTOs);
+        Records records = new Records();
+        records.setData(queryFieldsVOS);
+        return Response.success(records);
+    }
+
 }

+ 0 - 10
src/main/java/cn/cslg/pas/controller/ImportTaskController.java

@@ -2,15 +2,10 @@ package cn.cslg.pas.controller;
 
 
 import cn.cslg.pas.common.core.base.Constants;
-import cn.cslg.pas.common.dto.AddSelfFieldDTO;
 import cn.cslg.pas.common.dto.ImportTaskDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.Response;
-import cn.cslg.pas.common.utils.StringUtils;
-import cn.cslg.pas.common.vo.EntityVO;
-import cn.cslg.pas.common.vo.PersonSelfFieldVO;
-import cn.cslg.pas.domain.business.SystemDict;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
 import cn.cslg.pas.service.business.*;
@@ -20,11 +15,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
 @Slf4j
 @RequestMapping(Constants.API_XiaoSHI + "/importTask")
 @RestController

+ 101 - 0
src/main/java/cn/cslg/pas/controller/PersonFieldController.java

@@ -0,0 +1,101 @@
+package cn.cslg.pas.controller;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.AddSelfFieldDTO;
+import cn.cslg.pas.common.dto.QueryFieldsDTO;
+import cn.cslg.pas.common.dto.business.AvoidDesignInsertDTO;
+import cn.cslg.pas.common.dto.business.GetFeatureSplitDTO;
+import cn.cslg.pas.common.dto.patentCount.AddPatentCountDTO;
+import cn.cslg.pas.common.dto.patentCount.GetAllPatentCountDTO;
+import cn.cslg.pas.common.dto.patentCount.GetTabelColumDTO;
+import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.common.vo.PersonSelfFieldVO;
+import cn.cslg.pas.common.vo.QueryFieldsVO;
+import cn.cslg.pas.common.vo.business.AvoidDesignWholeVO;
+import cn.cslg.pas.common.vo.patentCount.GetAllPatentCountVO;
+import cn.cslg.pas.exception.ConditionException;
+import cn.cslg.pas.exception.UnLoginException;
+import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.AvoidDesignService;
+import cn.cslg.pas.service.business.AvoidDesignWholeService;
+import cn.cslg.pas.service.common.PersonFieldService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 个人自定义栏位设置管理
+ *
+ * @Author lrj
+ * @Date 2023/12/21
+ */
+@Slf4j
+@RequestMapping(Constants.API_XiaoSHI + "/personField")
+@RestController
+public class PersonFieldController {
+    @Autowired
+    private PersonFieldService personFieldService;
+
+
+    @Operation(summary = "获取检索栏位")
+    @PostMapping("/getQueryFields")
+    public Response getQueryFields(@RequestBody List<QueryFieldsDTO> queryFieldsDTOs) throws Exception {
+        List<QueryFieldsVO> queryFieldsVOS = personFieldService.getQueryFields(queryFieldsDTOs);
+        Records records = new Records();
+        records.setData(queryFieldsVOS);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "获得表格显示栏位")
+    @PostMapping("/getTableColumns")
+    public Response getTableColumns(@RequestBody GetTabelColumDTO getTabelColumDTO) throws Exception {
+        List<PersonSelfFieldVO> personSelfFieldVOS = personFieldService.getTableColumns(getTabelColumDTO);
+        Records records = new Records();
+        records.setData(personSelfFieldVOS);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "获得所有统计栏位")
+    @PostMapping("/getAllCountColumns")
+    public Response getAllCountColumns(@RequestBody GetAllPatentCountDTO getAllPatentCountDTO) throws Exception {
+        List<GetAllPatentCountVO> getAllPatentCountVOS = personFieldService.getAllCountColumns(getAllPatentCountDTO);
+        Records records = new Records();
+        records.setData(getAllPatentCountVOS);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "设置表格显示栏位")
+    @PostMapping("/setTableColumns")
+    public Response setTableColumns(@RequestBody AddSelfFieldDTO addSelfFieldDTO) throws Exception {
+        List<PersonSelfFieldVO> personSelfFieldVOS = personFieldService.setTableColumns(addSelfFieldDTO);
+        Records records = new Records();
+        records.setData(personSelfFieldVOS);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "设置显示的统计栏位")
+    @PostMapping("/setShowCountColumns")
+    public Response setShowCountColumns(@RequestBody AddPatentCountDTO addPatentCountDTO) throws Exception {
+        List<GetAllPatentCountVO> getAllPatentCountVOS = personFieldService.setShowCountColumns(addPatentCountDTO);
+        Records records = new Records();
+        records.setData(getAllPatentCountVOS);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "获得显示的统计栏位")
+    @PostMapping("/getShowCountColumns")
+    public Response getShowCountColumns(@RequestBody GetAllPatentCountDTO getAllPatentCountDTO) throws Exception {
+        List<GetAllPatentCountVO> getAllPatentCountVOS = personFieldService.getShowCountColumns(getAllPatentCountDTO);
+        Records records = new Records();
+        records.setData(getAllPatentCountVOS);
+        return Response.success(records);
+    }
+}

+ 0 - 3
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEntrustGroup.java

@@ -1,11 +1,8 @@
 package cn.cslg.pas.factorys.reGroupFactory;
 
 import cn.cslg.pas.common.model.cronModel.ReGroupDataVO;
-import cn.cslg.pas.common.vo.EntityVO;
 import cn.cslg.pas.common.vo.EntrustVO;
-import cn.cslg.pas.domain.business.Matter;
 import cn.cslg.pas.mapper.EventMapper;
-import cn.cslg.pas.service.business.MatterService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSON;
 import lombok.extern.slf4j.Slf4j;

+ 6 - 10
src/main/java/cn/cslg/pas/service/business/CommonService.java

@@ -1,13 +1,10 @@
 package cn.cslg.pas.service.business;
 
 import cn.cslg.pas.Application;
-import cn.cslg.pas.common.model.common.QueryCondition;
-import cn.cslg.pas.common.model.cronModel.GroupConfig;
-import cn.cslg.pas.common.model.cronModel.SqlObject;
 import cn.cslg.pas.common.utils.FileUtils;
 import cn.cslg.pas.common.utils.JsonUtils;
-import cn.cslg.pas.common.vo.ConditionVO;
-import cn.cslg.pas.common.vo.EntityVO;
+import cn.cslg.pas.common.vo.QueryFiledVO;
+import cn.cslg.pas.common.vo.QueryFieldsVO;
 import cn.cslg.pas.common.vo.UploadSettingVO;
 import cn.cslg.pas.domain.business.Event;
 import com.alibaba.fastjson.JSON;
@@ -19,7 +16,6 @@ import org.springframework.stereotype.Service;
 
 import java.io.*;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 公用服务类
@@ -65,8 +61,8 @@ public class CommonService {
         }
     }
 
-    public List<EntityVO> getQueryConditions(List<String> tableNames) {
-        List<EntityVO> entityVOS = new ArrayList<>();
+    public List<QueryFieldsVO> getQueryConditions(List<String> tableNames) {
+        List<QueryFieldsVO> entityVOS = new ArrayList<>();
         tableNames.forEach(item -> {
             String json = null;
             try {
@@ -76,9 +72,9 @@ public class CommonService {
 
             }
             if (json != null) {
-                EntityVO entityVO = new EntityVO();
+                QueryFieldsVO entityVO = new QueryFieldsVO();
                 entityVO.setTableName(item);
-                List<ConditionVO> queryConditions = JSON.parseArray(json, ConditionVO.class);
+                List<QueryFiledVO> queryConditions = JSON.parseArray(json, QueryFiledVO.class);
                 entityVO.setConditionDTOList(queryConditions);
                 entityVOS.add(entityVO);
             }

+ 6 - 1
src/main/java/cn/cslg/pas/service/business/CustomFieldService.java

@@ -389,7 +389,12 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
         return allCustomFieldVOS;
     }
 
-
+    /**
+     * 查询栏位选项
+     * @param queryEsCustomFieldDTO
+     * @return
+     * @throws Exception
+     */
     public Records getCustomFieldValues(QueryEsCustomFieldDTO queryEsCustomFieldDTO) throws Exception {
 
         List<FieldValueVO> fieldValueVOS = new ArrayList<>();

+ 2 - 0
src/main/java/cn/cslg/pas/service/business/FTOCompareRecordService.java

@@ -934,6 +934,8 @@ public class FTOCompareRecordService extends ServiceImpl<FTOCompareRecordMapper,
             patentNos.forEach(patentNo -> {
                 //根据报告id和专利号查询最新的对比结果的任务id
                 Integer lastTaskId = this.getLastTaskIdFromRecords(projectId, patentNo);
+                //添加专利和任务关联
+
                 if (lastTaskId != null) {
                     //根据projectId lastTaskId patentNo查询最新的对比结果集合并复制
                     List<FTOCompareRecord> ftoCompareRecords1 = this.getLastFTORecord(projectId, patentNo, lastTaskId);

+ 3 - 0
src/main/java/cn/cslg/pas/service/business/ProductService.java

@@ -408,6 +408,9 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
         if (guids.size() != 0) {
             String res = fileManagerService.getSystemFileFromFMS(guids);
             systemFiles = JSONObject.parseArray(res, SystemFile.class);
+            if(systemFiles==null){
+                systemFiles=new ArrayList<>();
+            }
         }
 
         //装载信息

+ 8 - 0
src/main/java/cn/cslg/pas/service/business/ProjectTaskService.java

@@ -1167,4 +1167,12 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
         }
         assoTaskFieldService.saveBatch(assoTaskFields);
     }
+
+    /**
+     *
+     */
+    public void getPatent(String patentNo,Integer taskId){
+
+
+    }
 }

+ 0 - 10
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -217,16 +217,6 @@ public class EsService {
             PatentColumnDTO columnDTO = new PatentColumnDTO();
 //            columnDTO.setPatentNo(esMess.getPatentNo());
             BeanUtils.copyProperties(esMess, columnDTO);
-            ContentVO titleVO = new ContentVO();
-            String title = StringUtils.strip(JSON.toJSONString(esMess.getTitle()), "[]");
-            ContentDetailDTO titleContent = JSONObject.parseObject(title, ContentDetailDTO.class);
-            titleVO.setContent(titleContent.getTextContent());
-            columnDTO.setTitle(titleVO);
-            ContentVO abstractVO = new ContentVO();
-            String abstractStr = StringUtils.strip(JSON.toJSONString(esMess.getAbstractStr()), "[]");
-            ContentDetailDTO abstractContent = JSONObject.parseObject(abstractStr, ContentDetailDTO.class);
-            abstractVO.setContent(abstractContent.getTextContent());
-            columnDTO.setAbstractStr(abstractVO);
             list.add(columnDTO);
 
         }

+ 1 - 12
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -796,12 +796,7 @@ public class PatentStarApiService {
                 patentColumnDTO.setInventor(names);
             }
 
-            //装载标题
-            if(item.getName()!=null){
-                ContentVO contentVO =new ContentVO();
-                contentVO.setContent(item.getName());
-                patentColumnDTO.setTitle(contentVO);
-            }
+
 
             //装载权利人
             if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().trim().equals("")) {
@@ -809,12 +804,6 @@ public class PatentStarApiService {
                 patentColumnDTO.setRightHolder(names);
             }
 
-            //装载摘要
-            if (item.getAbstractStr() != null && !item.getAbstractStr().trim().equals("")) {
-                ContentVO contentVO =new ContentVO();
-                contentVO.setContent(item.getAbstractStr());
-                patentColumnDTO.setAbstractStr(contentVO);
-            }
 
             //装载代理人
             if (item.getAgentStr() != null && !item.getAgentStr().trim().equals("")) {

+ 381 - 19
src/main/java/cn/cslg/pas/service/common/PersonFieldService.java

@@ -1,14 +1,24 @@
 package cn.cslg.pas.service.common;
 
 
+import cn.cslg.pas.common.core.base.PatentDictionary;
 import cn.cslg.pas.common.core.base.RedisConf;
+import cn.cslg.pas.common.dto.QueryFieldsDTO;
+import cn.cslg.pas.common.dto.patentCount.AddPatentCountDTO;
+import cn.cslg.pas.common.dto.patentCount.GetAllPatentCountDTO;
+import cn.cslg.pas.common.dto.patentCount.GetTabelColumDTO;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
 import cn.cslg.pas.common.utils.*;
 import cn.cslg.pas.common.dto.AddSelfFieldDTO;
+import cn.cslg.pas.common.vo.QueryFiledVO;
+import cn.cslg.pas.common.vo.QueryFieldsVO;
 import cn.cslg.pas.common.vo.PersonSelfFieldVO;
+import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
+import cn.cslg.pas.common.vo.patentCount.GetAllPatentCountVO;
 import cn.cslg.pas.exception.UnLoginException;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.service.business.CommonService;
+import cn.cslg.pas.service.business.CustomFieldService;
 import cn.hutool.crypto.SecureUtil;
 import com.alibaba.fastjson.JSON;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +38,11 @@ public class PersonFieldService {
     @Autowired
     private LoginUtils loginUtils;
 
-    public List<PersonSelfFieldVO> getCustomField(String tableName) {
+    @Autowired
+    private CustomFieldService customFieldService;
+
+
+    public List<PersonSelfFieldVO> getCustomField(String tableName, Integer projectId) {
 
         //根据登录人id和type查询
         PersonnelVO personnelVO = new PersonnelVO();
@@ -38,13 +52,20 @@ public class PersonFieldService {
             throw new UnLoginException("未登录");
         }
         String userId = personnelVO.getId();
-        String key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
+        String key = "";
+
+        if (projectId == null) {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
+        } else {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
+        }
+
         String json = redisUtil.get(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
 
-//        //如果查到
-//        if (StringUtils.isNotEmpty(json)) {
-//            return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
-//        }
+        //如果查到
+        if (StringUtils.isNotEmpty(json)) {
+            return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
+        }
         String fieldJson = "";
         //如果没查询到,则获取所有栏位添加到redis里
         try {
@@ -60,18 +81,31 @@ public class PersonFieldService {
         if (fieldVOS == null || fieldVOS.size() == 0) {
             throw new XiaoShiException("表中无字段");
         }
-        fieldVOS.forEach(item->{item.setCreateType(1);});
+        fieldVOS.forEach(item -> {
+            item.setCreateType(1);
+        });
+
+        //当tableName是patent时
+        if (PatentDictionary.NAME.equals(tableName)) {
+            //获得所有自定义字段
+            List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
+            if (allCustomFieldVOS.size() != 0) {
+
+            }
+        }
         //装载顺序
         Integer order = 0;
         for (PersonSelfFieldVO item : fieldVOS) {
             item.setOrder(order);
-            if(item.getDefaultHidden()!=null&&item.getDefaultHidden().equals(true))
-            { item.setIfHidden(true);}
-            else{
-            item.setIfHidden(false);}
+            if (item.getDefaultHidden() != null && item.getDefaultHidden().equals(true)) {
+                item.setIfHidden(true);
+            } else {
+                item.setIfHidden(false);
+            }
             order++;
         }
 
+
         //保存到redis
         redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
 
@@ -92,14 +126,209 @@ public class PersonFieldService {
         List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
         fieldVOS = fieldVOS.stream().filter(item -> item.getIfShow().equals(true)).collect(Collectors.toList());
 
-        for(PersonSelfFieldVO item:fieldVOS){
-            PersonSelfFieldVO temVO=  addSelfFieldDTO.getValue().stream().filter(tem->tem.getValue().equals(item.getValue())).findFirst().orElse(null);
-         if(temVO==null){
-             item.setIfHidden(true);
-         }
-         else {
-             item.setIfHidden(temVO.getIfHidden());
-         }
+        for (PersonSelfFieldVO item : fieldVOS) {
+            PersonSelfFieldVO temVO = addSelfFieldDTO.getValue().stream().filter(tem -> tem.getValue().equals(item.getValue())).findFirst().orElse(null);
+            if (temVO == null) {
+                item.setIfHidden(true);
+            } else {
+                item.setIfHidden(temVO.getIfHidden());
+            }
+        }
+
+        Integer order = 0;
+
+        for (PersonSelfFieldVO item : fieldVOS) {
+            item.setOrder(order);
+            order++;
+        }
+        redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
+
+        return fieldVOS;
+    }
+
+    /**
+     * 获得查询的栏位
+     *
+     * @param queryFieldsDTOs
+     * @return
+     */
+    public List<QueryFieldsVO> getQueryFields(List<QueryFieldsDTO> queryFieldsDTOs) {
+        List<QueryFieldsVO> queryFieldsVOS = new ArrayList<>();
+        queryFieldsDTOs.forEach(item -> {
+            String json = null;
+            try {
+                json = CommonService.readJsonFile(item.getTableName() + ".json");
+
+            } catch (Exception e) {
+
+            }
+            Boolean flag = true;
+            if (json != null) {
+                QueryFieldsVO queryFieldsVO = new QueryFieldsVO();
+                queryFieldsVO.setTableName(item.getTableName());
+
+                List<QueryFiledVO> queryConditions = JSON.parseArray(json, QueryFiledVO.class);
+                //过滤出可查询的字段
+                List<QueryFiledVO> queryFiledVOList = queryConditions.stream().filter(i -> flag.equals(i.getIfSearch()) || flag.equals(i.getIfGroup())).collect(Collectors.toList());
+
+                //当是专利的配置时
+                if (item.getTableName().trim().equals(PatentDictionary.NAME)) {
+                    //根据专题库id 查询所有自定义字段
+                    List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(item.getProjectId());
+                    //遍历装载
+                    List<QueryFiledVO> queryFiledVOS = new ArrayList<>();
+                    allCustomFieldVOS.forEach(i -> {
+                        QueryFiledVO queryFieldsVO1 = new QueryFiledVO();
+                        //装载名称
+                        queryFieldsVO1.setName(i.getName());
+                        //装载组别
+                        queryFieldsVO1.setGroup("customField");
+                        //装载类型
+                        if (i.getType() <= 6) {
+                            queryFieldsVO1.setFiledKind(0);
+                        } else {
+                            queryFieldsVO1.setFiledKind(i.getType());
+                        }
+                        //装载id
+                        queryFieldsVO1.setField(i.getId().toString());
+                        queryFiledVOS.add(queryFieldsVO1);
+                    });
+                    queryFiledVOList.addAll(queryFiledVOS);
+                }
+                queryFieldsVO.setConditionDTOList(queryFiledVOList);
+                queryFieldsVOS.add(queryFieldsVO);
+            }
+        });
+        return queryFieldsVOS;
+    }
+
+
+    /**
+     * 查询表格显示栏位
+     * @param getTabelColumDTO
+     * @return
+     */
+    public List<PersonSelfFieldVO> getTableColumns(GetTabelColumDTO getTabelColumDTO) {
+        Integer projectId = getTabelColumDTO.getProjectId();
+        Integer taskId = getTabelColumDTO.getTaskId();
+        String tableName = getTabelColumDTO.getTableName();
+        //根据登录人id和type查询
+        PersonnelVO personnelVO = new PersonnelVO();
+        try {
+            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        } catch (Exception e) {
+            throw new UnLoginException("未登录");
+        }
+        String userId = personnelVO.getId();
+        String key = "";
+
+        if (projectId == null) {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
+        } else {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
+        }
+
+        String json = redisUtil.get(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
+
+        //如果查到
+        if (StringUtils.isNotEmpty(json)) {
+            return JsonUtils.jsonToList(json, PersonSelfFieldVO.class);
+        }
+        String fieldJson = "";
+        //如果没查询到,则获取所有栏位添加到redis里
+        try {
+            fieldJson = CommonService.readJsonFile(tableName + ".json");
+        } catch (Exception e) {
+            throw new XiaoShiException("不存在此表");
+        }
+        List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
+        if (fieldVOS == null) {
+            throw new XiaoShiException("不存在此表");
+        }
+        Boolean flag = true;
+        fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfShow())).collect(Collectors.toList());
+        if (fieldVOS == null || fieldVOS.size() == 0) {
+            throw new XiaoShiException("表中无字段");
+        }
+        fieldVOS.forEach(item -> {
+            item.setCreateType(1);
+        });
+
+        //当tableName是patent时
+        if (PatentDictionary.NAME.equals(tableName)) {
+            //获得所有自定义字段
+            List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
+            if (allCustomFieldVOS.size() != 0) {
+                for (AllCustomFieldVO item : allCustomFieldVOS) {
+                    PersonSelfFieldVO personSelfFieldVO = new PersonSelfFieldVO();
+                    personSelfFieldVO.setIfHidden(true);
+                    personSelfFieldVO.setName(item.getName());
+                    personSelfFieldVO.setType(item.getType().toString());
+                    personSelfFieldVO.setValue(item.getId().toString());
+                    personSelfFieldVO.setDefaultHidden(true);
+                    fieldVOS.add(personSelfFieldVO);
+                }
+            }
+        }
+        //装载顺序
+        Integer order = 0;
+        for (PersonSelfFieldVO item : fieldVOS) {
+            item.setOrder(order);
+            if (item.getDefaultHidden() != null && item.getDefaultHidden().equals(true)) {
+                item.setIfHidden(true);
+            } else {
+                item.setIfHidden(false);
+            }
+            order++;
+        }
+
+        //保存到redis
+        redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
+        return fieldVOS;
+    }
+
+    public List<PersonSelfFieldVO> setTableColumns(AddSelfFieldDTO addSelfFieldDTO) {
+        PersonnelVO personnelVO = new PersonnelVO();
+        try {
+            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        } catch (Exception e) {
+            throw new UnLoginException("未登录");
+        }
+        String userId = personnelVO.getId();
+        String tableName = addSelfFieldDTO.getTableName();
+        Integer projectId = addSelfFieldDTO.getProjectId();
+        String key = "";
+        if (projectId == null) {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId);
+        } else {
+            key = SecureUtil.md5(tableName + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
+        }
+        String fieldJson = CommonService.readJsonFile(addSelfFieldDTO.getTableName() + ".json");
+        List<PersonSelfFieldVO> fieldVOS = JSON.parseArray(fieldJson, PersonSelfFieldVO.class);
+        fieldVOS = fieldVOS.stream().filter(item -> item.getIfShow().equals(true)).collect(Collectors.toList());
+        //当tableName是patent时
+        if (PatentDictionary.NAME.equals(tableName)) {
+            //获得所有自定义字段
+            List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
+            if (allCustomFieldVOS.size() != 0) {
+                for (AllCustomFieldVO item : allCustomFieldVOS) {
+                    PersonSelfFieldVO personSelfFieldVO = new PersonSelfFieldVO();
+                    personSelfFieldVO.setIfHidden(true);
+                    personSelfFieldVO.setName(item.getName());
+                    personSelfFieldVO.setType(item.getType().toString());
+                    personSelfFieldVO.setValue(item.getId().toString());
+                    personSelfFieldVO.setDefaultHidden(true);
+                    fieldVOS.add(personSelfFieldVO);
+                }
+            }
+        }
+        for (PersonSelfFieldVO item : fieldVOS) {
+            PersonSelfFieldVO temVO = addSelfFieldDTO.getValue().stream().filter(tem -> tem.getValue().equals(item.getValue())).findFirst().orElse(null);
+            if (temVO == null) {
+                item.setIfHidden(true);
+            } else {
+                item.setIfHidden(temVO.getIfHidden());
+            }
         }
 
         Integer order = 0;
@@ -112,4 +341,137 @@ public class PersonFieldService {
 
         return fieldVOS;
     }
+
+    /**
+     * 查询所有的统计字段
+     *
+     * @param getAllPatentCountDTO
+     * @return
+     */
+    public List<GetAllPatentCountVO> getAllCountColumns(GetAllPatentCountDTO getAllPatentCountDTO) {
+        Integer taskId = getAllPatentCountDTO.getTaskId();
+        Integer projectId = getAllPatentCountDTO.getProjectId();
+
+        String fieldJson = "";
+        //如果没查询到,则获取所有栏位添加到redis里
+        try {
+            fieldJson = CommonService.readJsonFile(PatentDictionary.NAME + ".json");
+        } catch (Exception e) {
+            throw new XiaoShiException("不存在此表");
+        }
+        Boolean flag = true;
+        List<GetAllPatentCountVO> fieldVOS = JSON.parseArray(fieldJson, GetAllPatentCountVO.class);
+        fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats())).collect(Collectors.toList());
+        fieldVOS.forEach(item -> item.setFiledKind(-1));
+
+        //当专题库id或者报告id不为null时
+        if (taskId != null || projectId != null) {
+            List<AllCustomFieldVO> allCustomFieldVOS = new ArrayList<>();
+
+            if (taskId != null) {
+                allCustomFieldVOS = customFieldService.getAllTaskCustomField(taskId);
+            } else {
+                allCustomFieldVOS = customFieldService.getAllProjectCustomField(projectId);
+            }
+
+            if (allCustomFieldVOS != null && allCustomFieldVOS.size() != 0) {
+
+                //遍历查询出的自定义字段进行装载
+                for (AllCustomFieldVO allCustomFieldVO : allCustomFieldVOS) {
+                    GetAllPatentCountVO getAllPatentCountVO = new GetAllPatentCountVO();
+                    //装载自定义字段的栏位值
+                    getAllPatentCountVO.setValue(allCustomFieldVO.getId().toString());
+                    //装载自定义栏位名
+                    getAllPatentCountVO.setName(allCustomFieldVO.getName());
+                    //装载栏位类型
+                    if (allCustomFieldVO.getType() <= 6) {
+                        getAllPatentCountVO.setFiledKind(0);
+                    } else {
+                        getAllPatentCountVO.setFiledKind(allCustomFieldVO.getType());
+                    }
+                    fieldVOS.add(getAllPatentCountVO);
+                }
+            }
+        }
+        return fieldVOS;
+    }
+
+
+    /**
+     * 查询显示的统计栏位
+     *
+     * @param getAllPatentCountDTO
+     * @return
+     */
+    public List<GetAllPatentCountVO> getShowCountColumns(GetAllPatentCountDTO getAllPatentCountDTO) {
+        Integer taskId = getAllPatentCountDTO.getTaskId();
+        Integer projectId = getAllPatentCountDTO.getProjectId();
+        //根据登录人id和type查询
+        PersonnelVO personnelVO = new PersonnelVO();
+        try {
+            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        } catch (Exception e) {
+            throw new UnLoginException("未登录");
+        }
+        String userId = personnelVO.getId();
+        String key = "";
+
+        if (taskId != null) {
+            key = SecureUtil.md5(RedisConf.TASK_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + taskId);
+        } else {
+            key = SecureUtil.md5(RedisConf.PROJECT_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
+        }
+
+        String json = redisUtil.get(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key);
+        //如果查到
+        if (StringUtils.isNotEmpty(json)) {
+            return JsonUtils.jsonToList(json, GetAllPatentCountVO.class);
+        }
+        String fieldJson = "";
+        //如果没查询到,则获取所有栏位添加到redis里
+        try {
+            fieldJson = CommonService.readJsonFile(PatentDictionary.NAME + ".json");
+        } catch (Exception e) {
+            throw new XiaoShiException("不存在此表");
+        }
+        Boolean flag = true;
+        List<GetAllPatentCountVO> fieldVOS = JSON.parseArray(fieldJson, GetAllPatentCountVO.class);
+        fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats()) && flag.equals(item.getDefaultShowStats())).collect(Collectors.toList());
+        fieldVOS.forEach(item -> item.setFiledKind(-1));
+        redisUtil.set(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
+        return fieldVOS;
+    }
+
+
+    /**
+     * 查询显示的统计栏位
+     *
+     * @param addPatentCountDTO
+     * @return
+     */
+    public List<GetAllPatentCountVO> setShowCountColumns(AddPatentCountDTO addPatentCountDTO) {
+        Integer taskId = addPatentCountDTO.getTaskId();
+        Integer projectId = addPatentCountDTO.getProjectId();
+        //根据登录人id和type查询
+        PersonnelVO personnelVO = new PersonnelVO();
+        try {
+            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        } catch (Exception e) {
+            throw new UnLoginException("未登录");
+        }
+        String userId = personnelVO.getId();
+        String key = "";
+
+        if (taskId != null) {
+            key = SecureUtil.md5(RedisConf.TASK_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + taskId);
+        } else {
+            key = SecureUtil.md5(RedisConf.PROJECT_FIELD_COUNT + RedisConf.SYMBOL_COLON + userId + RedisConf.SYMBOL_COLON + projectId);
+        }
+
+        Boolean flag = true;
+        List<GetAllPatentCountVO> fieldVOS = addPatentCountDTO.getValue();
+        redisUtil.set(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
+        return fieldVOS;
+    }
+
 }

+ 51 - 6
src/main/java/cn/cslg/pas/service/importPatent/GetPatentFromExcelThread.java

@@ -1,6 +1,8 @@
 package cn.cslg.pas.service.importPatent;
 
+import cn.cslg.pas.common.core.base.FamilyType;
 import cn.cslg.pas.common.dto.UploadPatentWebDTO;
+import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
 import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.utils.ReadExcelUtils;
 import cn.cslg.pas.common.vo.ImportTaskAMVO;
@@ -9,6 +11,7 @@ import cn.cslg.pas.common.vo.UploadParamsVO;
 import cn.cslg.pas.common.vo.UploadSettingVO;
 import cn.cslg.pas.domain.es.Patent;
 import cn.cslg.pas.domain.es.Text;
+import cn.cslg.pas.service.business.es.EsService;
 import cn.cslg.pas.service.common.ExcuteDataToVOService;
 import cn.cslg.pas.service.common.ExcuteUploadSettingService;
 import cn.cslg.pas.service.common.FileManagerService;
@@ -29,7 +32,8 @@ public class GetPatentFromExcelThread extends Thread {
     private ImportTaskAMVO importTaskAMVO;
     private ApplicationContext applicationContext;
     private SavePatentToEsThread savePatentToEsThread;
-     private  GetPatentPictureFromExcelThread getPatentPictureFromExcelThread;
+    private GetPatentPictureFromExcelThread getPatentPictureFromExcelThread;
+
     @Override
     public void run() {
         try {
@@ -59,7 +63,7 @@ public class GetPatentFromExcelThread extends Thread {
             Sheet sheet = ReadExcelUtils.readExcel(tempFile);
             //遍历专利总数量,在循环中将专利一个一个存入消费者专利队列
             for (int i = lastIndex; i < total; i++) {
-                if(!importTaskAMVO.getState().equals(1)){
+                if (!importTaskAMVO.getState().equals(1)) {
                     System.out.println(importTaskAMVO.getId());
                     break;
                 }
@@ -69,7 +73,7 @@ public class GetPatentFromExcelThread extends Thread {
                 UploadParamsVO uploadParamsVO = excuteDataToVOService.fileToPatentVO(patentData, jsonData);
                 this.loadPatent(uploadParamsVO);
 
-                UploadPatentWebDTO uploadPatentWebDTO =new UploadPatentWebDTO();
+                UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                 uploadPatentWebDTO.setHaveSaveCounter(0);
                 uploadPatentWebDTO.setTotalCounter(importTaskAMVO.getShouldSaveCounter());
                 uploadPatentWebDTO.setPictureData(uploadParamsVO.getPictureData());
@@ -93,15 +97,15 @@ public class GetPatentFromExcelThread extends Thread {
         this.importTaskAMVO = taskThread.getImportTaskAMVO();
         this.savePatentToEsThread = savePatentToEsThread;
         this.applicationContext = taskThread.getApplicationContext();
-        this.getPatentPictureFromExcelThread=getPatentPictureFromExcelThread;
+        this.getPatentPictureFromExcelThread = getPatentPictureFromExcelThread;
 
     }
 
 
     public void loadPatent(UploadParamsVO uploadParamsVO) {
         Patent patent = uploadParamsVO.getPatent();
-        String patentNo =patent.getPatentNo();
-        String contry =patentNo.substring(0,2);
+        String patentNo = patent.getPatentNo();
+        String contry = patentNo.substring(0, 2);
         //装载标题
         if (uploadParamsVO.getTitle() != null) {
             List<Text> texts = new ArrayList<>();
@@ -168,7 +172,48 @@ public class GetPatentFromExcelThread extends Thread {
                 patent.setClaim(texts);
             }
         }
+
+        //简单同族
+        if (uploadParamsVO.getSimpleFamily() != null) {
+            EsService esService = applicationContext.getBean(EsService.class);
+            try {
+                EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(uploadParamsVO.getSimpleFamily(), FamilyType.SIMPLE);
+                if (esPatentFamilyDTO != null) {
+                    patent.setSimpleFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                    patent.setSimpleFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                }
+            } catch (Exception e) {
+            }
+        }
+
+        //inpadapc同族
+        if (uploadParamsVO.getInpadocFamily() != null) {
+            EsService esService = applicationContext.getBean(EsService.class);
+            try {
+                EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(uploadParamsVO.getSimpleFamily(), FamilyType.INPADOC);
+                if (esPatentFamilyDTO != null) {
+                    patent.setInpadocFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                    patent.setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                }
+            } catch (Exception e) {
+            }
         }
 
+        //patsnap同族
+        if (uploadParamsVO.getPatSnapFamily() != null) {
+            EsService esService = applicationContext.getBean(EsService.class);
+            try {
+                EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(uploadParamsVO.getSimpleFamily(), FamilyType.PATSNAP);
+                if (esPatentFamilyDTO != null) {
+                    patent.setPatsnapFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                    patent.setPatsnapFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                }
+            } catch (Exception e) {
+            }
+        }
+
+
+    }
+
 
 }

+ 30 - 16
src/main/resources/jsons/patent.json

@@ -6,10 +6,11 @@
     "field": "patentNo",
     "esField": "patent_no.keyword",
     "esClass": "wildcardQueryBuilder",
-    "ifSearch": "false",
+    "ifSearch": "true",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "申请号",
@@ -18,10 +19,11 @@
     "field": "AN",
     "esField": "app_no.keyword",
     "esClass": "wildcardQueryBuilder",
-    "ifSearch": "false",
+    "ifSearch": "true",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "公开号",
@@ -30,10 +32,11 @@
     "field": "PN",
     "esField": "public_no.keyword",
     "esClass": "wildcardQueryBuilder",
-    "ifSearch": "false",
+    "ifSearch": "true",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "授权号",
@@ -45,7 +48,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "公开日",
@@ -57,7 +61,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "申请日",
@@ -69,7 +74,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "授权日",
@@ -81,7 +87,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "家族数量",
@@ -93,7 +100,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "项目id",
@@ -105,7 +113,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "false",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "false"
   },
   {
     "name": "摘要",
@@ -118,7 +127,8 @@
     "ifGroup": "false",
     "ifShow": "true",
     "ifAsCondition": "true",
-    "defaultHidden": "true"
+    "defaultHidden": "true",
+    "ifStats": "false"
   },
   {
     "name": "标题",
@@ -154,7 +164,9 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "ifStats": "true",
+    "defaultShowStats": "true"
   },
   {
     "name": "发明人",
@@ -478,7 +490,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "fieldOptionQueryParam": "PATENT_SIMPLE_STATUS"
   },
   {
     "name": "专利类型",
@@ -490,7 +503,8 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "true",
+    "fieldOptionQueryParam": "PATENT_TYPE"
   },
   {
     "name": "法律状态",

+ 27 - 13
src/main/resources/jsons/product.json

@@ -9,7 +9,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"产品名称",
     "type":"String",
@@ -21,7 +22,9 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
+
   },
   {"name":"公司名称",
     "type":"String",
@@ -33,7 +36,8 @@
     "groupClass":"",
     "ifSearch":"false",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"产品参考许可费率",
     "type":"Double",
@@ -45,7 +49,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"上市时间",
     "type":"DateTime",
@@ -56,7 +61,8 @@
     "orderClass": "getComOrder",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"所属产品类别",
     "type":"Integer",
@@ -68,7 +74,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {"name":"可见类型",
     "type":"Integer",
@@ -102,7 +109,8 @@
     "orderClass": "getCreateNameOrder",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {
     "name":"产品创建时间",
@@ -114,7 +122,8 @@
     "orderClass": "getComOrder",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {"name":"产品类别Id",
     "type":"Integer",
@@ -126,7 +135,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {"name":"产品类别名称",
     "type":"String",
@@ -138,7 +148,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {"name":"产品类别创建人",
     "type":"String",
@@ -149,7 +160,8 @@
     "orderClass": "",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {
     "name":"产品类别创建时间",
@@ -161,7 +173,8 @@
     "sqlClass": "getDateTimeSql",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   },
   {
     "name":"年",
@@ -174,6 +187,7 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"false"
+    "ifShow":"false",
+    "ifAsCondition": "true"
   }
 ]

+ 16 - 8
src/main/resources/jsons/treeNode.json

@@ -9,7 +9,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"父Id",
     "type":"Integer",
@@ -21,7 +22,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
 
   {"name":"类型",
@@ -34,7 +36,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"类型Id",
     "type":"Integer",
@@ -46,7 +49,8 @@
     "groupClass":"",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"创建人",
     "type":"String",
@@ -58,7 +62,8 @@
     "groupClass":"getComGroup",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
 
   },
   {"name":"创建时间",
@@ -71,7 +76,8 @@
     "groupClass":"getTimeGroup",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   },
   {"name":"描述",
     "type":"String",
@@ -82,7 +88,8 @@
     "orderClass": "getComOrder",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
 
   },
   {"name":"名称",
@@ -95,6 +102,7 @@
     "groupClass":"getComGroup",
     "ifSearch":"true",
     "ifGroup": "false",
-    "ifShow":"true"
+    "ifShow":"true",
+    "ifAsCondition": "true"
   }
 ]

+ 7 - 0
src/main/resources/mapper/FTOCompareRecordMapper.xml

@@ -11,4 +11,11 @@
     </select>
 
 
+    <select id="getSynergyTaskId" resultType="java.lang.String">
+        select distinct project_task_id
+        from fto_compare_record
+        where asso_task_id = ${taskId}
+       and
+    </select>
+
 </mapper>