Parcourir la source

Merge remote-tracking branch 'origin/master'

lwhhszx il y a 1 an
Parent
commit
5ab4bf2ba3

+ 3 - 0
src/main/java/cn/cslg/pas/common/dto/business/EsCountDTO.java

@@ -3,6 +3,7 @@ package cn.cslg.pas.common.dto.business;
 import lombok.Data;
 
 import java.util.List;
+import java.util.Map;
 
 @Data
 public class EsCountDTO {
@@ -10,4 +11,6 @@ public class EsCountDTO {
     private Long allNumber;
     private String condition;
     private List<EsCountDetailDTO> detailDTOS;
+    //多维分析返回数据
+    private Map<String, List<EsCountDetailDTO>> analyseMap;
 }

+ 2 - 1
src/main/java/cn/cslg/pas/common/dto/business/EsCountDetailDTO.java

@@ -18,5 +18,6 @@ public class EsCountDetailDTO {
     private Long number;
     //限制数量
     private Integer topN;
-
+    //在一维数据下显示的名称
+    private String firstName;
 }

+ 11 - 0
src/main/java/cn/cslg/pas/common/dto/es/EsDateRangeDTO.java

@@ -0,0 +1,11 @@
+package cn.cslg.pas.common.dto.es;
+
+import lombok.Data;
+
+@Data
+public class EsDateRangeDTO {
+
+    private String minDate;
+
+    private String maxDate;
+}

+ 16 - 0
src/main/java/cn/cslg/pas/common/vo/es/EsDateRangeVO.java

@@ -0,0 +1,16 @@
+package cn.cslg.pas.common.vo.es;
+
+import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class EsDateRangeVO {
+
+    private String condition;
+    private Integer projectId;
+    private List<EsCustomFieldValueDTO> customFields;
+    private Integer taskId;
+    private String field;
+}

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

@@ -24,9 +24,11 @@ public class GetAllPatentCountVO {
      * 是否统计
      */
     private Boolean ifStats;
+    private Boolean ifGroup;
 
     //-1专利著录 0自定义字段 7产品 8产品类别 9技术分类
     private Integer filedKind;
     private Boolean defaultShowStats;
     private String field;
+    private String groupBy;
 }

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

@@ -48,14 +48,14 @@ public class CustomAnalyseController {
 
     @Operation(summary = "添加组别/分析项")
     @PostMapping("/addAnalyseGroup")
-    public Response addAnalyseGroup(@RequestBody CustomAnalyseDTO vo) {
+    public Response addAnalyseGroup(@RequestBody CustomAnalyseDTO vo) throws Exception {
         Integer groupId = customAnalyseService.addAnalyseGroup(vo);
         return Response.success(groupId);
     }
 
     @Operation(summary = "编辑组别")
     @PostMapping("/editAnalyseGroup")
-    public Response editAnalyseGroup(@RequestBody CustomAnalyseDTO vo) {
+    public Response editAnalyseGroup(@RequestBody CustomAnalyseDTO vo) throws Exception {
         Integer groupId = customAnalyseService.editAnalyseGroup(vo);
         return Response.success(groupId);
     }

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

@@ -6,6 +6,7 @@ import cn.cslg.pas.common.dto.PatentExport.PatentExportParams;
 import cn.cslg.pas.common.dto.PatentExport.TaskParams;
 import cn.cslg.pas.common.dto.business.EsCountDTO;
 import cn.cslg.pas.common.dto.business.SelectClaimDTO;
+import cn.cslg.pas.common.dto.es.EsDateRangeDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.*;
@@ -17,6 +18,7 @@ import cn.cslg.pas.common.vo.business.EsAllCountVO;
 import cn.cslg.pas.common.vo.business.PatentKinVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.common.vo.es.EsCustomFieldBatchVO;
+import cn.cslg.pas.common.vo.es.EsDateRangeVO;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
 import cn.cslg.pas.service.business.CustomAnalyseService;
@@ -116,13 +118,6 @@ public class PatentController {
         return Response.success(records);
     }
 
-    @Operation(summary = "专利的聚合统计")
-    @PostMapping("/esCountAnalysis")
-    public Response esCountAnalysis(@RequestBody EsAllCountVO countVO) throws Exception {
-        EsCountDTO dto = esCountService.esCountAnalysis(countVO);
-        return Response.success(dto);
-    }
-
     @Operation(summary = "根据专利号查询内部专利")
     @GetMapping("/queryPatentByNo")
     public Response queryPatentByNo(String patentNo) throws Exception {
@@ -152,6 +147,21 @@ public class PatentController {
         return Response.success(dto);
     }
 
+    //----------------------------统计分析-------------------------
+    @Operation(summary = "专利的聚合统计")
+    @PostMapping("/esCountAnalysis")
+    public Response esCountAnalysis(@RequestBody EsAllCountVO countVO) throws Exception {
+        EsCountDTO dto = esCountService.esCountAnalysis(countVO);
+        return Response.success(dto);
+    }
+
+    @Operation(summary = "分析统计的栏位日期最大/最小值")
+    @PostMapping("/getFieldRange")
+    public Response getFieldRange(@RequestBody EsDateRangeVO rangeVO) throws Exception {
+        EsDateRangeDTO dto = esCountService.getFieldRange(rangeVO);
+        return Response.success(dto);
+    }
+
     //------------------------合并-----------------------------
     @Operation(summary = "专利列表上新增发明人/权利人/申请人合并")
     @PostMapping("/mergePerson")

+ 24 - 5
src/main/java/cn/cslg/pas/service/business/CustomAnalyseService.java

@@ -17,6 +17,7 @@ import cn.cslg.pas.mapper.CustomAnalysisItemMapper;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.BeanUtils;
@@ -103,7 +104,15 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
     }
 
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
-    public Integer addAnalyseGroup(CustomAnalyseDTO vo) {
+    public Integer addAnalyseGroup(CustomAnalyseDTO vo) throws Exception {
+        List<CustomAnalysisItem> items = customAnalysisItemMapper.selectList(new QueryWrapper<CustomAnalysisItem>()
+                .lambda()
+                .eq(CustomAnalysisItem::getName, vo.getName())
+                .eq(CustomAnalysisItem::getType, vo.getType()));
+        if (items.size() > 1) {
+            throw new Exception("名称不可重复");
+        }
+
         String uid = IdUtil.simpleUUID();
         //获取登陆人信息 用于设置创建人
         PersonnelVO personnelVO = new PersonnelVO();
@@ -112,10 +121,14 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
         } catch (Exception e) {
             throw new UnLoginException("未登录");
         }
-
         CustomAnalysisItem item = new CustomAnalysisItem();
         item.setUid(uid);
         BeanUtils.copyProperties(vo, item);
+        if (vo.getType() == 1) {
+            item.setParentId(0);
+        } else {
+            item.setParentId(vo.getParentId());
+        }
         item.setTenantId(personnelVO.getTenantId());
         item.setCreateId(personnelVO.getId());
         item.setCreateName(personnelVO.getName());
@@ -126,8 +139,14 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
     }
 
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
-    public Integer editAnalyseGroup(CustomAnalyseDTO vo) {
-
+    public Integer editAnalyseGroup(CustomAnalyseDTO vo) throws Exception {
+        List<CustomAnalysisItem> items = customAnalysisItemMapper.selectList(new QueryWrapper<CustomAnalysisItem>()
+                .lambda()
+                .eq(CustomAnalysisItem::getName, vo.getName())
+                .eq(CustomAnalysisItem::getType, vo.getType()));
+        if (items.size() > 1) {
+            throw new Exception("名称不可重复");
+        }
         //获取登陆人信息 用于设置创建人
         PersonnelVO personnelVO = new PersonnelVO();
         try {
@@ -142,7 +161,7 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
         item.setCreateId(personnelVO.getId());
         item.setCreateName(personnelVO.getName());
         item.setUpdateTime(new Date());
-        item.insert();
+        item.updateById();
         return item.getId();
     }
 

+ 428 - 75
src/main/java/cn/cslg/pas/service/business/es/EsCountService.java

@@ -3,12 +3,14 @@ package cn.cslg.pas.service.business.es;
 import cn.cslg.pas.common.dto.business.EsCountDTO;
 import cn.cslg.pas.common.dto.business.EsCountDetailDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
+import cn.cslg.pas.common.dto.es.EsDateRangeDTO;
 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.EsConfigVO;
 import cn.cslg.pas.common.vo.business.EsAllCountVO;
 import cn.cslg.pas.common.vo.business.EsCountVO;
+import cn.cslg.pas.common.vo.es.EsDateRangeVO;
 import cn.cslg.pas.domain.es.Patent;
 import cn.cslg.pas.factorys.EsCountAnalyseBuilderFactory.EsCountAnalysisBuilderFactory;
 import cn.cslg.pas.factorys.EsCountAnalyseBuilderFactory.IEsCountAnalysisBuilder;
@@ -36,7 +38,7 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class EsCountService {
     private final List<String> childList = Arrays.asList("field");
-    private final List<String> nestedList = Arrays.asList("PA", "IN", "PE", "SAT", "MAT", "SRH", "MRH","MIN");
+    private final List<String> nestedList = Arrays.asList("PA", "IN", "PE", "SAT", "MAT", "SRH", "MRH", "MIN");
     private final List<String> dateList = Arrays.asList("PD", "AD", "GD");
     private final List<String> numberList = Arrays.asList("QPN", "QDPN", "SFN", "IFN", "PFN");
 
@@ -51,18 +53,60 @@ public class EsCountService {
 
     /**
      * 聚合统计
+     *
      * @param vo
      * @return
      * @throws Exception
      */
     public EsCountDTO esCountAnalysis(EsAllCountVO vo) throws Exception {
+        List<EsCountVO> countVOS = vo.getCountVOS();
         String searchCondition = vo.getCondition();
         List<EsCustomFieldValueDTO> customFields = vo.getCustomFields();
+        Integer taskId = vo.getTaskId();
+        Integer projectId = vo.getProjectId();
+        EsCountDTO esCountDTO = new EsCountDTO();
+        HashMap<String, List<EsCountDetailDTO>> map = new HashMap<>();
+        List<EsCountDetailDTO> detailDTOS = new ArrayList<>();
+        if (countVOS.size() > 1) {
+            EsCountVO countVO = countVOS.get(0);
+            List<String> values = countVO.getValues();
+            List<EsCountVO> esCountVOS = new ArrayList<>();
+            esCountVOS.add(countVOS.get(1));
+            if (StringUtils.isNotEmpty(countVO.getFieldId())) {
+                if (!CollectionUtils.isEmpty(values)) {
+                    for (String value : values) {
+                        EsCustomFieldValueDTO valueDTO = new EsCustomFieldValueDTO();
+                        valueDTO.setFieldId(countVO.getFieldId());
+                        valueDTO.setFieldValue(Arrays.asList(value));
+                        customFields.add(valueDTO);
+                        this.getReturnData(searchCondition, customFields, taskId, projectId, esCountVOS, detailDTOS, esCountDTO, value, map);
+                    }
+                }
+            } else {
+                for (String value : values) {
+                    String condition = countVO.getField() + " = " + value;
+                    if (searchCondition != null && !"".equals(searchCondition.trim())) {
+                        searchCondition = condition + " AND " + searchCondition;
+                    } else {
+                        searchCondition = condition;
+                    }
+                    this.getReturnData(searchCondition, customFields, taskId, projectId, esCountVOS, detailDTOS, esCountDTO, value, map);
+                }
+            }
+        } else {
+            this.getReturnData(searchCondition, customFields, taskId, projectId, countVOS, detailDTOS, esCountDTO, "", map);
+        }
+        esCountDTO.setDetailDTOS(detailDTOS);
+        return esCountDTO;
+    }
+
+    public void getReturnData(String searchCondition, List<EsCustomFieldValueDTO> customFields, Integer taskId,
+                              Integer projectId, List<EsCountVO> countVOS, List<EsCountDetailDTO> detailDTOS,
+                              EsCountDTO esCountDTO, String firstName, Map<String, List<EsCountDetailDTO>> map) throws Exception {
         if (!CollectionUtils.isEmpty(customFields)) {
             searchCondition = esService.parseCustomField(customFields);
         }
-        Integer taskId = vo.getTaskId();
-        Integer projectId = vo.getProjectId();
+
         searchCondition = this.getCondition(searchCondition, taskId, projectId);
 
         SearchRequest.Builder builder = new SearchRequest.Builder();
@@ -78,9 +122,6 @@ public class EsCountService {
             query = formatQueryService.EsQueryToQuery((operateNode) tree, "patent");
         }
 
-        EsCountDTO esCountDTO = new EsCountDTO();
-        List<EsCountDetailDTO> detailDTOS = new ArrayList<>();
-        List<EsCountVO> countVOS = vo.getCountVOS();
         for (EsCountVO countVO : countVOS) {
             String field = countVO.getField();
             Integer topN = countVO.getTopN();
@@ -113,7 +154,6 @@ public class EsCountService {
                     if (dateList.contains(field)) {
                         if (CollectionUtils.isEmpty(values)) {
                             filtersBuckets.forEach(filtersBucket -> {
-//                                this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                                 Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
                                 try {
                                     this.getDateCountDTOS(filtersAgg, field, topN, format, detailDTOS, esCountDTO);
@@ -123,16 +163,14 @@ public class EsCountService {
                             });
                         } else {
                             filtersBuckets.forEach(filtersBucket -> {
-//                                this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                                 Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                                this.getDateAnalysisDTOS(filtersAgg, field, topN, detailDTOS,esCountDTO);
+                                this.getDateAnalysisDTOS(filtersAgg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                             });
                         }
                     } else if (nestedList.contains(field)) {
                         filtersBuckets.forEach(filtersBucket -> {
-//                            this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                             Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                            this.getNestedCountDTOS(filtersAgg, field,topN, detailDTOS);
+                            this.getNestedCountDTOS(filtersAgg, field, topN, detailDTOS, esCountDTO, firstName, map, values);
                             if (!CollectionUtils.isEmpty(values)) {
                                 esCountDTO.setAllNumber(filtersAgg.nested().docCount());
                             }
@@ -141,16 +179,15 @@ public class EsCountService {
                         if (CollectionUtils.isEmpty(values)) {
                             Integer finalFieldType = fieldType;
                             filtersBuckets.forEach(filtersBucket -> {
-//                                this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                                 Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                                this.getChildCountDTOS(filtersAgg, field, finalFieldType, topN,detailDTOS,esCountDTO);
+                                this.getChildCountDTOS(filtersAgg, field, finalFieldType, topN, detailDTOS, esCountDTO);
                             });
                         } else {
                             Integer finalFieldType1 = fieldType;
                             filtersBuckets.forEach(filtersBucket -> {
-//                                this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                                 Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                                this.getChildAnalysisDTOS(filtersAgg, field, finalFieldType1, topN,detailDTOS, esCountDTO);
+                                this.getChildAnalysisDTOS(filtersAgg, field, finalFieldType1, topN,
+                                        detailDTOS, esCountDTO, firstName, map,values);
                             });
                         }
                     } else if (numberList.contains(field)) {
@@ -158,16 +195,14 @@ public class EsCountService {
 
                         } else {
                             filtersBuckets.forEach(filtersBucket -> {
-//                                this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                                 Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                                this.getNumberAnalysisDTOS(filtersAgg, field,topN, detailDTOS);
+                                this.getNumberAnalysisDTOS(filtersAgg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                             });
                         }
                     } else {
                         filtersBuckets.forEach(filtersBucket -> {
-//                            this.getFiltersCountDTO(filtersBucket, finalSearchCondition, detailDTOS);
                             Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
-                            this.getTermCountDTOS(filtersAgg, field, topN,detailDTOS);
+                            this.getTermCountDTOS(filtersAgg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                         });
                     }
                 } else {
@@ -176,35 +211,118 @@ public class EsCountService {
             } else {
                 if (dateList.contains(field)) {
                     if (CollectionUtils.isEmpty(values)) {
-                        this.getDateCountDTOS(agg, field, topN,format, detailDTOS,esCountDTO);
+                        this.getDateCountDTOS(agg, field, topN, format, detailDTOS, esCountDTO);
                     } else {
-                        this.getDateAnalysisDTOS(agg, field, topN, detailDTOS,esCountDTO);
+                        this.getDateAnalysisDTOS(agg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                     }
                 } else if (nestedList.contains(field)) {
-                    this.getNestedCountDTOS(agg, field,topN, detailDTOS);
+                    this.getNestedCountDTOS(agg, field, topN, detailDTOS, esCountDTO, firstName, map, values);
                     if (!CollectionUtils.isEmpty(values)) {
                         esCountDTO.setAllNumber(agg.nested().docCount());
                     }
                 } else if (childList.contains(field)) {
                     if (CollectionUtils.isEmpty(values)) {
-                        this.getChildCountDTOS(agg, field, fieldType,topN, detailDTOS, esCountDTO);
+                        this.getChildCountDTOS(agg, field, fieldType, topN, detailDTOS, esCountDTO);
                     } else {
-                        this.getChildAnalysisDTOS(agg, field, fieldType,topN, detailDTOS, esCountDTO);
+                        this.getChildAnalysisDTOS(agg, field, fieldType, topN,
+                                detailDTOS, esCountDTO, firstName, map,values);
                     }
                 } else if (numberList.contains(field)) {
-                    this.getNumberAnalysisDTOS(agg, field,topN, detailDTOS);
+                    this.getNumberAnalysisDTOS(agg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                 } else {
-                    this.getTermCountDTOS(agg, field,topN, detailDTOS);
+                    this.getTermCountDTOS(agg, field, topN, detailDTOS, esCountDTO, firstName, map,values);
                 }
             }
+            esCountDTO.setCondition(searchCondition);
+            esCountDTO.setAnalyseMap(map);
         }
-        esCountDTO.setDetailDTOS(detailDTOS);
-        esCountDTO.setCondition(searchCondition);
-        return esCountDTO;
+    }
+
+    public EsDateRangeDTO getFieldRange(EsDateRangeVO rangeVO) throws Exception {
+        String searchCondition = rangeVO.getCondition();
+        String field = rangeVO.getField();
+        List<EsCustomFieldValueDTO> customFields = rangeVO.getCustomFields();
+        if (!CollectionUtils.isEmpty(customFields)) {
+            searchCondition = esService.parseCustomField(customFields);
+        }
+        Integer taskId = rangeVO.getTaskId();
+        Integer projectId = rangeVO.getProjectId();
+        searchCondition = this.getCondition(searchCondition, taskId, projectId);
+
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index("patent");
+        //设置查询索引
+        Query query = null;
+        if (StringUtils.isNotEmpty(searchCondition)) {
+            //1. 解析检索条件
+            treeNode tree = expressManager.getInstance().Parse(searchCondition, false);
+            //格式化检索式
+            //3. 从es中检索数据
+            query = formatQueryService.EsQueryToQuery((operateNode) tree, "patent");
+        }
+        String esField = "";
+        if (StringUtils.isNotEmpty(field)) {
+            switch (field) {
+                case "AD":
+                    esField = "app_date";
+                    break;
+                case "PD":
+                    esField = "public_date";
+                    break;
+                case "GD":
+                    esField = "grant_date";
+                    break;
+            }
+        }
+        EsDateRangeDTO rangeDTO = new EsDateRangeDTO();
+        if (StringUtils.isNotEmpty(esField)) {
+            String finalEsField = esField;
+            Query finalQuery = query;
+            Aggregation min = AggregationBuilders.min(i -> i.field(finalEsField).format("yyyy"));
+            Aggregation filtersAgg = new Aggregation.Builder().filters(new FiltersAggregation.Builder()
+                    .filters(i -> i.array(Arrays.asList(finalQuery))).build())
+                    .aggregations(new HashMap() {{
+                        put("filters_agg", min);
+                    }}).build();
+
+            Aggregation max = AggregationBuilders.max(i -> i.field(finalEsField).format("yyyy"));
+            Aggregation maxFilters = new Aggregation.Builder().filters(new FiltersAggregation.Builder()
+                    .filters(i -> i.array(Arrays.asList(finalQuery))).build())
+                    .aggregations(new HashMap() {{
+                        put("max_agg", max);
+                    }}).build();
+
+
+            builder.aggregations("minAgg", filtersAgg);
+            builder.aggregations("maxAgg", maxFilters);
+            SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
+            Aggregate minAgg = response.aggregations().get("minAgg");
+            if (minAgg != null) {
+                List<FiltersBucket> list = minAgg.filters().buckets().array();
+                for (FiltersBucket bucket : list) {
+                    Aggregate aggregate = bucket.aggregations().get("filters_agg");
+                    String minValue = aggregate.min().valueAsString();
+                    rangeDTO.setMinDate(minValue);
+                }
+            }
+
+            Aggregate maxAgg = response.aggregations().get("maxAgg");
+            if (maxAgg != null) {
+                List<FiltersBucket> list = maxAgg.filters().buckets().array();
+                for (FiltersBucket bucket : list) {
+                    Aggregate aggregate = bucket.aggregations().get("max_agg");
+                    String maxValue = aggregate.max().valueAsString();
+                    rangeDTO.setMaxDate(maxValue);
+                }
+            }
+        }
+        return rangeDTO;
     }
 
     /**
      * 查询共用Aggregation
+     *
      * @param countVO
      * @return
      * @throws Exception
@@ -302,7 +420,10 @@ public class EsCountService {
      * @param field
      * @param detailDTOS
      */
-    public void getTermCountDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS) {
+    public void getTermCountDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS,
+                                 EsCountDTO esCountDTO, String firstName,
+                                 Map<String, List<EsCountDetailDTO>> map,List<String> values) {
+        List<EsCountDetailDTO> countDetailDTOS = new ArrayList<>();
         EsCountDetailDTO countDTO = new EsCountDetailDTO();
         countDTO.setField(field);
         countDTO.setName("其他");
@@ -317,13 +438,49 @@ public class EsCountService {
             dto.setName(bucket.key().stringValue());
             dto.setNumber(bucket.docCount());
             dto.setTopN(topN);
+            dto.setFirstName(firstName);
             if (aggregate != null) {
                 dto.setNumber(aggregate.filter().docCount());
             }
             if (dto.getNumber() > 0) {
-                detailDTOS.add(dto);
+                countDetailDTOS.add(dto);
             }
         });
+
+        List<String> strs = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(values)) {
+            strs.addAll(values);
+        }
+        if (StringUtils.isNotEmpty(firstName)) {
+            countDetailDTOS.removeIf(dto -> dto.getName().equals("其他"));
+            if (countDetailDTOS.size() != values.size()) {
+                for (EsCountDetailDTO detailDTO : countDetailDTOS) {
+                    strs.removeIf(i -> i.equals(detailDTO.getName()));
+                }
+                for (String value : strs) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            } else if (countDetailDTOS.isEmpty()) {
+                for (String value : values) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            }
+            map.put(firstName, countDetailDTOS);
+        } else {
+            detailDTOS.addAll(countDetailDTOS);
+        }
     }
 
     /**
@@ -333,7 +490,7 @@ public class EsCountService {
      * @param field
      * @param detailDTOS
      */
-    public void getChildCountDTOS(Aggregate agg, String field,Integer fieldType, Integer topN,
+    public void getChildCountDTOS(Aggregate agg, String field, Integer fieldType, Integer topN,
                                   List<EsCountDetailDTO> detailDTOS, EsCountDTO esCountDTO) {
         esCountDTO.setAllNumber(agg.children().docCount());
         Aggregate childAgg = agg.children().aggregations().get("childAgg");
@@ -377,8 +534,10 @@ public class EsCountService {
      * @param field
      * @param detailDTOS
      */
-    public void getChildAnalysisDTOS(Aggregate agg, String field,Integer fieldType,Integer topN,
-                                     List<EsCountDetailDTO> detailDTOS, EsCountDTO esCountDTO) {
+    public void getChildAnalysisDTOS(Aggregate agg, String field, Integer fieldType, Integer topN,
+                                     List<EsCountDetailDTO> detailDTOS, EsCountDTO esCountDTO,
+                                     String firstName, Map<String, List<EsCountDetailDTO>> map,List<String> values) {
+        List<EsCountDetailDTO> countDetailDTOS = new ArrayList<>();
         Aggregate childAgg = agg.children().aggregations().get("childAgg");
         List<StringTermsBucket> list = childAgg.sterms().buckets().array();
         list.forEach(bucket -> {
@@ -390,23 +549,72 @@ public class EsCountService {
                 dto.setField(field);
                 dto.setName(termsBucket.key().stringValue());
                 dto.setNumber(termsBucket.docCount());
+                dto.setFirstName(firstName);
                 dto.setTopN(topN);
-                if (dto.getNumber() > 0) {
-                    detailDTOS.add(dto);
-                    if (fieldType == null || fieldType != 6) {
-                        Long docCount = aggregate.sterms().sumOtherDocCount();
-                        EsCountDetailDTO detail = new EsCountDetailDTO();
-                        detail.setField(field);
-                        detail.setName("未选择");
-                        detail.setNumber(docCount);
-                        detail.setTopN(topN);
-                        if (!detailDTOS.contains(detail)) {
-                            detailDTOS.add(detail);
-                        }
+                countDetailDTOS.add(dto);
+                if (fieldType == null || fieldType != 6) {
+                    Long docCount = aggregate.sterms().sumOtherDocCount();
+                    EsCountDetailDTO detail = new EsCountDetailDTO();
+                    detail.setField(field);
+                    detail.setName("未选择");
+                    detail.setNumber(docCount);
+                    detail.setTopN(topN);
+                    if (!countDetailDTOS.contains(detail)) {
+                        countDetailDTOS.add(detail);
                     }
                 }
+//                if (dto.getNumber() > 0) {
+//                    detailDTOS.add(dto);
+//                    if (fieldType == null || fieldType != 6) {
+//                        Long docCount = aggregate.sterms().sumOtherDocCount();
+//                        EsCountDetailDTO detail = new EsCountDetailDTO();
+//                        detail.setField(field);
+//                        detail.setName("未选择");
+//                        detail.setNumber(docCount);
+//                        detail.setTopN(topN);
+//                        if (!detailDTOS.contains(detail)) {
+//                            detailDTOS.add(detail);
+//                        }
+//                    }
+//                }
             });
         });
+
+        List<String> strs = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(values)) {
+            strs.addAll(values);
+        }
+        if (StringUtils.isNotEmpty(firstName)) {
+            countDetailDTOS.removeIf(dto -> dto.getName().equals("其他"));
+            if (countDetailDTOS.size() != values.size()) {
+                for (EsCountDetailDTO detailDTO : countDetailDTOS) {
+                    strs.removeIf(i -> i.equals(detailDTO.getName()));
+                }
+                for (String value : strs) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            } else if (countDetailDTOS.isEmpty()) {
+                for (String value : values) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            }
+            map.put(firstName, countDetailDTOS);
+        } else {
+            detailDTOS.addAll(countDetailDTOS);
+        }
+
     }
 
     /**
@@ -416,7 +624,10 @@ public class EsCountService {
      * @param field
      * @param detailDTOS
      */
-    public void getNumberAnalysisDTOS(Aggregate agg, String field,Integer topN, List<EsCountDetailDTO> detailDTOS) {
+    public void getNumberAnalysisDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS,
+                                      EsCountDTO esCountDTO, String firstName,
+                                      Map<String, List<EsCountDetailDTO>> map,List<String> values) {
+        List<EsCountDetailDTO> countDetailDTOS = new ArrayList<>();
         List<RangeBucket> list = agg.range().buckets().array();
         for (RangeBucket bucket : list) {
             EsCountDetailDTO dto = new EsCountDetailDTO();
@@ -424,9 +635,46 @@ public class EsCountService {
             dto.setName(bucket.key());
             dto.setNumber(bucket.docCount());
             dto.setTopN(topN);
-            if (dto.getNumber() > 0) {
-                detailDTOS.add(dto);
+            dto.setFirstName(firstName);
+            countDetailDTOS.add(dto);
+//            if (dto.getNumber() > 0) {
+//                detailDTOS.add(dto);
+//            }
+        }
+
+        List<String> strs = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(values)) {
+            strs.addAll(values);
+        }
+        if (StringUtils.isNotEmpty(firstName)) {
+            countDetailDTOS.removeIf(dto -> dto.getName().equals("其他"));
+            if (countDetailDTOS.size() != values.size()) {
+                for (EsCountDetailDTO detailDTO : countDetailDTOS) {
+                    strs.removeIf(i -> i.equals(detailDTO.getName()));
+                }
+                for (String value : strs) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            } else if (countDetailDTOS.isEmpty()) {
+                for (String value : values) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
             }
+            map.put(firstName, countDetailDTOS);
+        } else {
+            detailDTOS.addAll(countDetailDTOS);
         }
     }
 
@@ -473,7 +721,7 @@ public class EsCountService {
                         h1Count += histogramBucket.docCount();
                         dto.setNumber(h1Count);
                     }
-                    if (month.after(halfYearDate)){
+                    if (month.after(halfYearDate)) {
                         h2Count += histogramBucket.docCount();
                         dto2.setNumber(h2Count);
                     }
@@ -489,6 +737,37 @@ public class EsCountService {
                 detailDTO.setNumber(sum);
                 esCountDetailDTOS.add(detailDTO);
             }
+        } else if (StringUtils.isNotEmpty(format) && format.equals("季")) {
+            for (DateHistogramBucket bucket : list) {
+                String yearMonth = bucket.keyAsString();
+                String year = yearMonth.substring(0, yearMonth.indexOf("-"));
+                String firstQuarter = year + "-01";
+                String secondQuarter = year + "-04";
+                String thirdQuarter = year + "-07";
+                String forthQuarter = year + "-10";
+                String firstQ = year + "-Q1";
+                String secondQ = year + "-Q2";
+                String thirdQ = year + "-Q3";
+                String forthQ = year + "-Q4";
+                EsCountDetailDTO dto = new EsCountDetailDTO();
+                dto.setField(field);
+                Aggregate aggregate = bucket.aggregations().get("filter_agg");
+                if (yearMonth.equals(firstQuarter)) {
+                    dto.setName(firstQ);
+                } else if (yearMonth.equals(secondQuarter)) {
+                    dto.setName(secondQ);
+                } else if (yearMonth.equals(thirdQuarter)) {
+                    dto.setName(thirdQ);
+                } else if (yearMonth.equals(forthQuarter)) {
+                    dto.setName(forthQ);
+                }
+                dto.setNumber(bucket.docCount());
+                dto.setTopN(topN);
+                if (aggregate != null) {
+                    dto.setNumber(aggregate.filter().docCount());
+                }
+                esCountDetailDTOS.add(dto);
+            }
         } else {
             list.forEach(bucket -> {
                 EsCountDetailDTO dto = new EsCountDetailDTO();
@@ -500,9 +779,7 @@ public class EsCountService {
                 if (aggregate != null) {
                     dto.setNumber(aggregate.filter().docCount());
                 }
-                if (dto.getNumber() > 0) {
-                    esCountDetailDTOS.add(dto);
-                }
+                esCountDetailDTOS.add(dto);
             });
         }
 
@@ -512,17 +789,18 @@ public class EsCountService {
             detailDTOS.addAll(collect);
         }
 
-        EsCountDetailDTO countDTO = new EsCountDetailDTO();
-        countDTO.setField(field);
-        countDTO.setName("其他");
-        if (list.size() > topN) {
-            countDTO.setNumber((long)(list.size() - topN));
-
-        } else {
-            countDTO.setNumber((long)0);
-        }
-        countDTO.setTopN(topN);
-        detailDTOS.add(countDTO);
+//        EsCountDetailDTO countDTO = new EsCountDetailDTO();
+//        countDTO.setField(field);
+//        countDTO.setName("其他");
+//        if (list.size() > topN) {
+//            int sum = list.size() - topN;
+//            countDTO.setNumber(Long.valueOf(String.valueOf(sum)));
+//
+//        } else {
+//            countDTO.setNumber(0L);
+//        }
+//        countDTO.setTopN(topN);
+//        detailDTOS.add(countDTO);
     }
 
     /**
@@ -533,23 +811,59 @@ public class EsCountService {
      * @param topN
      * @param detailDTOS
      */
-    public void getDateAnalysisDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS,EsCountDTO esCountDTO) {
+    public void getDateAnalysisDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS,
+                                    EsCountDTO esCountDTO, String firstName,
+                                    Map<String, List<EsCountDetailDTO>> map,List<String> values) {
         List<RangeBucket> list1 = agg.dateRange().buckets().array();
         List<EsCountDetailDTO> esCountDetailDTOS = new ArrayList<>();
         for (RangeBucket bucket : list1) {
             EsCountDetailDTO dto = new EsCountDetailDTO();
+            dto.setFirstName(firstName);
             dto.setField(field);
             dto.setName(bucket.key());
             dto.setNumber(bucket.docCount());
             dto.setTopN(topN);
-            if (dto.getNumber() > 0) {
-                esCountDetailDTOS.add(dto);
-            }
+            esCountDetailDTOS.add(dto);
         }
         if (!CollectionUtils.isEmpty(esCountDetailDTOS)) {
             List<EsCountDetailDTO> collect = esCountDetailDTOS.stream()
                     .sorted(Comparator.comparing(EsCountDetailDTO::getName).reversed()).limit(topN).collect(Collectors.toList());
-            detailDTOS.addAll(collect);
+
+            List<String> strs = new ArrayList<>();
+            if (!CollectionUtils.isEmpty(values)) {
+                strs.addAll(values);
+            }
+            if (StringUtils.isNotEmpty(firstName)) {
+                collect.removeIf(dto -> dto.getName().equals("其他"));
+                if (collect.size() != values.size()) {
+                    for (EsCountDetailDTO detailDTO : collect) {
+                        strs.removeIf(i -> i.equals(detailDTO.getName()));
+                    }
+                    for (String value : strs) {
+                        EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                        detailDTO.setName(value);
+                        detailDTO.setFirstName(firstName);
+                        detailDTO.setField(field);
+                        detailDTO.setNumber(0L);
+                        detailDTO.setTopN(topN);
+                        collect.add(detailDTO);
+                    }
+                } else if (collect.isEmpty()) {
+                    for (String value : values) {
+                        EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                        detailDTO.setName(value);
+                        detailDTO.setFirstName(firstName);
+                        detailDTO.setField(field);
+                        detailDTO.setNumber(0L);
+                        detailDTO.setTopN(topN);
+                        collect.add(detailDTO);
+                    }
+                }
+                map.put(firstName, collect);
+            } else {
+                detailDTOS.addAll(collect);
+            }
+
         }
     }
 
@@ -560,14 +874,17 @@ public class EsCountService {
      * @param field
      * @param detailDTOS
      */
-    public void getNestedCountDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS) {
+    public void getNestedCountDTOS(Aggregate agg, String field, Integer topN, List<EsCountDetailDTO> detailDTOS,
+                                   EsCountDTO esCountDTO, String firstName,
+                                   Map<String, List<EsCountDetailDTO>> map, List<String> values) {
         Aggregate termsAgg = agg.nested().aggregations().get("terms_agg");
+        List<EsCountDetailDTO> countDetailDTOS = new ArrayList<>();
         EsCountDetailDTO countDTO = new EsCountDetailDTO();
         countDTO.setField(field);
         countDTO.setName("其他");
         countDTO.setNumber(termsAgg.sterms().sumOtherDocCount());
         countDTO.setTopN(topN);
-        detailDTOS.add(countDTO);
+        countDetailDTOS.add(countDTO);
         List<StringTermsBucket> list = termsAgg.sterms().buckets().array();
         list.forEach(bucket -> {
             EsCountDetailDTO dto = new EsCountDetailDTO();
@@ -576,14 +893,50 @@ public class EsCountService {
             dto.setName(bucket.key().stringValue());
             dto.setNumber(bucket.docCount());
             dto.setTopN(topN);
+            dto.setFirstName(firstName);
             if (aggregate != null) {
                 dto.setNumber(aggregate.filter().docCount());
             }
-            if (dto.getNumber() > 0) {
-                detailDTOS.add(dto);
-            }
+            countDetailDTOS.add(dto);
+//            if (dto.getNumber() > 0) {
+//                detailDTOS.add(dto);
+//            }
         });
-    }
 
+        List<String> strs = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(values)) {
+            strs.addAll(values);
+        }
+        if (StringUtils.isNotEmpty(firstName)) {
+            countDetailDTOS.removeIf(dto -> dto.getName().equals("其他"));
+            if (countDetailDTOS.size() != values.size()) {
+                for (EsCountDetailDTO detailDTO : countDetailDTOS) {
+                    strs.removeIf(i -> i.equals(detailDTO.getName()));
+                }
+                for (String value : strs) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            } else if (countDetailDTOS.isEmpty()) {
+                for (String value : values) {
+                    EsCountDetailDTO detailDTO = new EsCountDetailDTO();
+                    detailDTO.setName(value);
+                    detailDTO.setFirstName(firstName);
+                    detailDTO.setField(field);
+                    detailDTO.setNumber(0L);
+                    detailDTO.setTopN(topN);
+                    countDetailDTOS.add(detailDTO);
+                }
+            }
+            map.put(firstName, countDetailDTOS);
+        } else {
+            detailDTOS.addAll(countDetailDTOS);
+        }
+    }
 
 }

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

@@ -403,7 +403,7 @@ public class PersonFieldService {
         }
         Boolean flag = true;
         List<GetAllPatentCountVO> fieldVOS = JSON.parseArray(fieldJson, GetAllPatentCountVO.class);
-        fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats())).collect(Collectors.toList());
+        fieldVOS = fieldVOS.stream().filter(item -> flag.equals(item.getIfStats()) || flag.equals(item.getIfGroup())).collect(Collectors.toList());
         fieldVOS.forEach(item -> item.setFiledKind(-1));
 
         //当专题库id或者报告id不为null时

+ 49 - 49
src/main/resources/jsons/patent.json

@@ -7,7 +7,7 @@
     "esField": "patent_no.keyword",
     "esClass": "wildcardQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "false",
@@ -22,7 +22,7 @@
     "esField": "app_no.keyword",
     "esClass": "wildcardQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "false",
@@ -37,7 +37,7 @@
     "esField": "public_no.keyword",
     "esClass": "wildcardQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "false",
@@ -52,7 +52,7 @@
     "esField": "grant_no.keyword",
     "esClass": "wildcardQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "false",
@@ -67,7 +67,7 @@
     "esField": "public_date",
     "esClass": "dateQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -82,7 +82,7 @@
     "esField": "app_date",
     "esClass": "dateQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -97,7 +97,7 @@
     "esField": "grant_date",
     "esClass": "dateQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -125,7 +125,7 @@
     "esField": "abstract_str.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "defaultHidden": "true",
@@ -140,7 +140,7 @@
     "esField": "title.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "text"
@@ -153,7 +153,7 @@
     "esField": "examination_date",
     "esClass": "dateQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "dateType"
@@ -166,7 +166,7 @@
     "esField": "applicant.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -182,7 +182,7 @@
     "esField": "stander_applicant.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -196,7 +196,7 @@
     "esField": "merge_applicant.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -210,7 +210,7 @@
     "esField": "inventor.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -224,7 +224,7 @@
     "esField": "merge_inventor.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -238,7 +238,7 @@
     "esField": "right_holder.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -252,7 +252,7 @@
     "esField": "stander_right_holder.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -266,7 +266,7 @@
     "esField": "merge_right_holder.name",
     "esClass": "nestedQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -280,7 +280,7 @@
     "esField": "public_full_text.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -294,7 +294,7 @@
     "esField": "grant_full_text.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -308,7 +308,7 @@
     "esField": "agency",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -322,7 +322,7 @@
     "esField": "agent.key",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -336,7 +336,7 @@
     "esField": "simple_family_num",
     "esClass": "numberQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "amount"
@@ -349,7 +349,7 @@
     "esField": "inpadoc_family_num",
     "esClass": "numberQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "amount"
@@ -362,7 +362,7 @@
     "esField": "patsnap_family_num",
     "esClass": "numberQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "amount"
@@ -375,7 +375,7 @@
     "esField": "quote_patent_no_num",
     "esClass": "numberQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "amount"
@@ -388,7 +388,7 @@
     "esField": "quoted_patent_no_num",
     "esClass": "numberQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "groupBy": "amount"
@@ -401,7 +401,7 @@
     "esField": "applicant_addr.address",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -415,7 +415,7 @@
     "esField": "app_country",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -429,7 +429,7 @@
     "esField": "applicant_addr.country",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -443,7 +443,7 @@
     "esField": "applicant_addr.province",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -457,7 +457,7 @@
     "esField": "applicant_addr.city",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -471,7 +471,7 @@
     "esField": "applicant_addr.district",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifAsCondition": "true",
     "groupBy": "nation"
@@ -484,7 +484,7 @@
     "esField": "right_holder_addr.address",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -498,7 +498,7 @@
     "esField": "right_holder_addr.country",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -512,7 +512,7 @@
     "esField": "right_holder_addr.province",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -526,7 +526,7 @@
     "esField": "right_holder_addr.city",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -540,7 +540,7 @@
     "esField": "right_holder_addr.district",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifAsCondition": "true",
     "groupBy": "nation"
@@ -553,7 +553,7 @@
     "esField": "mipc",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -632,7 +632,7 @@
     "esField": "mcpc",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -711,7 +711,7 @@
     "esField": "mupc",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -764,7 +764,7 @@
     "esField": "mloc",
     "esClass": "prefixQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -817,7 +817,7 @@
     "esField": "claim.text_content",
     "esClass": "matchQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "false",
     "ifAsCondition": "true",
     "groupBy": "text"
@@ -830,7 +830,7 @@
     "esField": "simple_status",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -845,7 +845,7 @@
     "esField": "patent_type",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifAsCondition": "true",
     "ifStats": "true",
@@ -860,7 +860,7 @@
     "esField": "legal_status.raw",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "true",
     "ifAsCondition": "true",
@@ -874,7 +874,7 @@
     "esField": "examiner.key",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -888,7 +888,7 @@
     "esField": "aid_examiner.key",
     "esClass": "keyWordQueryBuilder",
     "ifSearch": "true",
-    "ifGroup": "false",
+    "ifGroup": "true",
     "ifShow": "true",
     "ifStats": "false",
     "ifAsCondition": "true",
@@ -1079,5 +1079,5 @@
     "ifGroup": "false",
     "ifShow": "false",
     "ifAsCondition": "true"
-  },
+  }
 ]

+ 2 - 2
src/main/resources/mapper/CustomAnalyseMapper.xml

@@ -17,7 +17,7 @@
             </if>
             <if test="vo.creatorId != null">
                 /*系统私有公开*/
-                or (permissions = 2 AND creator_id = #{vo.creatorId})
+                or (permissions = 2 AND create_id = #{vo.creatorId})
             </if>
             <if test="vo.tenantId != null and vo.projectId != null">
                 /*数据库公开*/
@@ -25,7 +25,7 @@
             </if>
             <if test="vo.projectId != null and vo.creatorId != null">
                 /*数据库私有*/
-                or (permissions = 4 AND creator_id = #{vo.creatorId} AND project_id = #{vo.projectId})
+                or (permissions = 4 AND create_id = #{vo.creatorId} AND project_id = #{vo.projectId})
             </if>
             )
         </where>