lwhhszx пре 1 година
родитељ
комит
fb722b1e67

+ 9 - 0
src/main/java/cn/cslg/pas/domain/es/QuotePatent.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.List;
 
 @Component
@@ -29,4 +30,12 @@ public class QuotePatent {
 
     @JsonProperty("app_no")
     private String appNo;
+    /**
+     * 公开号
+     */
+    @JsonProperty("public_no")
+    private String publicNo;
+    @JsonProperty("grant_no")
+    private String grantNo;
+
 }

+ 111 - 118
src/main/java/cn/cslg/pas/service/ReportExportService.java

@@ -1,27 +1,24 @@
 package cn.cslg.pas.service;
 
+import cn.cslg.pas.common.dto.PatentColumnDTO;
+import cn.cslg.pas.common.dto.PatentDTO;
 import cn.cslg.pas.common.dto.PatentDetailDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
 import cn.cslg.pas.common.model.SystemMO;
+import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.DateUtils;
 import cn.cslg.pas.common.utils.FileUtils;
 import cn.cslg.pas.common.utils.FormatUtil;
 import cn.cslg.pas.common.utils.PatentRightUtils;
-import cn.cslg.pas.common.vo.AvoidFeaturesVO;
-import cn.cslg.pas.common.vo.FieldValueVO;
-import cn.cslg.pas.common.vo.PatentRightParams;
-import cn.cslg.pas.common.vo.RePatentClaim;
+import cn.cslg.pas.common.vo.*;
 import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.domain.es.Text;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.AvoidDesignMapper;
-import cn.cslg.pas.service.business.CustomFieldService;
-import cn.cslg.pas.service.business.ReportProjectService;
-import cn.cslg.pas.service.business.TemplateConfigService;
-import cn.cslg.pas.service.business.TempleService;
+import cn.cslg.pas.service.business.*;
 import cn.cslg.pas.service.business.es.EsPatentService;
 import cn.cslg.pas.service.business.es.EsService;
 import cn.cslg.pas.service.common.FileManagerService;
@@ -36,6 +33,7 @@ import com.deepoove.poi.data.PictureType;
 import com.deepoove.poi.data.Pictures;
 import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.PictureData;
 import org.ddr.poi.html.HtmlRenderPolicy;
 import org.joda.time.format.FormatUtils;
