Bläddra i källkod

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/cn/cslg/pas/controller/PatentController.java
zero 1 år sedan
förälder
incheckning
37215e68a4

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

@@ -20,7 +20,7 @@ public class InvalidStatutesDTO {
     private Integer statutesId;
 
     /**
-     * 涉及内容 0 说明书 1 权利要求
+     * 涉及内容 0说明书  1权利要求 2附图
      */
     private Integer relatedContent;
 

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

@@ -8,17 +8,23 @@ import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.vo.business.*;
+import cn.cslg.pas.common.vo.PatentPageMessageVO;
+import cn.cslg.pas.common.vo.PatentWithIdVO;
+import cn.cslg.pas.common.vo.StarPatentVO;
+import cn.cslg.pas.common.vo.business.EsAllCountVO;
+import cn.cslg.pas.common.vo.business.EsCountVO;
+import cn.cslg.pas.common.vo.business.PatentKinVO;
+import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
 import cn.cslg.pas.service.business.MergePersonService;
 import cn.cslg.pas.service.business.es.EsCountService;
 import cn.cslg.pas.service.business.es.EsPatentService;
+import cn.cslg.pas.service.business.es.EsService;
+import cn.cslg.pas.service.common.PatentStarApiService;
 import io.swagger.v3.oas.annotations.Operation;
 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;
 
@@ -38,6 +44,10 @@ public class PatentController {
     @Autowired
     private MergePersonService mergePersonService;
 
+@Autowired
+private EsService esService;
+    @Autowired
+    private PatentStarApiService patentStarApiService;
 
     @Operation(summary = "查询专利")
     @PostMapping("/queryPatent")
@@ -75,6 +85,27 @@ public class PatentController {
         return Response.success(dto);
     }
 
+    @Operation(summary = "根据专利号查询内部专利")
+    @GetMapping("/queryPatentByNo")
+    public Response queryPatentByNo(String patentNo) throws Exception {
+        PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo(patentNo);
+        if(patentWithIdVO==null){
+            return Response.success(null);
+        }
+       return Response.success(patentWithIdVO.getPatent());
+
+    }
+
+    @Operation(summary = "根据专利号查询内部专利")
+    @GetMapping("/queryPatentByNoFromWeb")
+    public Response queryPatentByNoFromWeb(String patentNo) throws Exception {
+        StarPatentVO starPatentVO = patentStarApiService.getPatentByNo(patentNo);
+        if(starPatentVO==null){
+            return Response.success(null);
+        }
+        return Response.success(starPatentVO);
+
+    }
     //------------------------合并-----------------------------
     @Operation(summary = "专利列表上新增发明人/权利人/申请人合并")
     @PostMapping("/mergePerson")

+ 19 - 17
src/main/java/cn/cslg/pas/service/business/ImportTaskService.java

@@ -131,19 +131,21 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
             throw new UnLoginException("未登录");
         }
 
-        if(importTaskDTO.getType()==null){
+        if (importTaskDTO.getType() == null) {
             importTaskDTO.setType(4);
         }
 
         ImportTaskCondition importTaskCondition = new ImportTaskCondition();
-        if (importTaskDTO.getImportToType().equals(0)) {
-            importTaskCondition.setProjectType(0);
-            importTaskCondition.setProjectId(importTaskDTO.getImportToId());
-        } else if (importTaskDTO.getImportToType().equals(1)) {
-            importTaskCondition.setProjectType(1);
-            importTaskCondition.setProjectId(importTaskDTO.getImportToId());
-        } else if (importTaskDTO.getImportToType().equals(2)) {
-            importTaskCondition.setProductId(importTaskDTO.getImportToId());
+        if (importTaskDTO.getImportToId() != null) {
+            if (importTaskDTO.getImportToType().equals(0)) {
+                importTaskCondition.setProjectType(0);
+                importTaskCondition.setProjectId(importTaskDTO.getImportToId());
+            } else if (importTaskDTO.getImportToType().equals(1)) {
+                importTaskCondition.setProjectType(1);
+                importTaskCondition.setProjectId(importTaskDTO.getImportToId());
+            } else if (importTaskDTO.getImportToType().equals(2)) {
+                importTaskCondition.setProductId(importTaskDTO.getImportToId());
+            }
         }
         if (!importTaskDTO.getType().equals(1)) {
             importTaskDTO.setImportContent(MathUtils.BinaryToDecimal(importTaskDTO.getImportContent()));
@@ -160,7 +162,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
         importTaskCondition.setOrderByType(importTaskDTO.getOrderByType());
         importTaskCondition.setCreateId(personnelVO.getId());
 
-       String fieldJson= JsonUtils.objectToJson(importTaskCondition);
+        String fieldJson = JsonUtils.objectToJson(importTaskCondition);
         importTaskCondition.setCustomFields(fieldJson);
         importTaskCondition.insert();
 
@@ -258,9 +260,9 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
     }
 
     private void loadImportTask(List<ImportTaskVO> importTaskVOS) throws IOException {
-        List<ImportTaskAMVO> importTaskAMVOS =schedulingTaskService.getImportTaskAMVOs();
-        if(importTaskAMVOS==null){
-            importTaskAMVOS=new ArrayList<>();
+        List<ImportTaskAMVO> importTaskAMVOS = schedulingTaskService.getImportTaskAMVOs();
+        if (importTaskAMVOS == null) {
+            importTaskAMVOS = new ArrayList<>();
         }
         List<String> createIds = new ArrayList<>();
         importTaskVOS.forEach(item -> {
@@ -310,10 +312,10 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
 
 
             //装载正在进行中任务的完成条数
-          ImportTaskAMVO importTaskAMVO =  importTaskAMVOS.stream().filter(item->item.getId().equals(importTaskVO.getId())).findFirst().orElse(null);
-        if(importTaskAMVO!=null){
-            importTaskVO.setDoneNum(importTaskAMVO.getDoneNum());
-        }
+            ImportTaskAMVO importTaskAMVO = importTaskAMVOS.stream().filter(item -> item.getId().equals(importTaskVO.getId())).findFirst().orElse(null);
+            if (importTaskAMVO != null) {
+                importTaskVO.setDoneNum(importTaskAMVO.getDoneNum());
+            }
         }
 
     }

+ 9 - 5
src/main/java/cn/cslg/pas/service/business/InvalidStatutesService.java

@@ -48,8 +48,11 @@ public class InvalidStatutesService extends ServiceImpl<InvalidStatutesMapper, I
         List<Integer> ids = new ArrayList<>();
         if (invalidStatutesDTO != null) {
             if (invalidStatutesDTO.getProjectId() != null) {
+                if (invalidStatutesDTO.getRelatedContent() == null) {
+                    throw new XiaoShiException("涉及内容不能为空");
+                }
                 //涉及内容为权利要求的时候
-                if (invalidStatutesDTO.getRelatedContent() != null && invalidStatutesDTO.getRelatedContent() == 1) {
+                if (invalidStatutesDTO.getRelatedContent() == 1) {
                     List<InvalidStatutes> invalidStatutesList = new ArrayList<>();
                     if (invalidStatutesDTO.getClaimIds() != null && !invalidStatutesDTO.getClaimIds().isEmpty()) {
                         List<Integer> claimIds = invalidStatutesDTO.getClaimIds();
@@ -62,14 +65,15 @@ public class InvalidStatutesService extends ServiceImpl<InvalidStatutesMapper, I
                         this.saveBatch(invalidStatutesList);
                         ids = invalidStatutesList.stream().map(InvalidStatutes::getId).collect(Collectors.toList());
                     }
-                } else if (invalidStatutesDTO.getRelatedContent() != null && invalidStatutesDTO.getRelatedContent() == 0) {
-                    //涉及内容为说明书
+                } else if (invalidStatutesDTO.getRelatedContent() == 0 || invalidStatutesDTO.getRelatedContent() == 2) {
+                    //涉及内容为说明书或者附图
                     InvalidStatutes invalidStatutes = new InvalidStatutes();
                     BeanUtils.copyProperties(invalidStatutesDTO, invalidStatutes);
                     invalidStatutes.insert();
                     Integer id = invalidStatutes.getId();
                     ids.add(id);
-                } else {
+                }
+                else {
                     throw new XiaoShiException("涉及内容不能为空");
                 }
                 return ids;
@@ -144,7 +148,7 @@ public class InvalidStatutesService extends ServiceImpl<InvalidStatutesMapper, I
      * @param invalidStatutesVOS
      */
     public void loadClaims(Integer projectId, List<InvalidStatutesVO> invalidStatutesVOS){
-        List<Integer> claimIds = invalidStatutesVOS.stream().map(InvalidStatutesVO::getClaimId).collect(Collectors.toList());
+        List<Integer> claimIds = invalidStatutesVOS.stream().filter(item -> item.getClaimId() != null).map(InvalidStatutesVO::getClaimId).collect(Collectors.toList());
         if (!claimIds.isEmpty()) {
             LambdaQueryWrapper<PatentClaim> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.in(PatentClaim::getId, claimIds)

+ 3 - 4
src/main/java/cn/cslg/pas/service/business/ProofGroupService.java

@@ -52,16 +52,15 @@ public class ProofGroupService extends ServiceImpl<ProofGroupMapper, ProofGroup>
             if (projectId == null) {
                 throw new XiaoShiException("projectId不能为空");
             }
-            if (claimId == null) {
-                throw new XiaoShiException("claimId不能为空");
-            }
             if (statutesId == null) {
                 throw new XiaoShiException("invalidStatutesId不能为空");
             }
             LambdaQueryWrapper<InvalidStatutes> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(InvalidStatutes::getStatutesId, statutesId)
-                    .eq(InvalidStatutes::getClaimId, claimId)
                     .eq(InvalidStatutes::getProjectId, projectId);
+            if (claimId != null) {
+                queryWrapper.eq(InvalidStatutes::getClaimId, claimId);
+            }
             InvalidStatutes invalidStatutes = invalidStatutesService.getOne(queryWrapper, false);
             if (invalidStatutes == null) {
                 throw new XiaoShiException("查询无效法条错误");

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

@@ -322,7 +322,7 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
             try {
                 PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo(reportProject.getSignPatentNo());
                 if (patentWithIdVO != null && patentWithIdVO.getPatent() != null) {
-                    reportProject.setPatentType(reportProject.getPatentType());
+                    reportProject.setPatentType(Integer.parseInt(patentWithIdVO.getPatent().getPatentType()));
                 }
             } catch (Exception e) {
                 throw new XiaoShiException("未查询到标的专利");

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

@@ -822,4 +822,5 @@ public class PatentStarApiService {
         return patentColumnDTOS;
 
     }
+
 }

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

@@ -114,14 +114,14 @@ public class GetCataloguingFromWebThread extends Thread {
                 }
 //
 //                //添加法律事务
-                esService.addEsLegalEvent(uploadPatentWebDTO.getStarPatentVO().getPublicNo());
-//
+//                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) {

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

@@ -140,7 +140,10 @@ public class SavePatentToEsThread extends Thread {
     public void setIfProductAll(Boolean ifProductAll) {
 
         this.ifProductAll = ifProductAll;
-
+        if (taskLock.tryLock()) {
+            taskCondition.signalAll();
+            taskLock.unlock();
+        }
     }