浏览代码

8/27 定时更新修改

lwhhszx 1 年之前
父节点
当前提交
c9df539c64

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

@@ -19,6 +19,7 @@ import cn.cslg.pas.domain.es.*;
 import cn.cslg.pas.service.WebLoginConfigService;
 
 
+import cn.cslg.pas.service.importPatent.WebVOTransformService;
 import cn.cslg.pas.service.query.FormatQueryService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -76,6 +77,8 @@ public class PatentStarApiService {
     private WebLoginConfigService webLoginConfigService;
     @Autowired
     private FormatQueryService formatQueryService;
+    @Autowired
+    private WebVOTransformService webVOTransformService;
 
     public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
         RetrieveRecord retrieveRecord = new RetrieveRecord();
@@ -872,36 +875,13 @@ public class PatentStarApiService {
 
         List<PatentColumnDTO> patentColumnDTOS = new ArrayList<>();
         starPatentVOS.forEach(item -> {
+            UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
+            uploadPatentWebDTO.setStarPatentVO(item);
+            Patent patent = new Patent();
+            uploadPatentWebDTO.setPatent(patent);
+      webVOTransformService.loadPatent(uploadPatentWebDTO,false);
             PatentColumnDTO patentColumnDTO = new PatentColumnDTO();
-            //申请号
-            patentColumnDTO.setAppNo(item.getAN());
-            //装载公开号
-            patentColumnDTO.setPublicNo(item.getPN());
-            //装载公告号
-            patentColumnDTO.setGrantNo(item.getGN());
-            //装载专利状态
-            if (item.getLG() != null) {
-                patentColumnDTO.setSimpleStatus(item.getLG().toString());
-            }
-            //装载专利类型
-            if (item.getPT() != null) {
-                patentColumnDTO.setPatentType(item.getPT().toString());
-            }
-            //装载摘要
-            List<Text> abstractList = new ArrayList<>();
-            Text text = new Text();
-            text.setTextContent(item.getAB());
-            text.setIfOrigin(true);
-            abstractList.add(text);
-            patentColumnDTO.setAbstractStr(abstractList);
-            //装载标题
-            List<Text> titleList = new ArrayList<>();
-            Text title = new Text();
-            title.setTextContent(item.getTI());
-            title.setIfOrigin(true);
-            titleList.add(title);
-//            text.setLanguage(patent.getAppCountry());
-            patentColumnDTO.setTitle(titleList);
+            BeanUtils.copyProperties(patent,patentColumnDTO);
             //装载权利要求
             List<Text> claimList = new ArrayList<>();
             Text claim = new Text();
@@ -909,50 +889,7 @@ public class PatentStarApiService {
             claim.setIfOrigin(true);
             claimList.add(claim);
             patentColumnDTO.setClaim(claimList);
-            //装载专利号
-            if (patentColumnDTO.getAppNo() != null) {
-                if (patentColumnDTO.getAppNo().trim().startsWith("CN")) {
-                    patentColumnDTO.setPatentNo(patentColumnDTO.getAppNo());
-                } else {
-                    if (patentColumnDTO.getPublicNo() != null) {
-                        patentColumnDTO.setPatentNo(patentColumnDTO.getPublicNo());
-                    } else if (patentColumnDTO.getGrantNo() != null) {
-                        patentColumnDTO.setPatentNo(patentColumnDTO.getGrantNo());
-                    } else {
-                        patentColumnDTO.setPatentNo(patentColumnDTO.getAppNo());
-                    }
-                }
-            }
 
-            //装载申请日
-            if (item.getAD() != null && !item.getAD().trim().equals("")) {
-                patentColumnDTO.setAppDate(DateUtils.strToDate(item.getAD()));
-            }
-//            patentColumnDTO.setAppCountry(item.getBureau());
-            //装载申请人地址
-            PersonAddress appAddress = new PersonAddress();
-            appAddress.setAddress(item.getDZ());
-            appAddress.setProvince(item.getPaAllCountry());
-            patentColumnDTO.setApplicantAddr(appAddress);
-            patentColumnDTO.setAppAddress(item.getDZ());
-//            patentColumnDTO.setApplicantCountry(item.getProvinceStr());
-            String provinceStr = item.getCO();
-            if (provinceStr.contains("(") && provinceStr.contains(")")) {
-                String substring = provinceStr.substring(provinceStr.indexOf("(") + 1, provinceStr.indexOf(")"));
-                patentColumnDTO.setAppProvince(substring);
-            }
-            //装载ipc(主)分类号
-            PatentClassify mipcClassify = new PatentClassify();
-            mipcClassify.setLevel5(item.getMC());
-            patentColumnDTO.setMipc(mipcClassify);
-            //装载ipc分类号
-            List<PatentClassify> classifies = new ArrayList<>();
-            String[] split = item.getIC().split(";");
-            for (String ipc : split) {
-                PatentClassify ipcClassify = new PatentClassify();
-                ipcClassify.setLevel5(ipc);
-            }
-            patentColumnDTO.setIpc(classifies);
             //获取摘要附图
 //            String pictureApi = this.getPictureApi(item.getRowApplicationNo());
 //            patentColumnDTO.setPictureGuid(pictureApi);
@@ -962,15 +899,6 @@ public class PatentStarApiService {
 //            String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
 //            patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
             //获取被引用次数
-            //装载公开日
-            if (item.getPD() != null && !item.getPD().trim().equals("")) {
-                patentColumnDTO.setPublicDate(DateUtils.strToDate(item.getPD()));
-            }
-
-            //装载公告日
-            if (item.getGD() != null && !item.getGD().trim().equals("")) {
-                patentColumnDTO.setGrantDate(DateUtils.strToDate(item.getGD()));
-            }
 
             //装载申请人
             if (item.getPA() != null && !item.getPA().trim().equals("")) {
@@ -995,24 +923,6 @@ public class PatentStarApiService {
             } else {
                 patentColumnDTO.setRightHolder(new ArrayList<>());
             }
-
-            //装载代理人
-            if (item.getAT() != null && !item.getAT().trim().equals("")) {
-                List<String> names = Arrays.asList(item.getAT().split(";"));
-                patentColumnDTO.setAgent(names);
-            } else {
-                patentColumnDTO.setAgent(new ArrayList<>());
-            }
-
-            //装载代理机构
-            if (item.getAGN() != null && !item.getAGN().trim().equals("")) {
-                patentColumnDTO.setAgency(item.getAGN());
-            }
-            //装载优先权
-            patentColumnDTO.setPriorityNo(item.getPR());
-            patentColumnDTO.setPriorityDate(item.getPRD());
-            patentColumnDTO.setAppCountry(item.getGJ());
-            patentColumnDTOS.add(patentColumnDTO);
         });
 
         return patentColumnDTOS;

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

@@ -257,8 +257,8 @@ public class GetPatentFromExcelThread extends Thread {
         List<String> ipcList = uploadParamsVO.getIpcList();
         String mainIpc = uploadParamsVO.getMainIpc();
 
-        webVOTransformService.loadPatentIPC(patent, mainIpc, ipcList);
-
+        webVOTransformService.loadPatentIPC(patent, ipcList);
+        webVOTransformService.loadPatentMainIPC(patent,mainIpc);
         //装载CPC分类号
         List<String> cpcList = uploadParamsVO.getCpcList();
         webVOTransformService.loadPatentCPC(patent, cpcList);

+ 13 - 4
src/main/java/cn/cslg/pas/service/importPatent/GetPatentPDFFromWebThread.java

@@ -107,9 +107,18 @@ public class GetPatentPDFFromWebThread extends Thread {
 
     }
 
-    public void recordQuestionPatent(String appNo) {
+    public void recordQuestionPatent(StarPatentVO starPatentVO,Boolean ifCN) {
+        String usedNo =starPatentVO.getANO();
+        if(ifCN!=null&&!ifCN){
+            if(starPatentVO.getGN()!=null){
+                usedNo =starPatentVO.getGN();
+            }
+            else if(starPatentVO.getPN()!=null){
+                usedNo=starPatentVO.getPN();
+            }
+        }
         PatentImportErrorLog patentImportErrorLog = new PatentImportErrorLog();
-        patentImportErrorLog.setPatentNo(appNo);
+        patentImportErrorLog.setPatentNo(usedNo);
         patentImportErrorLog.setErrorType(4);
         patentImportErrorLog.setTaskId(importTaskAMVO.getId());
         patentImportErrorLog.insert();
@@ -129,7 +138,7 @@ public class GetPatentPDFFromWebThread extends Thread {
                 webVOTransformService.getCnPatentPDF(pdfUrlStr, starPatentVO);
                 //根据专利号调用"获得世界专利pdf"接口,获得pdf的url地址
             } else {
-                recordQuestionPatent(starPatentVO.getAN());
+                recordQuestionPatent(starPatentVO,true);
             }
         } else {
             String usedPatentNo;
@@ -143,7 +152,7 @@ public class GetPatentPDFFromWebThread extends Thread {
             if (!pdfUrl.equals("")) {
                 webVOTransformService.getWdPatentPDF(pdfUrl, usedPatentNo);
             } else {
-                recordQuestionPatent(starPatentVO.getAN());
+                recordQuestionPatent(starPatentVO,false);
             }
         }
 

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

@@ -75,7 +75,7 @@ public class GetPatentPictureFromWebThread extends Thread {
                         String guid = FormatUtil.getPictureFormat(uploadPatentWebDTO.getStarPatentVO().getAN());
                         fileManagerService.uploadFileWithGuid(file, guid);
                     } else {
-                        recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getAN());
+                        recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO(),true);
                     }
 
                 } else {
@@ -88,7 +88,7 @@ public class GetPatentPictureFromWebThread extends Thread {
                         fileManagerService.uploadFileWithGuid(file, guid);
                         file.delete();
                     } else {
-                        recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getAN());
+                        recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO(),false);
 
                     }
 
@@ -96,7 +96,7 @@ public class GetPatentPictureFromWebThread extends Thread {
                 taskThread.updateProcess(false, 2, "");
             } catch (Exception e) {
                 taskThread.updateProcess(true, 2, "");
-                recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO().getAN());
+                recordQuestionPatent(uploadPatentWebDTO.getStarPatentVO(),false);
 
                 e.printStackTrace();
             }
@@ -133,9 +133,18 @@ public class GetPatentPictureFromWebThread extends Thread {
         }
     }
 
-    public void recordQuestionPatent(String appNo) {
+    public void recordQuestionPatent(StarPatentVO starPatentVO,Boolean ifCN) {
+        String usedNo =starPatentVO.getANO();
+        if(ifCN!=null&&!ifCN){
+            if(starPatentVO.getGN()!=null){
+                usedNo =starPatentVO.getGN();
+            }
+            else if(starPatentVO.getPN()!=null){
+                usedNo=starPatentVO.getPN();
+            }
+        }
         PatentImportErrorLog patentImportErrorLog = new PatentImportErrorLog();
-        patentImportErrorLog.setPatentNo(appNo);
+        patentImportErrorLog.setPatentNo(usedNo);
         patentImportErrorLog.setErrorType(3);
         patentImportErrorLog.setTaskId(importTaskAMVO.getId());
         patentImportErrorLog.insert();

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

@@ -788,7 +788,7 @@ public class WebVOTransformService {
         try {
             //若没有取到全文文本,即取不到说明书文本,则将当前申请号或专利号和备注信息记录到问题记录表
             if (cnFullXmlStr.equals("")) {
-                recordQuestionPatent(patent.getAppNo(), taskId, 1);
+                recordQuestionPatent(patent.getPatentNo(), taskId, 1);
                 return;
             }