@@ -70,6 +68,8 @@ public class ReportExportService {
     private CustomFieldService customFieldService;
     @Autowired
     private EsService esService;
+    @Autowired
+    private FTOCompareRecordService ftoCompareRecordService;
 
     /**
      * @param projectId
@@ -360,126 +360,119 @@ public class ReportExportService {
      * @description 装载FTO模板
      */
     private XWPFTemplate FTOTemplate(Integer projectId, String filePath, Integer templateId) throws IOException {
-        //根据报告ID获得自定义字段值的信息
-
         //获得模板的配置信息
         LambdaQueryWrapper<TemplateConfig> templateConfigWrapper = new LambdaQueryWrapper<TemplateConfig>();
         templateConfigWrapper.eq(TemplateConfig::getTemplateId, templateId);
         List<TemplateConfig> templateConfigs = templateConfigService.list(templateConfigWrapper);
-
+        List<Map<String, Object>> classifyMaps = new ArrayList<>();
         for (TemplateConfig templateConfig : templateConfigs) {
+            Map<String, Object> classifyMap = new HashMap<>();
+
             String value = templateConfig.getValueName();
             //根据value 查询专利
-            List<EsCustomFieldDTO> esCustomFieldDTOS = customFieldService.getCustomFieldByValueName(value,projectId);
-            if(esCustomFieldDTOS.size()!=0){
-
-
+            List<EsCustomFieldValueDTO> esCustomFieldDTOS = customFieldService.getCustomFieldByValueName(value, projectId);
+            if (esCustomFieldDTOS.size() != 0) {
+                classifyMap.put("classify", templateConfig.getMapName());
+                StringRequest stringRequest = new StringRequest();
+                stringRequest.setCustomFields(esCustomFieldDTOS);
+                stringRequest.setProjectId(projectId);
+                List<PatentColumnDTO> patentColumnDTOS = new ArrayList<>();
+                try {
+                    PatentDTO patentDTO = esService.esSearch(stringRequest);
+                    patentColumnDTOS = patentDTO.getPatents();
+                } catch (Exception e) {
+                    return null;
+                }
+                //存放公告专利
+                List<Map<String, Object>> announcePatents = new ArrayList<>();
+                //存放公开专利
+                List<Map<String, Object>> publicPatents = new ArrayList<>();
+                //存放失效专利信息
+                List<Map<String, Object>> lapsePatents = new ArrayList<>();
+                for (PatentColumnDTO patent : patentColumnDTOS) {
+//                    List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
+//                    StringBuilder applicants = new StringBuilder();
+//                    StringBuilder rightPerson = new StringBuilder();
+//                    applicantJSONs.forEach(tem -> {
+//                        if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
+//                            applicants.append(tem.get("name") + "\r");
+//                        } else {
+//                            rightPerson.append(tem.get("name") + "\r");
+//                        }
+//                    });
+//                    //装载同族信息
+////                    JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
+//                    List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
+//                    List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
+//                    List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
+//                    patSnaps.addAll(simples);
+//                    patSnaps.addAll(inpadocs);
+//                    String familyStr = StringUtils.join(patSnaps, ",");
+//                    //装载法律状态
+//                    StringBuilder affair = new StringBuilder();
+//                    List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
+//                    affaires.forEach(item -> {
+//                                affair.append(item.get("status") + "\r");
+//                            }
+//
+//                    );
+                    //装载单个专利的信息
+                    Map<String, Object> patentMap = new HashMap<>();
+                    //同族专利
+//                    patentMap.put("simpleFamilys", familyStr);
+                    //引用专利
+
+//                    patentMap.put("quotePatents", patent.get("quote"));
+                    //申请日
+                    patentMap.put("applicationDate", patent.getAppDate());
+                    //公开日
+                    patentMap.put("publicDate", patent.getPublicDate());
+                    //专利号
+                    patentMap.put("publicNo", patent.getPatentNo());
+                    patentMap.put("firstPublicDate", patent.getPublicDate());
+//                    patentMap.put("applicant", applicants);
+//                    patentMap.put("rightPerson", rightPerson);
+//                    patentMap.put("affair", affair);
+                    //优先权日
+                    patentMap.put("priorityDate", patent.getPriorities());
+                    //图示
+//                    patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
+                    //获得专利对比记录的信息
+                    Map<String, Object> temMap = ftoCompareRecordService.LoadCompareMessageForExport(projectId, patent.getPatentNo());
+                    List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
+                    //装载对比记录的信息
+                    patentMap.put("cM", compareMessageVOS);
+                    patentMap.put("rightNum", temMap.get("right"));
+                    patentMap.put("mainRightNum", temMap.get("mainRight"));
+                    Integer status = Integer.parseInt(patent.getSimpleStatus());
+                    if (status == 1 || status == 5 || status == 6) {
+                        announcePatents.add(patentMap);
+                    } else if (status == 2) {
+                        lapsePatents.add(patentMap);
+                    } else if (status == 3) {
+                        publicPatents.add(patentMap);
+                    }
+                    classifyMap.put("publicPatents", publicPatents);
+                    classifyMap.put("lapsePatents", lapsePatents);
+                    classifyMap.put("announcePatents", announcePatents);
+                }
+                classifyMaps.add(classifyMap);
             }
         }
 
-        //
-        List<Map<String, Object>> classifyMaps = new ArrayList<>();
-        //装载信息
-//        for (TemplateConfig templateConfig : templateConfigs) {
-//            Map<String, Object> classifyMap = new HashMap<>();
-//            classifyMap.put("classify", map.get("CName"));
-//            //根据自定义字段ID和值Id查询专利号
-//            List<String> patentNos = reportFieldPatentLinkService.getPatentNos(Integer.parseInt(map.get("FId").toString()), Integer.parseInt(map.get("CId").toString()));
-//            PatentVO patentVO = new PatentVO();
-//            patentVO.setPatentNos(patentNos);
-//            //根据专利号查询专利详细信息
-//            String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
-//            JSONObject jsonObject = JSONObject.parseObject(resBody);
-//            List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
-//            //根据专利号和报告Id获得对比记录
-//            //存放公告专利
-//            List<Map<String, Object>> announcePatents = new ArrayList<>();
-//            //存放公开专利
-//            List<Map<String, Object>> publicPatents = new ArrayList<>();
-//            //存放失效专利信息
-//            List<Map<String, Object>> lapsePatents = new ArrayList<>();
-//            for (JSONObject patent : patentDTOS) {
-//                List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
-//                StringBuilder applicants = new StringBuilder();
-//                StringBuilder rightPerson = new StringBuilder();
-//                applicantJSONs.forEach(tem -> {
-//                    if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
-//                        applicants.append(tem.get("name") + "\r");
-//                    } else {
-//                        rightPerson.append(tem.get("name") + "\r");
-//                    }
-//                });
-//                //装载同族信息
-//                JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
-//                List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
-//                List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
-//                List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
-//                patSnaps.addAll(simples);
-//                patSnaps.addAll(inpadocs);
-//                String familyStr = StringUtils.join(patSnaps, ",");
-//                //装载法律状态
-//                StringBuilder affair = new StringBuilder();
-//                List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
-//                affaires.forEach(item -> {
-//                            affair.append(item.get("status") + "\r");
-//                        }
-//
-//                );
-//                //装载单个专利的信息
-//                Map<String, Object> patentMap = new HashMap<>();
-//                //同族专利
-//                patentMap.put("simpleFamilys", familyStr);
-//                //引用专利
-//                patentMap.put("quotePatents", patent.get("quote"));
-//                //申请日
-//                patentMap.put("applicationDate", patent.get("applicationDate"));
-//                //公开日
-//                patentMap.put("publicDate", patent.get("publicDate"));
-//                //专利号
-//                patentMap.put("publicNo", patent.get("publicNo"));
-//                patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
-//                patentMap.put("applicant", applicants);
-//                patentMap.put("rightPerson", rightPerson);
-//                patentMap.put("affair", affair);
-//                //优先权日
-//                patentMap.put("priorityDate", patent.get("priorityDate"));
-//                //图示
-//                patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
-//                //获得专利对比记录的信息
-//                Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
-//                List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
-//                //装载对比记录的信息
-//                patentMap.put("cM", compareMessageVOS);
-//                patentMap.put("rightNum", temMap.get("right"));
-//                patentMap.put("mainRightNum", temMap.get("mainRight"));
-//                Integer status = Integer.parseInt(patent.get("simpleStatusInt").toString());
-//                if (status == 1 || status == 5 || status == 6) {
-//                    announcePatents.add(patentMap);
-//                } else if (status == 2) {
-//                    lapsePatents.add(patentMap);
-//                } else if (status == 3) {
-//                    publicPatents.add(patentMap);
-//                }
-//                classifyMap.put("publicPatents", publicPatents);
-//                classifyMap.put("lapsePatents", lapsePatents);
-//                classifyMap.put("announcePatents", announcePatents);
-//            }
-//            classifyMaps.add(classifyMap);
-//        }
-//        Map<String, Object> map = new HashMap<>();
-//        String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
-//        String[] ds = date.split("-");
-//        map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
-//        map.put("classifys", classifyMaps);
-//        // 为表格的显示绑定行循环
-//        LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
-//        HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
-//        // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
-//        Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
-//        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
-//        return template;
-        return null;
-    }
+        Map<String, Object> map = new HashMap<>();
+        String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
+        String[] ds = date.split("-");
+        map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
+        map.put("classifys", classifyMaps);
+        // 为表格的显示绑定行循环
+        LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
+        HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
+        // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
+        Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
+        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
+        return template;
 
+    }
 
 }

