Explorar el Código

Merge remote-tracking branch 'origin/master'

xiexiang hace 1 año
padre
commit
57336c8ad6
Se han modificado 31 ficheros con 591 adiciones y 182 borrados
  1. 14 0
      src/main/java/cn/cslg/pas/common/dto/ExternalLegalInfoDTO.java
  2. 48 0
      src/main/java/cn/cslg/pas/common/dto/ExternalLegalStatusDTO.java
  3. 6 0
      src/main/java/cn/cslg/pas/common/dto/GetAllPersonDTO.java
  4. 1 1
      src/main/java/cn/cslg/pas/common/dto/ImportTaskDTO.java
  5. 5 6
      src/main/java/cn/cslg/pas/common/vo/ImportTaskAMVO.java
  6. 1 1
      src/main/java/cn/cslg/pas/common/vo/business/MergePersonAgainVO.java
  7. 3 0
      src/main/java/cn/cslg/pas/common/vo/es/EsCustomFieldBatchVO.java
  8. 16 0
      src/main/java/cn/cslg/pas/controller/AssoGroupFeatureController.java
  9. 6 0
      src/main/java/cn/cslg/pas/controller/ImportTaskController.java
  10. 17 4
      src/main/java/cn/cslg/pas/controller/InvalidStatutesController.java
  11. 21 8
      src/main/java/cn/cslg/pas/controller/PatentClaimHistoryContorller.java
  12. 7 0
      src/main/java/cn/cslg/pas/controller/PatentController.java
  13. 16 3
      src/main/java/cn/cslg/pas/controller/outApi/PatentStarController.java
  14. 2 2
      src/main/java/cn/cslg/pas/domain/business/ImportTaskCondition.java
  15. 10 4
      src/main/java/cn/cslg/pas/service/business/ImportTaskService.java
  16. 31 4
      src/main/java/cn/cslg/pas/service/business/InvalidStatutesService.java
  17. 68 36
      src/main/java/cn/cslg/pas/service/business/MergePersonService.java
  18. 43 5
      src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java
  19. 11 3
      src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java
  20. 23 1
      src/main/java/cn/cslg/pas/service/business/invalidReport/AssoGroupFeatureService.java
  21. 24 0
      src/main/java/cn/cslg/pas/service/business/invalidReport/PatentClaimHistoryService.java
  22. 27 10
      src/main/java/cn/cslg/pas/service/common/FileManagerService.java
  23. 58 9
      src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java
  24. 22 21
      src/main/java/cn/cslg/pas/service/importPatent/GetCataloguingFromWebThread.java
  25. 1 1
      src/main/java/cn/cslg/pas/service/importPatent/GetPatentFromExcelThread.java
  26. 6 2
      src/main/java/cn/cslg/pas/service/importPatent/ImportFromExcelToEsService.java
  27. 59 36
      src/main/java/cn/cslg/pas/service/importPatent/ImportFromWebToEsService.java
  28. 2 1
      src/main/java/cn/cslg/pas/service/importPatent/SchedulingTaskService.java
  29. 17 18
      src/main/java/cn/cslg/pas/service/importPatent/TaskThread.java
  30. 1 1
      src/main/resources/jsons/patent.json
  31. 25 5
      src/test/java/cn/cslg/pas/service/EventServiceTests.java

+ 14 - 0
src/main/java/cn/cslg/pas/common/dto/ExternalLegalInfoDTO.java

@@ -0,0 +1,14 @@
+package cn.cslg.pas.common.dto;
+
+import cn.cslg.pas.domain.es.LegalEvent;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ExternalLegalInfoDTO {
+
+    private List<String> legalStatus;
+
+    private List<LegalEvent> legalEvents;
+}

+ 48 - 0
src/main/java/cn/cslg/pas/common/dto/ExternalLegalStatusDTO.java

@@ -0,0 +1,48 @@
+package cn.cslg.pas.common.dto;
+
+import lombok.Data;
+
+@Data
+public class ExternalLegalStatusDTO {
+    private Long ID;
+    private String JUANQI;
+    private String PatentType;
+    private String LegalDate;
+    private String LegalStatus;
+    private String LegalStatusInfo;
+    private String LegalCode;
+    private String VOL;
+    private String NUM;
+    private String PAG;
+    private String IPC;
+    private String SHENQINGH;
+    private String SHENQINGR;
+    private String SHENQINGGBR;
+    private String SHOUQUANGGR;
+    private String WUXIAOXGJDH;
+    private String WUXIAOXGJDR;
+    private String ZHONGZHIR;
+    private String FANGQISXR;
+    private String YUANMINGC;
+    private String YUANGONGGR;
+    private String BIANGENGSXCODE;
+    private String BIANGENGSX;
+    private String BIANGENGQ;
+    private String BIANGENGH;
+    private String DENGJISXR;
+    private String HETONGBAH;
+    private String RANGYUR;
+    private String SHOURANGR;
+    private String ZHUANLIMC;
+    private String XUKEZL;
+    private String BEIANRQ;
+    private String BIANGENGR;
+    private String JIECHUR;
+    private String DENGJIH;
+    private String CHUZHIR;
+    private String ZHIQUANR;
+    private String SHOUJIANR;
+    private String WENJIANMC;
+    private String DETAIL;
+
+}

+ 6 - 0
src/main/java/cn/cslg/pas/common/dto/GetAllPersonDTO.java

@@ -1,18 +1,24 @@
 package cn.cslg.pas.common.dto;
 
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 import java.util.List;
 
 @Data
