Browse Source

8/27 定时更新修改

lwhhszx 1 year ago
parent
commit
64d8b99e68

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

@@ -48,7 +48,7 @@ public class PatentColumnDTO {
     /**
      * 申请人地址
      */
-//    private PersonAddress applicantAddr;
+    private PersonAddress applicantAddr;
 
     //申请人地址
     private String appAddress;

+ 1 - 1
src/main/java/cn/cslg/pas/controller/ReportDocumentController.java

@@ -20,7 +20,7 @@ public class ReportDocumentController {
     private ReportExportService reportExportService;
     @GetMapping(value = "/exportReport")
     @Operation(summary = "导出报告")
-    public Response exportReport(Integer projectId, Integer templeId) throws IOException {
+    public Response exportReport(Integer projectId, Integer templeId) throws Exception {
         Records records =new Records();
         String guid =reportExportService.exportReport(projectId, templeId);
         records.setData(guid);

+ 138 - 69
src/main/java/cn/cslg/pas/service/ReportExportService.java

@@ -8,6 +8,10 @@ import cn.cslg.pas.common.model.cronModel.PersonnelVO;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.*;
 import cn.cslg.pas.common.vo.*;
+import cn.cslg.pas.common.vo.business.FTOCompareRecordVO;
+import cn.cslg.pas.common.vo.business.TortCompareRecordVO;
+import cn.cslg.pas.common.vo.business.TortRightVO;
+import cn.cslg.pas.common.vo.business.TortVO;
 import cn.cslg.pas.domain.ReportDocument;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.domain.es.Patent;
@@ -98,6 +102,8 @@ public class ReportExportService {
     private CompareLiteratureService compareLiteratureService;
     @Autowired
     private EvidenceReasonService evidenceReasonService;
+    @Autowired
+    private TortCompareRecordService tortCompareRecordService;
 
     /**
      * @param projectId
@@ -106,11 +112,12 @@ public class ReportExportService {
      * @throws IOException
      * @function: 导出报告
      */
-    public String exportReport(Integer projectId, Integer templeId) throws IOException {
+    public String exportReport(Integer projectId, Integer templeId) throws Exception {
         //根据模板ID获得模板
         ReportTemple reportTemplate = templeService.getById(templeId);
         //获得模板路径
         String templateFilePath = fileUtils.getPath(reportTemplate.getTemplatePath());
+
         //读取模板后保存生成word的地址
         String fileName = IdUtil.simpleUUID() + ".docx";
         String directoryName = fileUtils.createDirectory();
@@ -135,20 +142,20 @@ public class ReportExportService {
         } else if (report.getReportType() == 1) {
             template = this.getThirdTemplate(projectId, templateFilePath);
         }
+        if (template == null) {
+            return null;
+        }
         // 读取模板、数据并渲染
 //         文件是否已存在,则删除
         File file = new File(outPath);
-
 //      生成word保存在指定目录
         template.writeToFile(outPath);
         template.close();
         //导出成功后,导出报告记录入库
-
         List<String> ids = fileManagerService.uploadFileGetGuid2(Arrays.asList(file));
         if (ids == null || ids.size() == 0) {
             throw new XiaoShiException("保存记录失败");
         }
-//        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
         PersonnelVO personnelVO = new PersonnelVO();
         personnelVO.setId("1");
         ReportDocument reportDocument = new ReportDocument();
@@ -166,88 +173,155 @@ public class ReportExportService {
     }
 
 
-    private XWPFTemplate Torttemplate(Integer reportId, String filePath) throws IOException {
+    private XWPFTemplate Torttemplate(Integer reportId, String filePath) throws Exception {
         //根据报告Id查询标的专利号
         LambdaQueryWrapper<ReportProject> projectLambdaQueryWrapper = new LambdaQueryWrapper<>();
         projectLambdaQueryWrapper.eq(ReportProject::getProjectId, reportId);
         ReportProject report = reportProjectService.getOne(projectLambdaQueryWrapper, false);
         String patentNo = report.getSignPatentNo();
-//        PatentVO patentVO = new PatentVO();
-//        patentVO.setPatentNos(Arrays.asList(patentNo));
-//        //根据专利号查询专利详细信息
-//        String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
-//        JSONObject jsonObject = JSONObject.parseObject(resBody);
-//        List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
-//        //装载单个专利的信息
+        List<Patent> patentList = esPatentService.getPatentsByNo(Arrays.asList(patentNo), true, null, null);
+
+        if (patentList == null || patentList.size() == 0) {
+            return null;
+        }
+        //装载单个专利的信息
         Map<String, Object> patentMap = new HashMap<>();
-//        JSONObject patent = patentDTOS.get(0);
-//        List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
-//        StringBuilder applicants = new StringBuilder();
-//        StringBuilder rightPerson = new StringBuilder();
-//        applicantJSONs.forEach(tem -> {
-//            if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
-//                applicants.append(tem.get("name") + "\r");
-//            } else {
-//                rightPerson.append(tem.get("name") + "\r");
-//            }
-//        });
-//        //装载同族信息
-//        JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
-//        List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
-//        List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
-//        List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
-//        patSnaps.addAll(simples);
-//        patSnaps.addAll(inpadocs);
-//        String familyStr = StringUtils.join(patSnaps, ",");
-//        //装载法律状态
-//        StringBuilder affair = new StringBuilder();
-//        List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
-//        affaires.forEach(item -> {
-//                    affair.append(item.get("status") + "\r");
-//                }
-//        );
-//        //同族专利
-//        patentMap.put("simpleFamilys", familyStr);
-//        //引用专利
-//        patentMap.put("quotePatents", patent.get("quote"));
-//        //申请日
-//        patentMap.put("applicationDate", patent.get("applicationDate"));
-//        //公开日
-//        patentMap.put("publicDate", patent.get("publicDate"));
-//        //专利号
-//        patentMap.put("publicNo", patent.get("publicNo"));
-//        patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
-//        patentMap.put("applicant", applicants);
-//        patentMap.put("rightPerson", rightPerson);
-//        patentMap.put("affair", affair);
-//        patentMap.put("name", patent.get("name"));
+        Patent patent = patentList.get(0);
+        String applicants = "";
+        String rightPerson = "";
+        if (patent.getApplicant() != null && patent.getApplicant().size() != 0) {
+            List<String> names =patent.getApplicant().stream().map(PatentPerson::getName).collect(Collectors.toList());
+            applicants = StringUtils.join(names, "\n");
+        }
+        if (patent.getRightHolder() != null && patent.getRightHolder().size() != 0) {
+            List<String> names =patent.getRightHolder().stream().map(PatentPerson::getName).collect(Collectors.toList());
+
+            rightPerson = StringUtils.join(names, "\n");
+        }
+
+        //装载同族信息
+        List<Map<String, Object>> familyMaps = esFamilyService.getPatentFamilyByNos(Arrays.asList(patent.getPatentNo()), "simple");
+        if (familyMaps.size() <= 0) {
+            familyMaps = esFamilyService.getPatentFamilyByNos(Arrays.asList(patent.getPatentNo()), "inpadoc");
+        }
+        if (familyMaps != null && familyMaps.size() > 0) {
+            Map<String, Object> familyMap = familyMaps.get(0);
+            if (familyMap.get("nos") != null) {
+                List<String> nos = (List<String>) familyMap.get("nos");
+                if (nos != null && nos.size() > 0) {
+                    String nosStr = StringUtils.join(nos, "\n");
+                    patentMap.put("simpleFamilys", nosStr);
+                }
+            }
+        }
+
+        //装载引用专利
+        Map<String, Object> map = esQuotePatentService.getEsQutePatentByNos(patent.getPatentNo());
+        if (map.get("nos") != null) {
+            List<String> nos = (List<String>) map.get("nos");
+            if (nos != null && nos.size() > 0) {
+                String nosStr = StringUtils.join(nos, "\n");
+                patentMap.put("quotePatents", nosStr);
+            }
+
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            if (patent.getGrantDate() != null) {
+                patentMap.put("publicDate",dateFormat.format(patent.getGrantDate()));
+            }
+            else {
+                patentMap.put("publicDate",dateFormat.format(patent.getPublicDate()));
+            }
+        }
+
+        if (patent.getGrantNo() != null) {
+            patentMap.put("publicNo", patent.getGrantNo());
+        } else {
+            patentMap.put("publicNo", patent.getPublicNo());
+
+        }
+
+        patentMap.put("applicant", applicants);
+        patentMap.put("rightPerson", rightPerson);
+        if (patent.getTitle() != null && patent.getTitle().size() > 0) {
+            patentMap.put("name", patent.getTitle().get(0).getTextContent());
+        }
         //图示
-        patentMap.put("abstractPath", "");
+        String guid = FormatUtil.getPictureFormat(patent.getAppNo());
+        PictureRenderData pictureData = this.guidToStream(guid);
+
+        if (pictureData != null) {
+            patentMap.put("abstractPath", pictureData);
+        }
+
+        if (patent.getPriorities() != null && patent.getPriorities().size() != 0) {
+            List<String> dates = patent.getPriorities().stream().map(Priorities::getPriorityDate).collect(Collectors.toList());
+            String nosStr = StringUtils.join(dates, ";");
+            patentMap.put("priorityDate", nosStr);
+        }
+
         //获得专利对比记录的信息
-//        Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
-//        List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
+        TortCompareRecordVO tortCompareRecordVO = tortCompareRecordService.getAllTortTaskResult(reportId, null, 1);
+        List<TortRightVO> tortRightVOS = tortCompareRecordVO.getTortRightVOS();
+
+        List<Map<String, Object>> tortMaps = new ArrayList<>();
+
+        Integer addI = 1;
+        if (tortRightVOS != null && tortRightVOS.size() > 0) {
+            addI =addI-tortRightVOS.get(0).getSort();
+        }
+
+        for (TortRightVO tortRightVO : tortRightVOS) {
+            Integer sort = tortRightVO.getSort();
+            List<TortVO> tortVOS = tortRightVO.getTortVOS();
+            for (TortVO tortVO : tortVOS) {
+                Map<String, Object> tortMap = new HashMap<>();
+                tortMap.put("rightName", "权要" + (sort + addI));
+                tortMap.put("content", tortVO.getContent());
+                tortMap.put("explainText", tortVO.getExplainText());
+                FTOCompareRecordVO ftoCompareRecordVO = tortVO.getFinalRecordVO();
+                if (ftoCompareRecordVO != null) {
+                    tortMap.put("targetDescription", ftoCompareRecordVO.getTargetDescription());
+                    Integer result = ftoCompareRecordVO.getCompareResult();
+                    switch (result) {
+                        case 0:
+                            tortMap.put("resultStr", "字面相同");
+                            break;
+                        case 1:
+                            tortMap.put("resultStr", "等同");
+                            break;
+                        case 2:
+                            tortMap.put("resultStr", "不等同");
+                            break;
+                        case 3:
+                            tortMap.put("resultStr", "确定");
+                            break;
+                    }
+                    tortMap.put("compareDescription", ftoCompareRecordVO.getCompareDescription());
+                }
+                tortMaps.add(tortMap);
+            }
+        }
         //装载对比记录的信息
-//        patentMap.put("cM", compareMessageVOS);
+        patentMap.put("cM", tortMaps);
 //        patentMap.put("rightNum", temMap.get("right"));
 //        patentMap.put("mainRightNum", temMap.get("mainRight"));
-        Map<String, Object> map = new HashMap<>();
+        Map<String, Object> map1 = new HashMap<>();
         String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
         String[] ds = date.split("-");
-        map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
-        map.put("patentMap", patentMap);
-        map.put("", patentNo);
+        map1.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
+        map1.put("patentMap", patentMap);
+        map1.put("name",patentMap.get("name"));
         // 为表格的显示绑定行循环
         LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
         HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
         // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
-        Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
-        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
+        Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).bind("compareDescription",htmlRenderPolicy).build();
+        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map1);
         return template;
     }
 
     private XWPFTemplate avoidDesignTemplate(Integer projectId, String path) throws IOException {
         String filePath = fileUtils.getPath(path);
-
         log.info("开始处理导出规避设计报告,参数为:{}, {}", projectId, filePath);
         LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(ReportProject::getProjectId, projectId);
@@ -255,10 +329,6 @@ public class ReportExportService {
         ReportProject report = reportProjectService.getOne(queryWrapper, false);
         String signPatentNo = report.getSignPatentNo();
 
-        //装载标的专利信息
-
-
-        ;
 
         //装载年月日
         String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
@@ -385,7 +455,6 @@ public class ReportExportService {
                     }
                     if (patent.getRightHolder() != null && patent.getRightHolder().size() != 0) {
                         rightPerson = StringUtils.join(patent.getRightHolder(), "\n");
-                    } else {
                     }
                     String affairStrs = "";
                     if (patent.getSimpleStatus() != null) {

+ 88 - 90
src/main/java/cn/cslg/pas/service/common/PatentStarApiService.java

@@ -66,8 +66,6 @@ import java.util.stream.Collectors;
 @Service
 
 public class PatentStarApiService {
-    private ApplicationContext applicationContext;
-    private PatentStarApiService patentStarApiService;
     @Autowired
     private RetrieveRecordService retrieveRecordService;
     @Autowired
@@ -81,7 +79,7 @@ public class PatentStarApiService {
 
     public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
         RetrieveRecord retrieveRecord = new RetrieveRecord();
-        retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
+        retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery() );
 
         if (patentStarListDTO.getRetrieveRecordId() != null) {
             retrieveRecord = retrieveRecordService.getById(patentStarListDTO.getRetrieveRecordId());
@@ -929,94 +927,94 @@ System.out.println("search time:"+(end-start));
                 }
             }
 
-//            //装载申请日
-//            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.getApplicationAddress());
-//            appAddress.setProvince(item.getProvinceStr());
-//            patentColumnDTO.setApplicantAddr(appAddress);
-//            patentColumnDTO.setAppAddress(item.getApplicationAddress());
-////            patentColumnDTO.setApplicantCountry(item.getProvinceStr());
-//            String provinceStr = item.getProvinceStr();
-//            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.getMainIpc());
-//            patentColumnDTO.setMipc(mipcClassify);
-//            //装载ipc分类号
-//            List<PatentClassify> classifies = new ArrayList<>();
-//            String[] split = item.getIpcListStr().split(";");
-//            for (String ipc : split) {
-//                PatentClassify ipcClassify = new PatentClassify();
-//                ipcClassify.setLevel5(ipc);
-//            }
-//            patentColumnDTO.setIpc(classifies);
-//            //获取摘要附图
-////            String pictureApi = this.getPictureApi(item.getRowApplicationNo());
-////            patentColumnDTO.setPictureGuid(pictureApi);
-//            //获取外部专利原始申请号
-//            patentColumnDTO.setRowApplicationNo(item.getRowApplicationNo());
-//            //获取法律状态
-////            String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
-////            patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
-//            //获取被引用次数
-//            //装载公开日
-//            if (item.getPublicDate() != null && !item.getPublicDate().trim().equals("")) {
-//                patentColumnDTO.setPublicDate(DateUtils.strToDate(item.getPublicDate()));
-//            }
-//
-//            //装载公开日
-//            if (item.getPublicAccreditDate() != null && !item.getPublicAccreditDate().trim().equals("")) {
-//                patentColumnDTO.setGrantDate(DateUtils.strToDate(item.getPublicAccreditDate()));
-//            }
-//
-//            //装载申请人
-//            if (item.getApplicantStr() != null && !item.getApplicantStr().trim().equals("")) {
-//                List<String> names = Arrays.asList(item.getApplicantStr().split(";"));
-//                patentColumnDTO.setApplicant(names);
-//            } else {
-//                patentColumnDTO.setApplicant(new ArrayList<>());
-//            }
-//
-//            //装载发明人
-//            if (item.getInventorStr() != null && !item.getInventorStr().trim().equals("")) {
-//                List<String> names = Arrays.asList(item.getInventorStr().split(";"));
-//                patentColumnDTO.setInventor(names);
-//            } else {
-//                patentColumnDTO.setInventor(new ArrayList<>());
-//            }
-//
-//            //装载权利人
-//            if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().trim().equals("")) {
-//                List<String> names = Arrays.asList(item.getCurrentApplicantStr().split(";"));
-//                patentColumnDTO.setRightHolder(names);
-//            } else {
-//                patentColumnDTO.setRightHolder(new ArrayList<>());
-//            }
-//
-//            //装载代理人
-//            if (item.getAgentStr() != null && !item.getAgentStr().trim().equals("")) {
-//                List<String> names = Arrays.asList(item.getAgentStr().split(";"));
-//                patentColumnDTO.setAgent(names);
-//            } else {
-//                patentColumnDTO.setAgent(new ArrayList<>());
-//            }
-//
-//            //装载代理机构
-//            if (item.getAgencyStr() != null && !item.getAgencyStr().trim().equals("")) {
-//                patentColumnDTO.setAgency(item.getAgencyStr());
-//            }
-//            //装载优先权
-//            patentColumnDTO.setPriorityNo(item.getPriorityNo());
-//            patentColumnDTO.setPriorityDate(item.getPriorityDate());
+            //装载申请日
+            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);
+            //获取外部专利原始申请号
+            patentColumnDTO.setRowApplicationNo(item.getANO());
+            //获取法律状态
+//            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("")) {
+                List<String> names = Arrays.asList(item.getPA().split(";"));
+                patentColumnDTO.setApplicant(names);
+            } else {
+                patentColumnDTO.setApplicant(new ArrayList<>());
+            }
+
+            //装载发明人
+            if (item.getIN() != null && !item.getIN().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getIN().split(";"));
+                patentColumnDTO.setInventor(names);
+            } else {
+                patentColumnDTO.setInventor(new ArrayList<>());
+            }
+
+            //装载权利人
+            if (item.getPE() != null && !item.getPE().trim().equals("")) {
+                List<String> names = Arrays.asList(item.getPE().split(";"));
+                patentColumnDTO.setRightHolder(names);
+            } 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);
         });
 

+ 10 - 5
src/main/java/cn/cslg/pas/service/common/TranslateService.java

@@ -156,7 +156,7 @@ public class TranslateService {
     }
 
     //封装添加参数
-    public String loadingTranslate(String patentNo, String patentField,String language,Boolean ifOrigin,Integer order,String parentSort,String textContent) throws Exception {
+    public String loadingTranslate(String patentNo, String patentField, String language, Boolean ifOrigin, Integer order, String parentSort, String textContent) throws Exception {
         PatentTranslate translate = new PatentTranslate();
         translate.setLanguage(language);
         translate.setPatentNo(patentNo);
@@ -171,7 +171,7 @@ public class TranslateService {
     }
 
     //添加标题、摘要原/译文
-    public Integer addTranslate(Text text, String patentNo,String patentField) throws Exception {
+    public Integer addTranslate(Text text, String patentNo, String patentField) throws Exception {
         int i = 0;
         String textContent = text.getTextContent();
         //原文
@@ -207,7 +207,7 @@ public class TranslateService {
                 List<Text> title = columnDTO.getTitle();
                 if (!CollectionUtils.isEmpty(title)) {
                     Text titleText = title.get(0);
-                    Integer translateNum = this.addTranslate(titleText, patentNo,patentField);
+                    Integer translateNum = this.addTranslate(titleText, patentNo, patentField);
                     if (translateNum < 1) {
                         throw new XiaoShiException("添加标题翻译失败");
                     }
@@ -216,7 +216,7 @@ public class TranslateService {
                 List<Text> abstractStr = columnDTO.getAbstractStr();
                 if (!CollectionUtils.isEmpty(abstractStr)) {
                     Text abstractText = abstractStr.get(0);
-                    Integer translateNum = this.addTranslate(abstractText, patentNo,patentField);
+                    Integer translateNum = this.addTranslate(abstractText, patentNo, patentField);
                     if (translateNum < 1) {
                         throw new XiaoShiException("添加摘要翻译失败");
                     }
@@ -272,6 +272,9 @@ public class TranslateService {
                 this.addOldClaimTranslate(claim, patentNo, patentField);
             } else if (patentField.equals("4")) {
                 List<Text> explainText = columnDTO.getPublicFullText();
+                if (explainText == null || explainText.size() == 0) {
+                    explainText = columnDTO.getGrantFullText();
+                }
                 this.addOldPFTTranslate(explainText, patentNo, patentField);
             }
 //            try {
@@ -290,6 +293,7 @@ public class TranslateService {
 
     /**
      * 添加权利要求原文
+     *
      * @param claim
      * @param patentNo
      * @param patentField
@@ -326,6 +330,7 @@ public class TranslateService {
 
     /**
      * 添加原文说明书
+     *
      * @param text
      * @param patentNo
      * @param patentField
@@ -532,7 +537,7 @@ public class TranslateService {
         Query q2 = QueryBuilders.term(t -> t.field("patent_field").value("3"));
         Query q3 = QueryBuilders.term(t -> t.field("content.order").value(sort));
         Query q4 = QueryBuilders.term(i -> i.field("language").value("CN"));
-        Query bool = QueryBuilders.bool(i -> i.must(q1, q2, q3,q4));
+        Query bool = QueryBuilders.bool(i -> i.must(q1, q2, q3, q4));
         builder.query(bool);
         builder.size(1000);
         builder.trackTotalHits(i -> i.enabled(true));

+ 20 - 20
src/main/resources/jsons/importTask.json

@@ -97,32 +97,32 @@
     "ifAsCondition": "false"
   },
   {
-    "name": "总数",
-    "type": "Integer",
-    "value": "allNum",
-    "field": "allNum",
-    "sqlField": "it.all_num",
-    "sqlClass": "getComSql",
-    "orderClass": "getComOrder",
-    "groupClass": "getTimeGroup",
-    "ifSearch": "true",
+    "name": "导入内容",
+    "type": "String",
+    "value": "importContentName",
+    "field": "importContentName",
+    "sqlField": "it.create_id",
+    "sqlClass": "getCreateNameSql",
+    "orderClass": "getCreateNameOrder",
+    "groupClass": "getComGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "false"
   },
   {
-    "name": "完成条数",
-    "type": "Integer",
-    "value": "doneNum",
-    "field": "doneNum",
-    "sqlField": "it.done_num",
-    "sqlClass": "getComSql",
-    "orderClass": "getComOrder",
-    "groupClass": "getTimeGroup",
-    "ifSearch": "true",
+    "name": "导入到",
+    "type": "String",
+    "value": "importToName",
+    "field": "importToName",
+    "sqlField": "it.create_id",
+    "sqlClass": "getCreateNameSql",
+    "orderClass": "getCreateNameOrder",
+    "groupClass": "getComGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
     "ifShow": "true",
-    "ifAsCondition": "true"
+    "ifAsCondition": "false"
   },
   {
     "name": "创建人",