+ 5 - 4
src/main/java/cn/cslg/pas/service/business/CustomFieldService.java

@@ -4,6 +4,7 @@ import cn.cslg.pas.common.dto.AllFieldOrderDTO;
 import cn.cslg.pas.common.dto.business.CustomFieldDTO;
 import cn.cslg.pas.common.dto.business.UpdateCustomFieldDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
 import cn.cslg.pas.common.dto.es.QueryEsCustomFieldDTO;
 import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
@@ -482,8 +483,8 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
      * @param name
      * @param projectId
      */
-    public List<EsCustomFieldDTO> getCustomFieldByValueName(String name, Integer projectId) {
-        List<EsCustomFieldDTO> esCustomFieldDTOS = new ArrayList<>();
+    public List<EsCustomFieldValueDTO> getCustomFieldByValueName(String name, Integer projectId) {
+        List<EsCustomFieldValueDTO> esCustomFieldDTOS = new ArrayList<>();
         //根据名称获得标引栏位以及标引值
         LambdaQueryWrapper<CustomField> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(CustomField::getType, Arrays.asList(4, 5, 6))
@@ -507,7 +508,7 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
 
         if (options != null && options.size() != 0) {
             options.forEach(item -> {
-                EsCustomFieldDTO esCustomFieldDTO = esCustomFieldDTOS.stream()
+                EsCustomFieldValueDTO esCustomFieldDTO = esCustomFieldDTOS.stream()
                         .filter(i -> i.getFieldId()
                                 .equals(item.getCustomFieldId()))
                         .findFirst().orElse(null);
@@ -524,7 +525,7 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
 
         if (treeNodes != null && treeNodes.size() != 0) {
             treeNodes.forEach(item -> {
-                EsCustomFieldDTO esCustomFieldDTO = esCustomFieldDTOS.stream()
+                EsCustomFieldValueDTO esCustomFieldDTO = esCustomFieldDTOS.stream()
                         .filter(i -> i.getFieldId()
                                 .equals(item.getTypeId()))
                         .findFirst().orElse(null);

+ 37 - 4
src/main/java/cn/cslg/pas/service/business/FTOCompareRecordService.java

@@ -8,6 +8,7 @@ import cn.cslg.pas.common.model.cronModel.PersonnelVO;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.utils.StringUtils;
+import cn.cslg.pas.common.vo.CompareMessageVO;
 import cn.cslg.pas.common.vo.PatentRightVo;
 import cn.cslg.pas.common.vo.RePatentClaim;
 import cn.cslg.pas.common.vo.business.*;
@@ -28,10 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -847,6 +845,13 @@ public class FTOCompareRecordService extends ServiceImpl<FTOCompareRecordMapper,
         return tortVOS;
     }
 
+    /**
+     * 获得已经对比过的专利
+     *
+     * @param projectId
+     * @param compareResult
+     * @return
+     */
     public List<ComparedPatentVO> getComparedPatent(Integer projectId, Integer compareResult) {
         //根据projectId 查询出对比过的专利号
         List<String> patentNos = this.getBaseMapper().getComparedPatents(projectId, compareResult);
@@ -880,4 +885,32 @@ public class FTOCompareRecordService extends ServiceImpl<FTOCompareRecordMapper,
         return comparedPatentVOS;
     }
 
+    /**
+     * 为导出装载对比记录
+     *
+     * @param projectId
+     * @param patentNo
+     */
+    public Map<String, Object> LoadCompareMessageForExport(Integer projectId, String patentNo) {
+        Map<String, Object> map = new HashMap<>();
+        Integer rightNum = 0;
+        Integer mainRightNum = 0;
+        TortCompareRecordVO tortCompareRecordVO = this.getLastRecord(projectId, patentNo);
+        List<CompareMessageVO> compareMessageVOS = new ArrayList<>();
+        if (tortCompareRecordVO != null) {
+            List<TortRightVO> tortRightVOS = tortCompareRecordVO.getTortRightVOS();
+
+            for (TortRightVO item : tortRightVOS) {
+                compareMessageVOS.addAll((item.getCompareMessageVOS()));
+                if (item.getType().equals(0)) {
+                    mainRightNum++;
+                }
+                rightNum++;
+            }
+        }
+        map.put("compareMessageVOs", compareMessageVOS);
+        map.put("rightNum", rightNum);
+        map.put("mainRightNum", mainRightNum);
+        return map;
+    }
 }

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

@@ -1118,7 +1118,6 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
                 assoTaskFields.add(assoTaskField);
             });
 
-
         }
         assoTaskFieldService.saveBatch(assoTaskFields);
     }

+ 69 - 0
src/main/java/cn/cslg/pas/service/business/es/EsQuotePatentService.java

@@ -0,0 +1,69 @@
+package cn.cslg.pas.service.business.es;
+
+import cn.cslg.pas.domain.es.FamilyPatent;
+import cn.cslg.pas.domain.es.PatentFamilyMessage;
+import cn.cslg.pas.domain.es.PatentQuoteMessage;
+import cn.cslg.pas.domain.es.QuotePatent;
+import co.elastic.clients.elasticsearch.ElasticsearchClient;
+import co.elastic.clients.elasticsearch._types.query_dsl.Query;
+import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
+import co.elastic.clients.elasticsearch.core.SearchRequest;
+import co.elastic.clients.elasticsearch.core.SearchResponse;
+import co.elastic.clients.elasticsearch.core.search.Hit;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class EsQuotePatentService {
+    private final ElasticsearchClient client;
+
+    //根据专利号查询同族专利号
+    public  Map<String, Object> getEsQutePatentByNos(String patentNo) throws Exception {
+        SearchRequest.Builder builder = new SearchRequest.Builder();
+        //设置查询索引
+        builder.index("quote_patent");
+        List<Query> querys = new ArrayList<>();
+
+        Query q1 = QueryBuilders.term(t -> t.field("patent.app_no.keyword").value(patentNo));
+        //公开号
+        Query q2 = QueryBuilders.term(t -> t.field("patent.public_no.keyword").value(patentNo));
+        //授权号
+        Query q3 = QueryBuilders.term(t -> t.field("patent.grant_no.keyword").value(patentNo));
+        Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
+
+        builder.query(query);
+        SearchResponse<PatentQuoteMessage> response = client.search(builder.build(), PatentQuoteMessage.class);
+        List<Hit<PatentQuoteMessage>> hits = response.hits().hits();
+        Map<String, Object> reQuotePatent = new HashMap<>();
+        if(hits.size()<=0){
+            return reQuotePatent;
+        }
+         Hit<PatentQuoteMessage> hit  =hits.get(0);
+            PatentQuoteMessage quoteMessage = hit.source();
+            List<QuotePatent> patentList = quoteMessage.getQuotedPatents();
+            if (!CollectionUtils.isEmpty(patentList)) {
+                List<String> nos = new ArrayList<>();
+                patentList.forEach(item -> {
+                    if (item.getGrantNo() != null && !item.getGrantNo().trim().equals("")) {
+                        nos.add(item.getGrantNo());
+                    } else if (item.getPublicNo() != null && !item.getPublicNo().trim().equals("")) {
+                        nos.add(item.getPublicNo());
+                    } else if (item.getAppNo() != null && !item.getAppNo().trim().equals("")) {
+                        nos.add(item.getAppNo());
+                    }
+                });
+                reQuotePatent.put("nos", nos);
+                reQuotePatent.put("id", hit.id());
+            }
+        return reQuotePatent;
+    }
+
+}

+ 6 - 3
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -204,9 +204,9 @@ public class EsService {
 //        }
 
         //分页
-//        if (current > 0 && size > 0) {
-//            builder.from((current.intValue() - 1) * size.intValue()).size(size.intValue());
-//        }
+        if (current > 0 && size > 0) {
+            builder.from((current.intValue() - 1) * size.intValue()).size(size.intValue());
+        }
 
         SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
         List<PatentColumnDTO> list = new ArrayList<>();
@@ -774,7 +774,10 @@ public class EsService {
             }
             quotePatent.setRightHolder(patentPeople);
         }
+
         quotePatent.setAppNo(starPatentVO.getApplicationNo());
+        quotePatent.setGrantNo(starPatentVO.getPublicAccreditNo());
+        quotePatent.setPublicNo(starPatentVO.getPublicNo());
         return quotePatent;
     }
 

+ 5 - 5
src/main/java/cn/cslg/pas/service/importPatent/GetCataloguingFromWebThread.java

@@ -117,11 +117,11 @@ public class GetCataloguingFromWebThread extends Thread {
 //                esService.addEsLegalEvent(uploadPatentWebDTO.getStarPatentVO().getPublicNo());
 //
 //                //添加引用专利
-//                String nos = starPatentVO.getQuoteNos();
-//                if (nos != null) {
-//                    List<String> quotedNos = this.reQuotedNos(nos);
-//                    esService.addEsQuotePatent(uploadPatentWebDTO.getPatent().getPublicNo(), quotedNos);
-//                }
+                String nos = starPatentVO.getQuoteNos();
+                if (nos != null) {
+                    List<String> quotedNos = this.reQuotedNos(nos);
+                    esService.addEsQuotePatent(uploadPatentWebDTO.getPatent().getPublicNo(), quotedNos);
+                }
                 //加入es保存队列
                 importFromWebToEsService.loadPatentMessageDone(uploadPatentWebDTO);
             } catch (Exception e) {

+ 1 - 0
src/main/java/cn/cslg/pas/service/importPatent/GetPatentFromExcelThread.java

@@ -75,6 +75,7 @@ public class GetPatentFromExcelThread extends Thread {
                 uploadPatentWebDTO.setPictureData(uploadParamsVO.getPictureData());
                 uploadPatentWebDTO.setPatent(uploadParamsVO.getPatent());
                 //专利丢入消费者队列,并唤醒消费者线程
+
                 savePatentToEsThread.awakeTask(uploadPatentWebDTO.getPatent());
                 getPatentPictureFromExcelThread.awakeTask(uploadPatentWebDTO);
             }

+ 6 - 2
src/main/java/cn/cslg/pas/service/importPatent/GetPatentPictureFromExcelThread.java

@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONArray;
 import org.apache.commons.compress.utils.IOUtils;
 import org.apache.poi.ss.usermodel.PictureData;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Configurable;
 import org.springframework.context.ApplicationContext;
 import org.springframework.mock.web.MockMultipartFile;
@@ -76,8 +77,9 @@ public class GetPatentPictureFromExcelThread extends Thread {
                     taskThread.updateProcess(true,2,"");
                     e.printStackTrace();
                 }
+            }
             taskThread.awakeTaskThread();
-        }
+
     }
 
     public GetPatentPictureFromExcelThread(TaskThread taskThread) {
@@ -88,7 +90,9 @@ public class GetPatentPictureFromExcelThread extends Thread {
     }
 
     public void awakeTask(UploadPatentWebDTO uploadPatentWebDTO) {
-        uploadPatentWebDTOS.add(uploadPatentWebDTO);
+        UploadPatentWebDTO uploadPatentWebDTO1 = new UploadPatentWebDTO();
+        BeanUtils.copyProperties(uploadPatentWebDTO,uploadPatentWebDTO1);
+        uploadPatentWebDTOS.add(uploadPatentWebDTO1);
         if (taskLock.tryLock()) {
             taskCondition.signalAll();
             taskLock.unlock();

+ 1 - 0
src/main/java/cn/cslg/pas/service/importPatent/ImportFromExcelToEsService.java

@@ -13,6 +13,7 @@ private TaskThread taskThread;
     public void startPatentThread() {
         taskThread.getImportTaskAMVO().setShouldSaveCounter(2);
         taskThread.getImportTaskAMVO().setHaveSaveCounter(0);
+
         GetPatentPictureFromExcelThread getPatentPictureFromExcelThread =new GetPatentPictureFromExcelThread(taskThread);
         SavePatentToEsThread savePatentToEsThread = new SavePatentToEsThread(taskThread,taskThread.getApplicationContext());
         GetPatentFromExcelThread getPatentFromExcelThread = new GetPatentFromExcelThread(taskThread, savePatentToEsThread,getPatentPictureFromExcelThread);

+ 3 - 1
src/main/java/cn/cslg/pas/service/importPatent/SavePatentToEsThread.java

@@ -126,7 +126,9 @@ public class SavePatentToEsThread extends Thread {
     }
 
     public void awakeTask(Patent patent) {
-        patents.add(patent);
+        Patent patent1 =new Patent();
+        BeanUtils.copyProperties(patent,patent1);
+        patents.add(patent1);
         if (taskLock.tryLock()) {
             taskCondition.signalAll();
             taskLock.unlock();

+ 5 - 3
src/main/java/cn/cslg/pas/service/importPatent/TaskThread.java

@@ -50,7 +50,10 @@ public class TaskThread extends Thread {
         this.importTaskAMVO = importTaskAMVO;
         //十进制转二进制
         String imContents = "0000";
-        if (!importTaskAMVO.getImportContent().equals(0)) {
+        //当任务为
+        if(importTaskAMVO.getType().equals(1))
+        {   imContents = "1100";}
+      else  if (!importTaskAMVO.getImportContent().equals(0)) {
             imContents = MathUtils.fun(2, importTaskAMVO.getImportContent());
         }
         //下载字段
@@ -63,12 +66,11 @@ public class TaskThread extends Thread {
         importTaskAMVO.setIfAddPicture(ifAddPicture);
         importTaskAMVO.setIfAddFullText(ifFullText);
         importTaskAMVO.setIfAddPDF(ifPdf);
-        importTaskAMVO.setPatentMessageShouldSaveCounter(2);
         importTaskAMVO.setHaveSaveCounter(0);
-        importTaskAMVO.setShouldSaveCounter(0);
         importTaskAMVO.setHaveSaveMessageCounter(0);
         Integer shouldSaveCount = 0;
         Integer messageShouldSaveCount = 0;
+
         if (ifAddPicture == '1') {
             shouldSaveCount += 1;
             this.patentProcess.setPictureDoneNum(0);

+ 51 - 0
src/test/java/cn/cslg/pas/service/EsQuotePatentTests.java

@@ -0,0 +1,51 @@
+package cn.cslg.pas.service;
+
+import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
+import cn.cslg.pas.common.vo.PatentWithIdVO;
+import cn.cslg.pas.domain.es.ESCustomField;
+import cn.cslg.pas.service.business.es.EsCustomFieldService;
+import cn.cslg.pas.service.business.es.EsQuotePatentService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.*;
+
+/**
+ * @Author xiexiang
+ * @Date 2023/11/16
+ */
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class EsQuotePatentTests {
+    @Autowired
+    private EsQuotePatentService esQuotePatentService;
+
+    @Test
+    public void addEsCustomField() throws Exception {
+        String patentNo = "CN201910069334.7";
+    Map<String,Object> map = esQuotePatentService.getEsQutePatentByNos(patentNo);
+    System.out.println(map);
+    }
+
+    @Test
+    public void getEsCustomField() throws Exception {
+    }
+
+    @Test
+    public void getTree() {
+        List<String> a = new ArrayList<>();
+        a.add("s");
+        a.removeAll(new ArrayList<>());
+        System.out.println(
+                a
+        );
+    }
+
+    @Test
+    public void getBackTo() throws Exception {
+        System.out.println("a");
+    }
+}