+@EqualsAndHashCode
 public class GetAllPersonDTO {
 
     private String name;
 
+    private String abbreviation;
+
     private String address;
 
     private String country;
 
+    private String province;
+
     private String remark;
 
     //类型  0 申请人  1 权利人  2 发明人

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

@@ -84,5 +84,5 @@ public class ImportTaskDTO {
     private String orderByType;
 
     private List<EsCustomFieldDTO> fieldDTOS;
-
+    private List<String> patentNos;
 }

+ 5 - 6
src/main/java/cn/cslg/pas/common/vo/ImportTaskAMVO.java

@@ -84,14 +84,13 @@ public class ImportTaskAMVO {
     private char ifAddPDF;
     private char  ifAddCatalogue;
 
-    private Integer shouldSaveCounter;
+    private Integer threadCounter;
 
-    private Integer haveSaveCounter;
+    private Integer threadDoneCounter;
 
+    private Integer messageThreadDoneCounter;
 
-    private Integer shouldSaveMessageCounter;
-    private Integer haveSaveMessageCounter;
 
-
-    private Integer patentMessageShouldSaveCounter;
+    private Integer messageThreadCounter;
+    private String patentNoStr;
 }

+ 1 - 1
src/main/java/cn/cslg/pas/common/vo/business/MergePersonAgainVO.java

@@ -9,7 +9,7 @@ public class MergePersonAgainVO {
 
     private List<String> needMergedName;
 
-    private List<String> mergeName;
+    private List<String> mergedName;
 
     private Integer projectId;
 

+ 3 - 0
src/main/java/cn/cslg/pas/common/vo/es/EsCustomFieldBatchVO.java

@@ -3,6 +3,7 @@ package cn.cslg.pas.common.vo.es;
 import cn.cslg.pas.common.dto.PatentExport.PatentExportVO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
+import cn.cslg.pas.common.model.request.OrderDTO;
 import lombok.Data;
 
 import java.util.List;
@@ -24,6 +25,8 @@ public class EsCustomFieldBatchVO {
 
     private String searchQuery;
 
+    private List<OrderDTO> orderDTOList;
+
     private List<EsCustomFieldValueDTO> customFields;
 
     private List<EsCustomFieldDTO> esCustomFieldDTOS;

+ 16 - 0
src/main/java/cn/cslg/pas/controller/AssoGroupFeatureController.java

@@ -14,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 
 /**
  * 特征Controller层
@@ -104,4 +106,18 @@ public class AssoGroupFeatureController {
         }
         return Response.success("添加成功");
     }
+
+    @Operation(summary = "取消删除特征")
+    @GetMapping("/cancelRemoveFeature")
+    public Response cancelRemoveFeature( Integer featureId ) {
+        Records records =new Records();
+        try {
+           List<Integer> ids = assoGroupFeatureService.cancelRemoveFeature(featureId);
+           records.setData(ids);
+        }
+        catch (Exception e){
+            return  Response.error(e.getMessage());
+        }
+        return Response.success(records);
+    }
 }

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

@@ -19,19 +19,25 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping(Constants.API_XiaoSHI + "/importTask")
 @RestController
 public class ImportTaskController {
+
     @Autowired
     private SystemDictService systemDictService;
+
     @Autowired
     private CommonService commonService;
+
     @Autowired
     private ScenarioService scenarioService;
+
     @Autowired
     private AssoScenarioMatterService assoScenarioMatterService;
 
     @Autowired
     private PersonFieldService personFieldService;
+
     @Autowired
     private BusinessFactory businessFactory;
+
     @Operation(summary = "查询导入任务")
     @PostMapping("/queryImportTask")
     public Response queryImportTask(@RequestBody StringRequest stringRequest) throws Exception {

+ 17 - 4
src/main/java/cn/cslg/pas/controller/InvalidStatutesController.java

@@ -11,10 +11,8 @@ import cn.cslg.pas.service.business.InvalidStatutesService;
 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 org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -28,6 +26,7 @@ import java.util.List;
 @RestController
 public class InvalidStatutesController {
     @Autowired
+
     private InvalidStatutesService invalidStatutesService;
 
     @Operation(summary = "添加无效法条")
@@ -61,4 +60,18 @@ public class InvalidStatutesController {
         }
         return Response.success("更新成功");
     }
+
+    @Operation(summary = "删除无效法条")
+    @GetMapping("/removeInvalidStatutes")
+    public Response removeInvalidStatutes(Integer id) {
+        Records records =new Records();
+        try {
+          Integer reId=  invalidStatutesService.removeInvalidStatutes(id);
+          records.setData(reId);
+        }
+        catch (Exception e){
+            return  Response.error(e.getMessage());
+        }
+        return Response.success(records);
+    }
 }

+ 21 - 8
src/main/java/cn/cslg/pas/controller/PatentClaimHistoryContorller.java

@@ -12,13 +12,13 @@ import cn.cslg.pas.service.business.invalidReport.PatentClaimHistoryService;
 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 org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 权利要求历史
+ *
  * @Author xiexiang
  * @Date 2023/12/26
  */
@@ -31,7 +31,7 @@ public class PatentClaimHistoryContorller {
 
     @Operation(summary = "修改权利要求")
     @PostMapping("/alterPatentClaim")
-    public Response alterPatentClaim(@RequestBody AlterPatentClaimDTO alterPatentClaimDTO){
+    public Response alterPatentClaim(@RequestBody AlterPatentClaimDTO alterPatentClaimDTO) {
         Integer id = patentClaimHistoryService.alterPatentClaim(alterPatentClaimDTO);
         Records records = new Records();
         records.setData(id);
@@ -40,7 +40,7 @@ public class PatentClaimHistoryContorller {
 
     @Operation(summary = "编辑权利要求历史")
     @PostMapping("/editPatentClaimHistory")
-    public Response editPatentClaimHistory(@RequestBody EditPatentClaimHistoryDTO editPatentClaimHistoryDTO){
+    public Response editPatentClaimHistory(@RequestBody EditPatentClaimHistoryDTO editPatentClaimHistoryDTO) {
         Integer id = patentClaimHistoryService.editPatentClaimHistory(editPatentClaimHistoryDTO);
         Records records = new Records();
         records.setData(id);
@@ -50,18 +50,31 @@ public class PatentClaimHistoryContorller {
 
     @Operation(summary = "删除权利要求")
     @PostMapping("/deletePatentClaim")
-    public Response deletePatentClaim(@RequestBody PatentClaimDTO patentClaimDTO){
+    public Response deletePatentClaim(@RequestBody PatentClaimDTO patentClaimDTO) {
         patentClaimHistoryService.deletePatentClaim(patentClaimDTO);
         return Response.success("");
     }
 
     @Operation(summary = "查看权利要求修改历史")
     @PostMapping("/queryPatentClaimHistory")
-    public Response queryPatentClaimHistory(@RequestBody PatentClaimDTO patentClaimDTO){
+    public Response queryPatentClaimHistory(@RequestBody PatentClaimDTO patentClaimDTO) {
         PatentClaimHistoryVO patentClaimHistoryVO = patentClaimHistoryService.queryPatentClaimHistory(patentClaimDTO);
         Records records = new Records();
         records.setData(patentClaimHistoryVO);
         return Response.success(records);
     }
 
+
+    @Operation(summary = "取消删除权要")
+    @GetMapping("/cancelRemoveClaims")
+    public Response cancelRemoveClaims(Integer claimId) {
+        Records records = new Records();
+        try {
+            List<Integer> ids = patentClaimHistoryService.cancelRemoveClaims(claimId);
+            records.setData(ids);
+        } catch (Exception e) {
+            return  Response.error(e.getMessage());
+        }
+        return Response.success(records);
+    }
 }

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

@@ -216,6 +216,13 @@ public class PatentController {
         return Response.success(allCountry);
     }
 
+    @Operation(summary = "获取国内省份列表查询")
+    @GetMapping("/getAllProvince")
+    public Response getAllProvince() {
+        List<GetAllCountryDTO> allCountry = mergePersonService.getAllProvince();
+        return Response.success(allCountry);
+    }
+
     //--------------------导出-----------------------
     @PostMapping("/exportPDFFirstPage")
     @Operation(summary = "导出专利PDF")

+ 16 - 3
src/main/java/cn/cslg/pas/controller/outApi/PatentStarController.java

@@ -1,9 +1,7 @@
 package cn.cslg.pas.controller.outApi;
 
 import cn.cslg.pas.common.core.base.Constants;
-import cn.cslg.pas.common.dto.InnerPatentPdfDTO;
-import cn.cslg.pas.common.dto.PatentColumnDTO;
-import cn.cslg.pas.common.dto.PatentStarListDTO;
+import cn.cslg.pas.common.dto.*;
 import cn.cslg.pas.common.dto.business.SelectClaimDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
@@ -21,6 +19,7 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
+import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 
@@ -141,4 +140,18 @@ public class PatentStarController {
         List<String> figures = patentStarApiService.getExternalFigure(appNo);
         return Response.success(figures);
     }
+
+    @GetMapping("/getPictureGuid")
+    @Operation(summary = "外部获取摘要附图")
+    public Response getPictureGuid(String appNo) throws IOException {
+        String pictureGuid = patentStarApiService.getPictureGuid(appNo);
+        return Response.success(pictureGuid);
+    }
+
+    @GetMapping("/getLegalStatus")
+    @Operation(summary = "外部获取法律状态")
+    public Response getLegalStatus(String appNo) throws ParseException {
+        ExternalLegalInfoDTO infoDTO = patentStarApiService.getLegalStatus(appNo);
+        return Response.success(infoDTO);
+    }
 }

+ 2 - 2
src/main/java/cn/cslg/pas/domain/business/ImportTaskCondition.java

@@ -19,8 +19,8 @@ public class ImportTaskCondition extends BaseEntity<ImportTaskCondition> {
      * 项目id
      */
     private Integer projectId;
-@TableField(exist = false)
-    private List<String> patentNos;
+    @TableField(value = "patent_nos")
+    private String patentNos;
     /**
      * 项目类型
      * 0专题库 1报告

+ 10 - 4
src/main/java/cn/cslg/pas/service/business/ImportTaskService.java

@@ -82,7 +82,6 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
         List<String> sqls = formatQueryService.reSqls(queryRequest, "importTask");
         //根据sql查询事件信息
         List<ImportTaskVO> importTaskVOS = importTaskMapper.getImportTask(sqls.get(0), sqls.get(1), sqls.get(2));
-
         //查询总数
         Long total = importTaskMapper.getImportTaskCount(sqls.get(0));
 
@@ -135,7 +134,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
         if (importTaskDTO.getType() == null) {
             importTaskDTO.setType(4);
         }
-
+ List<String> addPatentNos =importTaskDTO.getPatentNos();
         ImportTaskCondition importTaskCondition = new ImportTaskCondition();
         if (importTaskDTO.getImportToId() != null) {
             if (importTaskDTO.getImportToType().equals(0)) {
@@ -162,7 +161,10 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
         importTaskCondition.setOrderBy(importTaskDTO.getOrderBy());
         importTaskCondition.setOrderByType(importTaskDTO.getOrderByType());
         importTaskCondition.setCreateId(personnelVO.getId());
-
+        if (importTaskDTO.getPatentNos() != null && importTaskDTO.getPatentNos().size() > 0) {
+            String jsons = JSONObject.toJSON(importTaskDTO.getPatentNos()).toString();
+            importTaskCondition.setPatentNos(jsons);
+        }
         String fieldJson = JsonUtils.objectToJson(importTaskCondition);
         importTaskCondition.setCustomFields(fieldJson);
         importTaskCondition.insert();
@@ -197,7 +199,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
                 throw new XiaoShiException("文件错误");
             }
         } else if (importTaskCondition.getType().equals(4)) {
-            try {
+            try {if(addPatentNos==null||addPatentNos.size()==0) {
                 PatentStarListDTO patentStarListDto = new PatentStarListDTO()
                         .setCurrentQuery(importTaskCondition.getSearchCondition())
                         .setOrderBy(importTaskCondition.getOrderBy())
@@ -213,6 +215,10 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
                 } else {
                     importTask.setAllNum((Integer) resultMap.get("total"));
                 }
+            }
+            else {
+                importTask.setAllNum(addPatentNos.size());
+            }
             } catch (Exception e) {
                 throw new XiaoShiException("文件错误");
             }

+ 31 - 4
src/main/java/cn/cslg/pas/service/business/InvalidStatutesService.java

@@ -5,10 +5,7 @@ import cn.cslg.pas.common.dto.business.InvalidStatutesDTO;
 import cn.cslg.pas.common.dto.invalidDTO.UpdateMessageDTO;
 import cn.cslg.pas.common.utils.GenerateObjectUtil;
 import cn.cslg.pas.common.vo.invalidVO.InvalidStatutesVO;
-import cn.cslg.pas.domain.business.AssoGroupFeature;
-import cn.cslg.pas.domain.business.InvalidStatutes;
-import cn.cslg.pas.domain.business.PatentClaim;
-import cn.cslg.pas.domain.business.SystemDict;
+import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.InvalidStatutesMapper;
 import cn.cslg.pas.service.business.invalidReport.PatentClaimService;
@@ -17,7 +14,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.ArrayList;
@@ -38,6 +37,9 @@ public class InvalidStatutesService extends ServiceImpl<InvalidStatutesMapper, I
 
     @Autowired
     private PatentClaimService patentClaimService;
+    @Autowired
+    @Lazy
+    private ProofGroupService proofGroupService;
 
     /**
      * 添加无效法条
@@ -210,4 +212,29 @@ public class InvalidStatutesService extends ServiceImpl<InvalidStatutesMapper, I
         }
         return true;
     }
+
+    /**
+     *
+     * @param id
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public Integer removeInvalidStatutes(Integer id){
+        if(id==null){
+            throw new XiaoShiException("请输入无效法条");
+        }
+        InvalidStatutes invalidStatutes =this.getById(id);
+        if(invalidStatutes==null){
+            throw new XiaoShiException("无效法条不存在");
+        }
+    //根据无效法条id 查询是否有证据组合
+        LambdaQueryWrapper<ProofGroup> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.eq(ProofGroup::getInvalidStatutesId,id);
+        List<ProofGroup> proofGroups =proofGroupService.list(queryWrapper);
+          if(proofGroups.size()>0){
+              throw new XiaoShiException("请先删除该法条的证据组合");
+          }
+          this.removeById(id);
+          return id;
+    }
 }

+ 68 - 36
src/main/java/cn/cslg/pas/service/business/MergePersonService.java

@@ -184,7 +184,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
     public Integer mergePersonAgain(MergePersonAgainVO vo) throws Exception {
         List<String> mergedNames = vo.getNeedMergedName();
-        List<String> mergeName = vo.getMergeName();
+        List<String> mergeName = vo.getMergedName();
         List<String> nameList = new ArrayList<>();
         if (!CollectionUtils.isEmpty(mergedNames)) {
             for (String mergedName : mergedNames) {
@@ -427,7 +427,6 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
         List<GetEsAllPersonDTO> personDTOS = new ArrayList<>();
         for (Hit<Patent> hit : hits) {
             Patent esMess = hit.source();
-            PersonAddress applicantAddr = null;
             GetEsAllPersonDTO personDTO = new GetEsAllPersonDTO();
             personDTO.setApplicantAddr(esMess.getApplicantAddr());
             personDTO.setRightHolderAddr(esMess.getRightHolderAddr());
@@ -480,7 +479,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
                     for (String s : rightHolder) {
                         GetAllPersonDTO dto = new GetAllPersonDTO();
                         dto.setName(s);
-                        dto.setType(0);
+                        dto.setType(1);
                         if (StringUtils.isNotEmpty(rightHolderAddr.getCountry())) {
                             dto.setCountry(rightHolderAddr.getCountry());
                         }
@@ -494,7 +493,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
                     for (String s : rightHolder) {
                         GetAllPersonDTO dto = new GetAllPersonDTO();
                         dto.setName(s);
-                        dto.setType(0);
+                        dto.setType(1);
                         rightDTOS.add(dto);
                     }
                 }
@@ -504,13 +503,19 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
         //申请人和权利人相同的去除
         if (!CollectionUtils.isEmpty(applicantDTOS) && !CollectionUtils.isEmpty(rightDTOS)) {
             for (GetAllPersonDTO applicantDTO : applicantDTOS) {
-                rightDTOS.removeIf(rightDTO -> applicantDTO.getName().equals(rightDTO.getName()));
+                rightDTOS.removeIf(rightDTO -> rightDTO.getName().equals(applicantDTO.getName()));
             }
         }
         //装载在同一个集合
         personDTOList.addAll(applicantDTOS);
         personDTOList.addAll(rightDTOS);
 
+        if (!CollectionUtils.isEmpty(personDTOList)) {
+            Set<GetAllPersonDTO> set = new TreeSet<>(Comparator.comparing(GetAllPersonDTO::getName));
+            set.addAll(personDTOList);
+            personDTOList = new ArrayList<>(set);
+        }
+
         //发明人
         List<GetAllPersonDTO> inventorDTOS = new ArrayList<>();
         if (!CollectionUtils.isEmpty(personDTOS)) {
@@ -529,6 +534,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
 //        IPage<MergePerson> page = new Page<>(vo.getPageNum(), vo.getPageSize());
         LambdaQueryWrapper<MergePerson> wrapper = new LambdaQueryWrapper<MergePerson>()
                 .eq(MergePerson::getProjectId, vo.getProjectId())
+                .eq(MergePerson::getType, type)
                 .eq(StringUtils.isNotEmpty(vo.getName()), MergePerson::getName, vo.getName())
                 .orderByDesc(MergePerson::getCreateTime);
 //        IPage<MergePerson> record = mergePersonMapper.selectPage(page, wrapper);
@@ -550,6 +556,8 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
                 merge.setRemark(person.getRemark());
                 merge.setType(personType);
                 merge.setMergeId(person.getId());
+                merge.setAbbreviation(person.getAbbreviation());
+                merge.setProvince(person.getProvince());
                 mergeList.add(merge);
 
                 if (personType == 0) {
@@ -621,7 +629,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
         String name = vo.getName();
         Integer projectId = vo.getProjectId();
         MergePerson mergePerson = mergePersonMapper.selectOne(new LambdaQueryWrapper<MergePerson>()
-                .eq(MergePerson::getMergedName, name)
+                .eq(MergePerson::getName, name)
                 .eq(MergePerson::getProjectId, projectId));
         if (ObjectUtil.isNotEmpty(mergePerson)) {
             Integer personId = mergePerson.getId();
@@ -682,42 +690,46 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
     public Integer delMergePerson(MergePersonIdVO vo) throws IOException {
         Integer type = vo.getType();
         MergePerson mergePerson = mergePersonMapper.selectById(vo.getId());
-        String name = mergePerson.getName();
         if (ObjectUtil.isNotEmpty(mergePerson)) {
             LambdaQueryWrapper<MergePerson> wrapper = new LambdaQueryWrapper<MergePerson>()
                     .eq(BaseEntity::getId, vo.getId());
             this.remove(wrapper);
 
-            SearchRequest.Builder builder = new SearchRequest.Builder();
-            //设置查询索引
-            builder.index("patent");
-            List<Query> queries = new ArrayList<>();
-            if (type == 0) {
-                Query q1 = QueryBuilders.term(i -> i.field("merge_applicant.name.raw").value(name));
-                Query query1 = QueryBuilders.nested(i -> i.path("merge_applicant").query(q1));
-                Query q2 = QueryBuilders.term(i -> i.field("merge_right_holder.name.raw").value(name));
-                Query query2 = QueryBuilders.nested(i -> i.path("merge_right_holder").query(q2));
-                queries.add(query1);
-                queries.add(query2);
-            } else {
-                Query q = QueryBuilders.term(i -> i.field("merge_inventor.name.raw").value(name));
-                Query query3 = QueryBuilders.nested(i -> i.path("merge_inventor").query(q));
-                queries.add(query3);
-            }
-            Query query = QueryBuilders.bool(i -> i.must(queries));
-            builder.query(query);
-            SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
-            List<Hit<Patent>> hits = response.hits().hits();
-            Map<String, Patent> map = new HashMap<>();
-            for (Hit<Patent> hit : hits) {
-                String id = hit.id();
-                map.put(id, hit.source());
-            }
+            String name = mergePerson.getName();
+            String mergedName = mergePerson.getMergedName();
+            List<String> list = JSONArray.parseArray(mergedName, String.class);
+            if (!CollectionUtils.isEmpty(list)) {
+                SearchRequest.Builder builder = new SearchRequest.Builder();
+                //设置查询索引
+                builder.index("patent");
+                List<Query> queries = new ArrayList<>();
+                if (type == 0) {
+                    Query q1 = QueryBuilders.term(i -> i.field("merge_applicant.name.raw").value(name));
+                    Query query1 = QueryBuilders.nested(i -> i.path("merge_applicant").query(q1));
+                    Query q2 = QueryBuilders.term(i -> i.field("merge_right_holder.name.raw").value(name));
+                    Query query2 = QueryBuilders.nested(i -> i.path("merge_right_holder").query(q2));
+                    queries.add(query1);
+                    queries.add(query2);
+                } else {
+                    Query q = QueryBuilders.term(i -> i.field("merge_inventor.name.raw").value(name));
+                    Query query3 = QueryBuilders.nested(i -> i.path("merge_inventor").query(q));
+                    queries.add(query3);
+                }
+                Query query = QueryBuilders.bool(i -> i.must(queries));
+                builder.query(query);
+                SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
+                List<Hit<Patent>> hits = response.hits().hits();
+                Map<String, Patent> map = new HashMap<>();
+                for (Hit<Patent> hit : hits) {
+                    String id = hit.id();
+                    map.put(id, hit.source());
+                }
 
-            if (!CollectionUtils.isEmpty(map)) {
-                for (String id : map.keySet()) {
-                    Patent patent = map.get(id);
-                    esService.delMergePerson(patent, id, type, mergePerson.getName());
+                if (!CollectionUtils.isEmpty(map)) {
+                    for (String id : map.keySet()) {
+                        Patent patent = map.get(id);
+                        esService.delMergePerson(patent, id, type, mergePerson.getName());
+                    }
                 }
             }
         }
@@ -743,4 +755,24 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
         }
         return list;
     }
+
+    /**
+     * 获取国内省份列表查询
+     * @return
+     */
+    public List<GetAllCountryDTO> getAllProvince() {
+        List<GetAllCountryDTO> list = new ArrayList<>();
+        List<SystemDict> countries = systemDictMapper.selectList(new LambdaQueryWrapper<SystemDict>()
+                .eq(SystemDict::getType, "PROVINCE"));
+        if (!CollectionUtils.isEmpty(countries)) {
+            countries.forEach(county -> {
+                GetAllCountryDTO dto = new GetAllCountryDTO();
+                dto.setLabel(county.getLabel());
+                dto.setValue(county.getValue());
+                dto.setType(county.getType());
+                list.add(dto);
+            });
+        }
+        return list;
+    }
 }

+ 43 - 5
src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java

@@ -1,13 +1,16 @@
 package cn.cslg.pas.service.business.es;
 
+import cn.cslg.pas.common.core.base.IfConstant;
 import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
 import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
 import cn.cslg.pas.common.dto.es.FieldHistoryDTO;
 import cn.cslg.pas.common.dto.es.QueryEsCustomFieldDTO;
+import cn.cslg.pas.common.model.request.OrderDTO;
 import cn.cslg.pas.common.utils.FormatUtil;
 import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
 import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
 import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
+import cn.cslg.pas.common.vo.EsConfigVO;
 import cn.cslg.pas.common.vo.PatentWithIdVO;
 import cn.cslg.pas.common.vo.es.EsCustomFieldBatchVO;
 import cn.cslg.pas.common.vo.es.FieldHistoryVO;
@@ -16,6 +19,7 @@ import cn.cslg.pas.domain.business.CustomField;
 import cn.cslg.pas.domain.business.TreeNode;
 import cn.cslg.pas.domain.es.*;
 import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.CommonService;
 import cn.cslg.pas.service.business.TreeNodeService;
 import cn.cslg.pas.service.query.FormatQueryService;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
@@ -30,6 +34,7 @@ import co.elastic.clients.elasticsearch.core.SearchRequest;
 import co.elastic.clients.elasticsearch.core.SearchResponse;
 import co.elastic.clients.elasticsearch.core.search.Hit;
 import co.elastic.clients.json.JsonData;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.Value;
@@ -314,8 +319,14 @@ public class EsCustomFieldService {
         Integer projectId = vo.getProjectId();
         Integer startNum = vo.getStartNumber();
         Integer endNum = vo.getEndNumber();
-        List<String> isAdd = vo.getIsAdd();
-        List<String> isDel = vo.getIsDelete();
+        List<String> isAdd = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(vo.getIsAdd())) {
+            isAdd = vo.getIsAdd();
+        }
+        List<String> isDel = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(vo.getIsDelete())) {
+            isDel = vo.getIsDelete();
+        }
         String searchCondition = "";
         if (StringUtils.isNotEmpty(vo.getSearchQuery())) {
             searchCondition = vo.getSearchQuery();
@@ -348,9 +359,36 @@ public class EsCustomFieldService {
         //3. 从es中检索数据
         Query q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent");
         builder.query(q);
-        if (startNum > 0 && endNum > 0) {
-            builder.from(startNum-1).size(endNum);
+
+        List<OrderDTO> dtoList = vo.getOrderDTOList();
+        if (!CollectionUtils.isEmpty(dtoList)) {
+            String json = CommonService.readJsonFile("patent.json");
+            List<EsConfigVO> esConfigVOS = JSON.parseArray(json, EsConfigVO.class);
+            for (OrderDTO orderDTO : dtoList) {
+                EsConfigVO configVO = esConfigVOS.stream().filter(item -> item.getField().equals(orderDTO.getOrderBy())).findFirst().orElse(null);
+                if (configVO != null) {
+                    if (orderDTO.getOrderType().equals(IfConstant.NO)) {
+                        builder.sort(sortOptionsBuilder -> sortOptionsBuilder
+                                .field(fieldSortBuilder -> fieldSortBuilder
+                                        .field(configVO.getEsField()).order(SortOrder.Asc)));
+                    } else {
+                        builder.sort(sortOptionsBuilder -> sortOptionsBuilder
+                                .field(fieldSortBuilder -> fieldSortBuilder
+                                        .field(configVO.getEsField()).order(SortOrder.Desc)));
+                    }
+                }
+            }
+        } else {
+            builder.sort(sortOptionsBuilder -> sortOptionsBuilder
+                    .field(fieldSortBuilder -> fieldSortBuilder
+                            .field("patent_no.keyword").order(SortOrder.Desc)));
         }
+
+        int number = endNum - startNum;
+        if (startNum > 0 && endNum > startNum) {
+            builder.from(startNum-1).size(number);
+        }
+
         SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> patentNos = new ArrayList<>();
@@ -360,7 +398,7 @@ public class EsCustomFieldService {
         }
         patentNos.addAll(isAdd);
         patentNos.removeAll(isDel);
-        return patentNos.stream().distinct().collect(Collectors.toList());
+        return patentNos.stream().collect(Collectors.toList());
     }
 
 

+ 11 - 3
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -21,6 +21,7 @@ import cn.cslg.pas.common.vo.business.PatentKinVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.domain.es.*;
 import cn.cslg.pas.service.business.CommonService;
+import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.query.FormatQueryService;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
 import co.elastic.clients.elasticsearch._types.SortOrder;
@@ -34,6 +35,7 @@ import co.elastic.clients.elasticsearch.core.search.SourceConfigBuilders;
 import co.elastic.clients.elasticsearch.transform.Source;
 import com.alibaba.druid.sql.visitor.functions.If;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
@@ -56,6 +58,9 @@ public class EsPatentService {
     private final ElasticsearchClient client;
     private final FormatQueryService formatQueryService;
 
+    @Autowired
+    private FileManagerService fileManagerService;
+
     /**
      * 根据专利号查询专利详情
      *
@@ -176,10 +181,13 @@ public class EsPatentService {
      * @param appNo
      * @return
      */
-    public List<String> getFigure(String appNo) {
+    public List<String> getFigure(String appNo) throws IOException {
         List<String> list = new ArrayList<>();
-        String pictureFormat = FormatUtil.getPictureFormat(appNo);
-        list.add(pictureFormat);
+        String guids = fileManagerService.getPatentPictureGuids(appNo);
+        if (StringUtils.isNotEmpty(guids)) {
+            JSONObject jsonObject = JSONObject.parseObject(guids);
+            list = JSONArray.parseArray(jsonObject.get("data").toString(), String.class);
+        }
         return list;
     }
 

+ 23 - 1
src/main/java/cn/cslg/pas/service/business/invalidReport/AssoGroupFeatureService.java

@@ -428,7 +428,7 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
         //根据权要id 查询 无效法条
         LambdaQueryWrapper<InvalidStatutes> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(InvalidStatutes::getClaimId, claimId)
-                .and(wrapper->wrapper.eq(InvalidStatutes::getStatutesId, 2).or().eq(InvalidStatutes::getStatutesId,3));
+                .and(wrapper -> wrapper.eq(InvalidStatutes::getStatutesId, 2).or().eq(InvalidStatutes::getStatutesId, 3));
         List<InvalidStatutes> invalidStatutes = invalidStatutesService.list(queryWrapper);
         if (invalidStatutes != null && invalidStatutes.size() != 0) {
             List<Integer> statutesIds = invalidStatutes.stream().map(InvalidStatutes::getId).collect(Collectors.toList());
@@ -463,4 +463,26 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
         }
         return true;
     }
+
+    /**
+     * 取消删除特征
+     * @param featureId
+     * @return
+     */
+    public List<Integer> cancelRemoveFeature(Integer featureId) {
+        List<Integer> ids =new ArrayList<>();
+        if(featureId==null){
+            throw  new XiaoShiException("请输入");
+        }
+        //根据特征id查询特征和证据组合关联
+        LambdaQueryWrapper<AssoGroupFeature> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.eq(AssoGroupFeature::getFeatureId,featureId)
+                     .eq(AssoGroupFeature::getOperateMode,1);
+         List<AssoGroupFeature> assoGroupFeatures =this.list(queryWrapper);
+         if(assoGroupFeatures.size()>0) {
+           ids = assoGroupFeatures.stream().map(AssoGroupFeature::getId).collect(Collectors.toList());
+           this.removeByIds(ids);
+         }
+        return ids;
+    }
 }

+ 24 - 0
src/main/java/cn/cslg/pas/service/business/invalidReport/PatentClaimHistoryService.java

@@ -8,6 +8,7 @@ import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.vo.invalidVO.PatentClaimHistoryVO;
 import cn.cslg.pas.common.vo.invalidVO.QueryPatentClaimHistoryVO;
+import cn.cslg.pas.domain.business.AssoGroupFeature;
 import cn.cslg.pas.domain.business.PatentClaim;
 import cn.cslg.pas.domain.business.PatentClaimHistory;
 import cn.cslg.pas.exception.UnLoginException;
@@ -391,4 +392,27 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
         List<PatentClaim> patentClaims = patentClaimService.list(queryWrapper1);
         return patentClaims;
     }
+
+    /**
+     * 取消删除权要
+     * lrj
+     * @return
+     */
+    public List<Integer> cancelRemoveClaims(Integer claimId){
+        List<Integer> ids =new ArrayList<>();
+        if(claimId==null){
+            throw  new XiaoShiException("请输入权要");
+        }
+        //根据特征id查询特征和证据组合关联
+        LambdaQueryWrapper<PatentClaimHistory> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.eq(PatentClaimHistory::getClaimId,claimId)
+                .eq(PatentClaimHistory::getOperateType,1);
+        List<PatentClaimHistory> patentClaimHistories =this.list(queryWrapper);
+        if(patentClaimHistories.size()>0) {
+            ids = patentClaimHistories.stream().map(PatentClaimHistory::getId).collect(Collectors.toList());
+            this.removeByIds(ids);
+        }
+        return ids;
+
+    }
 }

+ 27 - 10
src/main/java/cn/cslg/pas/service/common/FileManagerService.java

@@ -78,7 +78,7 @@ public class FileManagerService {
     }
 
     public List<String> uploadFileGetGuid(List<MultipartFile> multipartFiles) throws IOException {
-   String res= this.uploadFile(multipartFiles);
+        String res = this.uploadFile(multipartFiles);
         JSONObject jsonObject = JSONObject.parseObject(res);
         List<String> guids = JSONArray.parseArray(jsonObject.get("data").toString(), String.class);
         return guids;
@@ -145,15 +145,15 @@ public class FileManagerService {
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
 
-    public String uploadFileWithGuid(File file ,String guid)  throws IOException {
+    public String uploadFileWithGuid(File file, String guid) throws IOException {
         MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder()
                 .setType(MultipartBody.FORM);
-            //根据文件名获取文件的MIME类型
-            String mimeType = getMimeType(file.getPath());
-            multipartBodyBuilder.addFormDataPart("file", file.getName(), RequestBody.create(MediaType.parse(mimeType), file));
+        //根据文件名获取文件的MIME类型
+        String mimeType = getMimeType(file.getPath());
+        multipartBodyBuilder.addFormDataPart("file", file.getName(), RequestBody.create(MediaType.parse(mimeType), file));
         RequestBody requestBody = multipartBodyBuilder
                 .addFormDataPart("sourceId", String.valueOf(FileSource))
-                .addFormDataPart("fileGuid",guid)
+                .addFormDataPart("fileGuid", guid)
                 .build();
         OkHttpClient okHttpClient = new OkHttpClient.Builder()
                 .connectTimeout(60, TimeUnit.SECONDS)
@@ -167,15 +167,13 @@ public class FileManagerService {
         Response response = null;
         response = okHttpClient.newCall(request).execute();
         // 最后记得删除临时文件
-            FileUtils.deleteQuietly(file);
+        FileUtils.deleteQuietly(file);
 
         return Objects.requireNonNull(response.body()).string();
     }
 
     /**
      * 调用文件系统上传文件接口
-     *
-
      */
     public String uploadFile2(List<File> files) throws IOException {
 
@@ -206,10 +204,29 @@ public class FileManagerService {
         }
         return Objects.requireNonNull(response.body()).string();
     }
+
     public List<String> uploadFileGetGuid2(List<File> files) throws IOException {
-        String res= this.uploadFile2(files);
+        String res = this.uploadFile2(files);
         JSONObject jsonObject = JSONObject.parseObject(res);
         List<String> guids = JSONArray.parseArray(jsonObject.get("data").toString(), String.class);
         return guids;
     }
+
+    /**
+     * 调用文件系统获得专利图片的guid
+     *
+     * @param appNo 申请号
+     */
+    public String getPatentPictureGuids(String appNo) throws IOException {
+        OkHttpClient okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(60, TimeUnit.SECONDS)
+                .writeTimeout(60, TimeUnit.SECONDS)
+                .readTimeout(60, TimeUnit.SECONDS)
+                .build();
+        Request request = new Request.Builder()
+                .url(FMSUrl + "/fileManager/getPatentPictureGuids?appNo=" + appNo)
+                .get()
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    }
 }

+ 58 - 9
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -15,10 +15,7 @@ import cn.cslg.pas.common.vo.StarPatentVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.domain.WebLoginConfig;
 import cn.cslg.pas.domain.business.RetrieveRecord;
-import cn.cslg.pas.domain.es.PatentClassify;
-import cn.cslg.pas.domain.es.PatentPerson;
-import cn.cslg.pas.domain.es.PersonAddress;
-import cn.cslg.pas.domain.es.Text;
+import cn.cslg.pas.domain.es.*;
 import cn.cslg.pas.service.WebLoginConfigService;
 
 import cn.cslg.pas.service.importPatent.ImportFromWebToEsService;
@@ -50,10 +47,13 @@ import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * 调用外部接口的Service类 PCS:权限系统
@@ -871,13 +871,13 @@ public class PatentStarApiService {
             }
             patentColumnDTO.setIpc(classifies);
             //获取摘要附图
-            String pictureApi = this.getPictureApi(item.getRowApplicationNo());
-            patentColumnDTO.setPictureGuid(pictureApi);
+//            String pictureApi = this.getPictureApi(item.getRowApplicationNo());
+//            patentColumnDTO.setPictureGuid(pictureApi);
             //获取外部专利原始申请号
             patentColumnDTO.setRowApplicationNo(item.getRowApplicationNo());
             //获取法律状态
-            String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
-            patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
+//            String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
+//            patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
             //获取被引用次数
             //装载公开日
             if (item.getPublicDate() != null && !item.getPublicDate().trim().equals("")) {
@@ -985,9 +985,14 @@ public class PatentStarApiService {
     public Records queryExternalFamily(QueryExternalFamilyVO vo) throws IOException {
         Records records = new Records();
         String family = this.getFamilyByPubNoApi(vo.getPatentNo());
+
         QueryExternalFamilyDTO familyDTO = JSONObject.parseObject(family, QueryExternalFamilyDTO.class);
         String familyInfos = familyDTO.getFamilyinfo();
-        List<String> publicNos = Arrays.asList(familyInfos.split(";"));
+        List<String> publicNos = new ArrayList<>();
+        if (StringUtils.isNotEmpty(familyInfos) && familyInfos.equals("{}")) {
+            publicNos = Arrays.asList(familyInfos.split(";"));
+        }
+
         String pubNo = "";
         if (!CollectionUtils.isEmpty(publicNos)) {
             int count = publicNos.size() - 1;
@@ -1137,4 +1142,48 @@ public class PatentStarApiService {
         return list;
     }
 
+    /**
+     * 获取摘要附图
+     * @param appNo
+     * @return
+     */
+    public String getPictureGuid(String appNo) {
+        return this.getPictureApi(appNo);
+    }
+
+    /**
+     * @param appNo
+     * @return
+     */
+    public ExternalLegalInfoDTO getLegalStatus(String appNo) throws ParseException {
+        ExternalLegalInfoDTO infoDTO = new ExternalLegalInfoDTO();
+        List<String> list = new ArrayList<>();
+        List<LegalEvent> legalEvents = new ArrayList<>();
+        String cnLegalApi = this.getCnLegalApi(appNo);
+        if (StringUtils.isNotEmpty(cnLegalApi)) {
+            List<ExternalLegalStatusDTO> statusDTOS = JSONArray.parseArray(cnLegalApi, ExternalLegalStatusDTO.class);
+            if (!CollectionUtils.isEmpty(statusDTOS)) {
+                List<ExternalLegalStatusDTO> statusList = statusDTOS.stream().sorted(Comparator.comparing(ExternalLegalStatusDTO::getLegalDate).reversed()).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(statusList)) {
+                    ExternalLegalStatusDTO statusDTO = statusList.get(0);
+                    list.add(statusDTO.getLegalStatus());
+                }
+                for (ExternalLegalStatusDTO dto : statusDTOS) {
+                    LegalEvent event = new LegalEvent();
+                    event.setCode(dto.getLegalCode());
+                    event.setName(dto.getLegalStatusInfo());
+                    event.setDescription(dto.getJUANQI());
+                    if (StringUtils.isNotEmpty(dto.getLegalDate())) {
+                        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
+                        Date date = format.parse(dto.getLegalDate());
+                        event.setEventDate(date);
+                    }
+                    legalEvents.add(event);
+                }
+            }
+        }
+        infoDTO.setLegalStatus(list);
+        infoDTO.setLegalEvents(legalEvents);
+        return infoDTO;
+    }
 }

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

@@ -75,7 +75,7 @@ public class GetCataloguingFromWebThread extends Thread {
                     if (starPatentVO.getApplicationNo().startsWith("CN")) {
                         this.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent(), starPatentVO);
 
-                         //装载专利号
+                        //装载专利号
                         if (uploadPatentWebDTO.getPatent().getAppNo() != null) {
                             uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getAppNo());
                         } else if (uploadPatentWebDTO.getPatent().getGrantNo() != null) {
@@ -100,28 +100,30 @@ public class GetCataloguingFromWebThread extends Thread {
 
 //                添加同族专利
                 String familyPatentNoStr = patentStarApiService.getFamilyByPubNoApi(uploadPatentWebDTO.getPatent().getPublicNo());
+                List<String> familyPatentNos = new ArrayList<>();
                 if (!familyPatentNoStr.equals("no data")) {
                     FamilyPatentNo familyPatentNo = JSON.parseObject(familyPatentNoStr, FamilyPatentNo.class);
-                    List<String> familyPatentNos = new ArrayList<>();
                     if (familyPatentNo != null && familyPatentNo.getFamilyinfo() != null) {
                         familyPatentNos = Arrays.asList(familyPatentNo.getFamilyinfo().split(";"));
                     }
-                    if (familyPatentNos.size() != 0) {
-                        EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(familyPatentNos, "inpadoc");
-                        uploadPatentWebDTO.getPatent().setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
-                        uploadPatentWebDTO.getPatent().setInpadocFamilyId(esPatentFamilyDTO.getPatentFamilyId());
-                    }
                 }
-//
-//                //添加法律事务
-//                esService.addEsLegalEvent(uploadPatentWebDTO.getStarPatentVO().getPublicNo());
-
-//                //添加引用专利
-//                String nos = starPatentVO.getQuoteNos();
-//                if (nos != null) {
-//                    List<String> quotedNos = this.reQuotedNos(nos);
-//                    esService.addEsQuotePatent(uploadPatentWebDTO.getPatent().getPublicNo(), quotedNos);
-//                }
+                familyPatentNos.add(uploadPatentWebDTO.getPatent().getAppNo());
+
+                if (familyPatentNos.size() != 0) {
+                    EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(familyPatentNos, "inpadoc");
+                    uploadPatentWebDTO.getPatent().setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
+                    uploadPatentWebDTO.getPatent().setInpadocFamilyId(esPatentFamilyDTO.getPatentFamilyId());
+                }
+
+                //添加法律事务
+                esService.addEsLegalEvent(uploadPatentWebDTO.getStarPatentVO().getPublicNo());
+
+                //添加引用专利
+                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) {
@@ -300,8 +302,7 @@ public class GetCataloguingFromWebThread extends Thread {
                 patentPeople.add(patentPerson);
             }
             patent.setRightHolder(patentPeople);
-        }
-        else if(patent.getApplicant()!=null){
+        } else if (patent.getApplicant() != null) {
             patent.setRightHolder(patent.getApplicant());
         }
 
@@ -335,7 +336,7 @@ public class GetCataloguingFromWebThread extends Thread {
 
         //装载受理局
         if (starPatentVO.getBureau() != null && !starPatentVO.getBureau().equals("")) {
-            patent.setAppCountry(starPatentVO.getBureau());
+            patent.setAppCountry(starPatentVO.getBureau().substring(0, starPatentVO.getBureau().indexOf("(")));
         }
     }
 
@@ -457,7 +458,7 @@ public class GetCataloguingFromWebThread extends Thread {
                 patentPeople.add(patentPerson);
             }
             patent.setApplicant(patentPeople);
-            if(patent.getRightHolder()==null||patent.getRightHolder().size()==0){
+            if (patent.getRightHolder() == null || patent.getRightHolder().size() == 0) {
                 patent.setRightHolder(patent.getApplicant());
             }
         }

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

@@ -75,7 +75,7 @@ public class GetPatentFromExcelThread extends Thread {
 
                 UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                 uploadPatentWebDTO.setHaveSaveCounter(0);
-                uploadPatentWebDTO.setTotalCounter(importTaskAMVO.getShouldSaveCounter());
+                uploadPatentWebDTO.setTotalCounter(importTaskAMVO.getThreadCounter());
                 uploadPatentWebDTO.setPictureData(uploadParamsVO.getPictureData());
                 uploadPatentWebDTO.setPatent(uploadParamsVO.getPatent());
                 //专利丢入消费者队列,并唤醒消费者线程

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

@@ -9,14 +9,18 @@ import org.springframework.stereotype.Service;
 @Service
 public class ImportFromExcelToEsService implements PatentImportImp {
 private TaskThread taskThread;
+
     @Override
     public void startPatentThread() {
-        taskThread.getImportTaskAMVO().setShouldSaveCounter(2);
-        taskThread.getImportTaskAMVO().setHaveSaveCounter(0);
+
+        taskThread.getImportTaskAMVO().setThreadCounter(2);
+        taskThread.getImportTaskAMVO().setThreadDoneCounter(0);
 
         GetPatentPictureFromExcelThread getPatentPictureFromExcelThread =new GetPatentPictureFromExcelThread(taskThread);
         SavePatentToEsThread savePatentToEsThread = new SavePatentToEsThread(taskThread,taskThread.getApplicationContext());
+
         GetPatentFromExcelThread getPatentFromExcelThread = new GetPatentFromExcelThread(taskThread, savePatentToEsThread,getPatentPictureFromExcelThread);
+
         savePatentToEsThread.start();
         getPatentFromExcelThread.start();
         getPatentPictureFromExcelThread.start();

+ 59 - 36
src/main/java/cn/cslg/pas/service/importPatent/ImportFromWebToEsService.java

@@ -91,7 +91,12 @@ public class ImportFromWebToEsService implements PatentImportImp {
             String orderBy = importTaskAMVO.getOrderBy();  //排序字段
             String orderByType = importTaskAMVO.getOrderByType();  //排序类型
             String dbType = importTaskAMVO.getDbType();  //检索数据库类型
-            Integer doneNum = importTaskAMVO.getDoneNum();
+            Integer taskStartNum = importTaskAMVO.getDoneNum();
+            List<String> addPatentNos = new ArrayList<>();
+            String patentNoStr =importTaskAMVO.getPatentNoStr();
+            if(patentNoStr!=null){
+                addPatentNos = JSONArray.parseArray(patentNoStr);
+            }
             int patentNum = 10000;
 
             //检索式
@@ -101,14 +106,24 @@ public class ImportFromWebToEsService implements PatentImportImp {
 
             //获得返回的的多个检索式 patentStarListDtos
             if (importTaskAMVO.getType().equals(4)) {
-                patentStarListDtos = patentStarApiService.getSplitedConditions(new PatentStarListDTO()
-                        .setCurrentQuery(conditions)
-                        .setOrderBy(orderBy)
-                        .setOrderByType(orderByType)
-                        .setDBType(dbType), patentNum);
+                if (addPatentNos != null && addPatentNos.size() != 0) {
+                    PatentStarListDTO patentStarListDTO = new PatentStarListDTO();
+                    patentStarListDTO.setCurrentQuery(conditions)
+                            .setOrderBy(orderBy)
+                            .setOrderByType(orderByType)
+                            .setDBType(dbType);
+                    patentStarListDtos = patentStarApiService.splitPatentNoByType(addPatentNos, patentStarListDTO);
+                } else {
+                    patentStarListDtos = patentStarApiService.getSplitedConditions(new PatentStarListDTO()
+                            .setCurrentQuery(conditions)
+                            .setOrderBy(orderBy)
+                            .setOrderByType(orderByType)
+                            .setDBType(dbType), patentNum);
+                }
             }
+
             //当专利为专利号导入时
-            if (importTaskAMVO.getType().equals(2)) {
+            else if (importTaskAMVO.getType().equals(2)) {
                 PatentStarListDTO patentStarListDTO = new PatentStarListDTO();
                 patentStarListDTO.setCurrentQuery(conditions)
                         .setOrderBy(orderBy)
@@ -119,7 +134,7 @@ public class ImportFromWebToEsService implements PatentImportImp {
             }
 
             //当专利为专利号文件导入时
-            if (importTaskAMVO.getType().equals(3)) {
+            else if (importTaskAMVO.getType().equals(3)) {
                 FileManagerService fileManagerService = applicationContext.getBean(FileManagerService.class);
 
                 String res = fileManagerService.getSystemFileFromFMS(Arrays.asList(importTaskAMVO.getFileGuid()));
@@ -150,19 +165,28 @@ public class ImportFromWebToEsService implements PatentImportImp {
             char ifAddPicture = importTaskAMVO.getIfAddPicture();
             char ifAddFullText = importTaskAMVO.getIfAddFullText();
             char ifPdf = importTaskAMVO.getIfAddPDF();
+
             //下载字段
-             int index=doneNum;
+            int index = taskStartNum;
+
             //已经跳过的数量
             Integer overNum = 0;
+
+            Integer lastOverNum = overNum;
+
+            //检索式检索
             while (patentStarListDtos.size() > 0) {
                 PatentStarListDTO patentStarListDto = patentStarListDtos.remove(0);
                 Integer total = patentStarListDto.getTotal();
-                Integer lastTotalNum = overNum;
+                lastOverNum = overNum;
                 overNum += total;
-                if (overNum < doneNum) {
+
+                if (overNum < taskStartNum) {
                     continue;
                 }
-                Integer startNum = doneNum - lastTotalNum;
+
+                Integer trueStartNum = taskStartNum > lastOverNum ? taskStartNum : lastOverNum;
+                Integer startNum = trueStartNum - lastOverNum;
                 Calculate calculate = DateUtils.calculateFromStartAndEndNumber(startNum, total, 50);
                 Integer startPage = calculate.getStartPage();
                 Integer endPage = calculate.getEndPage();
@@ -173,19 +197,23 @@ public class ImportFromWebToEsService implements PatentImportImp {
                     patentStarListDTOTemp.setPageNum(i + 1);
                     patentStarListDTOTemp.setRowCount(50);
                     //调用一般接口返回一批专利著录相关数据
+
                     Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDTOTemp);
+
                     if (resultMap == null || (Integer) resultMap.get("total") == 0) {
                         continue;
                     }
                     List<StarPatentVO> starPatents = (List<StarPatentVO>) resultMap.get("records");
+
+                    if ((i * 50 + starPatents.size()) < startNum) {
+                        continue;
+                    }
+                    Integer pageStartNum = (i * 50) >= startNum ? 0 : startNum - (i * 50);
+                    Integer pageEndNum = starPatents.size();
                     //遍历这一页的专利
-                    for (int j = 0; j < starPatents.size(); j++) {
-                        if ((i * 50 + j) < startNum) {
-                            continue;
-                        }
+                    for (int j = pageStartNum; j < pageEndNum; j++) {
                         UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                         Patent patent = new Patent();
-
                         //装载start
                         uploadPatentWebDTO.setStarPatentVO(starPatents.get(j));
                         uploadPatentWebDTO.setPatent(patent);
@@ -193,24 +221,30 @@ public class ImportFromWebToEsService implements PatentImportImp {
                         uploadPatentWebDTO.setIndex(index);
                         uploadPatentWebDTO.setTotalCounter(addPatentCounter);
                         uploadPatentWebDTO.setHaveSaveCounter(0);
+
                         if (ifCataloguing == '1') {
                             getCataloguingFromWebThread.awakeTask(uploadPatentWebDTO);
                         }
+
                         if (ifAddPicture == '1') {
                             getPatentPictureFromWebThread.awakeTask(uploadPatentWebDTO);
                         }
+
                         if (ifAddFullText == '1') {
                             getRightAndFullTextFromWebThread.awakeTask(uploadPatentWebDTO);
                         }
+
                         if (ifPdf == '1') {
                             getPatentPDFFromWebThread.awakeTask(uploadPatentWebDTO);
                         }
-                        index+=1;
+                        index += 1;
                     }
 
                 }
-                doneNum = overNum;
+
+                taskStartNum = overNum;
             }
+
             if (ifCataloguing == '1') {
                 getCataloguingFromWebThread.setIfProductAll(true);
             }
@@ -226,9 +260,7 @@ public class ImportFromWebToEsService implements PatentImportImp {
         } catch (Exception e) {
             e.printStackTrace();
             //生产消费到一半时,发生错误异常,将任务状态置为完成
-//            task = taskService.getById(task.getId());
-//            task.setStatus(2);
-//            taskService.updateById(task);
+
         }
     }
 
@@ -240,17 +272,10 @@ public class ImportFromWebToEsService implements PatentImportImp {
         this.importTaskAMVO = taskThread.getImportTaskAMVO();
     }
 
-    //加入es保存队列
-//    public void savePatentToEs(UploadPatentWebDTO uploadPatentWebDTO) {
-//        uploadPatentWebDTO.setCounter(uploadPatentWebDTO.getCounter() + 1);
-//        if (uploadPatentWebDTO.getTotalCounter().equals(uploadPatentWebDTO.getCounter())) {
-//            savePatentToEsThread.awakeTask(uploadPatentWebDTO);
-//        }
-//    }
 
     public void loadPatentMessageDone(UploadPatentWebDTO uploadPatentWebDTO) {
         synchronized ("装载专利信息") {
-            if (importTaskAMVO.getPatentMessageShouldSaveCounter() > 1) {
+            if (importTaskAMVO.getMessageThreadCounter() > 1) {
                 // 根据index查询是否有相同的
                 List<UploadPatentWebDTO> dtos = uploadPatentWebDTOS.stream()
                         .filter(item -> item.getIndex().equals(uploadPatentWebDTO.getIndex())).collect(Collectors.toList());
@@ -260,10 +285,9 @@ public class ImportFromWebToEsService implements PatentImportImp {
                     BeanUtils.copyProperties(patent, orgPatent, FormatUtil.getNullPropertyNames(patent));
                     Patent patent1 = new Patent();
                     BeanUtils.copyProperties(orgPatent, patent1);
-                    uploadPatentWebDTOS.removeIf(i->i.getIndex().equals(uploadPatentWebDTO.getIndex()));
+                    uploadPatentWebDTOS.removeIf(i -> i.getIndex().equals(uploadPatentWebDTO.getIndex()));
                     savePatentToEsThread.awakeTask(patent1);
-                }
-                else {
+                } else {
                     uploadPatentWebDTOS.add(uploadPatentWebDTO);
                 }
             } else {
@@ -277,11 +301,10 @@ public class ImportFromWebToEsService implements PatentImportImp {
 
 
     public void setPatentToEsProductAll() {
-        importTaskAMVO.setHaveSaveMessageCounter(importTaskAMVO.getHaveSaveMessageCounter() + 1);
-        if (importTaskAMVO.getPatentMessageShouldSaveCounter().equals(importTaskAMVO.getHaveSaveMessageCounter())) {
+        importTaskAMVO.setMessageThreadDoneCounter(importTaskAMVO.getThreadDoneCounter() + 1);
+        if (importTaskAMVO.getMessageThreadCounter().equals(importTaskAMVO.getMessageThreadDoneCounter())) {
             savePatentToEsThread.setIfProductAll(true);
         }
-
     }
 
     private void loadPatent(StarPatentVO starPatentVO, Patent patent) {

+ 2 - 1
src/main/java/cn/cslg/pas/service/importPatent/SchedulingTaskService.java

@@ -60,7 +60,7 @@ public class SchedulingTaskService {
                     importTaskList.get(i).setState(1);
                     importTaskList.get(i).updateById();
                     importTaskAMVOS.get(i).setState(1);
-                    importTaskAMVOS.get(i).setHaveSaveCounter(0);
+                    importTaskAMVOS.get(i).setThreadCounter(0);
                     TaskThread taskThread = new TaskThread(importTaskAMVOS.get(i), applicationContext);
                     executor.execute(taskThread);
                 }
@@ -99,6 +99,7 @@ public class SchedulingTaskService {
                 importTaskAMVO.setOrderBy(importTaskCondition.getOrderBy());
                 importTaskAMVO.setOrderByType(importTaskCondition.getOrderByType());
                 importTaskAMVO.setProjectType(importTaskCondition.getProjectType());
+                importTaskAMVO.setPatentNoStr(importTaskCondition.getPatentNos());
 
                 LambdaQueryWrapper<ReportProject> rQueryWrapper = new LambdaQueryWrapper<>();
                 rQueryWrapper.eq(ReportProject::getProjectId, importTaskCondition.getProjectId());

+ 17 - 18
src/main/java/cn/cslg/pas/service/importPatent/TaskThread.java

@@ -38,7 +38,6 @@ public class TaskThread extends Thread {
     private ApplicationContext applicationContext;
     private final Lock taskThreadLock = new ReentrantLock();
     private final Condition taskThreadCondition = taskThreadLock.newCondition();
-    private final List<Integer> importTaskQueue = new ArrayList<>();
     private ImportTaskAMVO importTaskAMVO;
     private PatentProcess patentProcess = new PatentProcess();
     private List<UploadPatentWebDTO> uploadPatentWebDTOS = new ArrayList<>();
@@ -51,9 +50,9 @@ public class TaskThread extends Thread {
         //十进制转二进制
         String imContents = "0000";
         //当任务为
-        if(importTaskAMVO.getType().equals(1))
-        {   imContents = "1100";}
-      else  if (!importTaskAMVO.getImportContent().equals(0)) {
+        if (importTaskAMVO.getType().equals(1)) {
+            imContents = "1100";
+        } else if (!importTaskAMVO.getImportContent().equals(0)) {
             imContents = MathUtils.fun(2, importTaskAMVO.getImportContent());
         }
         //下载字段
@@ -66,34 +65,34 @@ public class TaskThread extends Thread {
         importTaskAMVO.setIfAddPicture(ifAddPicture);
         importTaskAMVO.setIfAddFullText(ifFullText);
         importTaskAMVO.setIfAddPDF(ifPdf);
-        importTaskAMVO.setHaveSaveCounter(0);
-        importTaskAMVO.setHaveSaveMessageCounter(0);
-        Integer shouldSaveCount = 0;
-        Integer messageShouldSaveCount = 0;
+        importTaskAMVO.setThreadDoneCounter(0);
+        importTaskAMVO.setMessageThreadDoneCounter(0);
+        Integer threadCount = 0;
+        Integer messageThreadCount = 0;
 
         if (ifAddPicture == '1') {
-            shouldSaveCount += 1;
-            this.patentProcess.setPictureDoneNum(0);
+            threadCount += 1;
+            this.patentProcess.setPictureDoneNum(importTaskAMVO.getDoneNum());
             this.patentProcess.setPictureDefaultNum(0);
         }
         if (ifCataloguing == '1' || ifFullText == '1') {
-            shouldSaveCount += 1;
+            threadCount += 1;
             this.patentProcess.setPatentMessageDefaultNum(0);
             this.patentProcess.setPatentMessageDoneNum(0);
             if (ifCataloguing == '1') {
-                messageShouldSaveCount += 1;
+                messageThreadCount += 1;
             }
             if (ifFullText == '1') {
-                messageShouldSaveCount += 1;
+                messageThreadCount += 1;
             }
         }
         if (ifPdf == '1') {
             this.patentProcess.setPdfDefaultNum(0);
             this.patentProcess.setPdfDoneNum(0);
-            shouldSaveCount += 1;
+            threadCount += 1;
         }
-        importTaskAMVO.setPatentMessageShouldSaveCounter(messageShouldSaveCount);
-        importTaskAMVO.setShouldSaveCounter(shouldSaveCount);
+        importTaskAMVO.setMessageThreadCounter(messageThreadCount);
+        importTaskAMVO.setThreadCounter(threadCount);
         this.applicationContext = applicationContext;
         this.patentProcess.setPatentDoneNum(importTaskAMVO.getDoneNum());
         this.patentProcess.setPatentDefaultNum(0);
@@ -141,8 +140,8 @@ public class TaskThread extends Thread {
      */
     public void awakeTaskThread() {
         synchronized ("导入任务是否完成") {
-            importTaskAMVO.setHaveSaveCounter(importTaskAMVO.getHaveSaveCounter() + 1);
-            if (importTaskAMVO.getShouldSaveCounter().equals(importTaskAMVO.getHaveSaveCounter())) {
+            importTaskAMVO.setThreadDoneCounter(importTaskAMVO.getThreadDoneCounter() + 1);
+            if (importTaskAMVO.getThreadCounter().equals(importTaskAMVO.getThreadDoneCounter())) {
                 if (taskThreadLock.tryLock()) {
                     //taskLock.lock();
                     taskThreadCondition.signalAll();

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

@@ -854,7 +854,7 @@
   },
   {
     "name": "法律状态",
-    "type": "String",
+    "type": "Array",
     "value": "legalStatus",
     "field": "LG",
     "esField": "legal_status.raw",

+ 25 - 5
src/test/java/cn/cslg/pas/service/EventServiceTests.java

@@ -33,6 +33,7 @@ import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -468,16 +469,35 @@ public class EventServiceTests {
 
     @Test
     public void test101() {
-
+        List<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(2);
+        list.add(3);
+        list.add(4);
+        this.tran(list);
     }
 
-    @Transactional
-    public void tran() {
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
+    public void tran(List<Integer> list) {
+        int i = 0;
+        for (Integer key : list) {
+            if (i == 3) {
+                this.tran1(i);
+            } else {
+                i += key;
+            }
+        }
+        System.out.println(i);
 
     }
 
-    @Transactional
-    public void tran1() {
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
+    public Integer tran1(int m) {
+        System.out.println(m);
+        m = m+1;
+        if (m > 0) {
 
+        }
+        return m;
     }
 }