|
@@ -2,7 +2,6 @@ package cn.cslg.report.service.business;
|
|
|
|
|
|
import cn.cslg.report.common.model.SystemMO;
|
|
import cn.cslg.report.common.model.SystemMO;
|
|
import cn.cslg.report.common.model.vo.CompareMessageVO;
|
|
import cn.cslg.report.common.model.vo.CompareMessageVO;
|
|
-import cn.cslg.report.common.model.vo.PatentRightVo;
|
|
|
|
import cn.cslg.report.common.model.vo.PatentVO;
|
|
import cn.cslg.report.common.model.vo.PatentVO;
|
|
import cn.cslg.report.common.model.vo.PersonnelVO;
|
|
import cn.cslg.report.common.model.vo.PersonnelVO;
|
|
import cn.cslg.report.common.utils.*;
|
|
import cn.cslg.report.common.utils.*;
|
|
@@ -10,7 +9,6 @@ import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.asso.AssoRecordsFeature;
|
|
import cn.cslg.report.entity.asso.AssoRecordsFeature;
|
|
import cn.cslg.report.mapper.ReportDocumentMapper;
|
|
import cn.cslg.report.mapper.ReportDocumentMapper;
|
|
-
|
|
|
|
import cn.cslg.report.service.OutInterfaceService;
|
|
import cn.cslg.report.service.OutInterfaceService;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -22,22 +20,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
import com.deepoove.poi.config.Configure;
|
|
import com.deepoove.poi.config.Configure;
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
|
-import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.apache.poi.poifs.filesystem.DirectoryEntry;
|
|
|
|
-import org.apache.poi.poifs.filesystem.DocumentEntry;
|
|
|
|
-import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
|
|
|
-import org.apache.poi.ss.formula.functions.T;
|
|
|
|
import org.ddr.poi.html.HtmlRenderPolicy;
|
|
import org.ddr.poi.html.HtmlRenderPolicy;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
-import java.io.FileInputStream;
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -68,6 +59,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
private String rmsFile;
|
|
private String rmsFile;
|
|
@Value("${PASFile}")
|
|
@Value("${PASFile}")
|
|
private String pasFile;
|
|
private String pasFile;
|
|
|
|
+
|
|
public String reportDocument(ReportDocument reportDocument) {
|
|
public String reportDocument(ReportDocument reportDocument) {
|
|
|
|
|
|
return Response.success();
|
|
return Response.success();
|
|
@@ -104,7 +96,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
Template reportTemplate = templateService.getById(templeId);
|
|
Template reportTemplate = templateService.getById(templeId);
|
|
//获得模板路径
|
|
//获得模板路径
|
|
String filePath = fileUtils.getPath(reportTemplate.getTemplatePath());
|
|
String filePath = fileUtils.getPath(reportTemplate.getTemplatePath());
|
|
- // 读取模板后保存生成word的地址
|
|
|
|
|
|
+ //读取模板后保存生成word的地址
|
|
String fileName = IdUtil.simpleUUID() + ".docx";
|
|
String fileName = IdUtil.simpleUUID() + ".docx";
|
|
String directoryName = fileUtils.createDirectory();
|
|
String directoryName = fileUtils.createDirectory();
|
|
String outPath = fileUtils.getSavePath(directoryName) + fileName;
|
|
String outPath = fileUtils.getSavePath(directoryName) + fileName;
|
|
@@ -114,9 +106,10 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
template = this.getstabilityTemplate(report, filePath);
|
|
template = this.getstabilityTemplate(report, filePath);
|
|
} else if (report.getType() == 3) {
|
|
} else if (report.getType() == 3) {
|
|
template = this.FTOtemplate(reportId, filePath, templeId);
|
|
template = this.FTOtemplate(reportId, filePath, templeId);
|
|
- }
|
|
|
|
- else if(report.getType()==4){
|
|
|
|
|
|
+ } else if (report.getType() == 4) {
|
|
template = this.Torttemplate(reportId, filePath, templeId);
|
|
template = this.Torttemplate(reportId, filePath, templeId);
|
|
|
|
+ } else if (report.getType() == 5) {
|
|
|
|
+ template = this.avoidDesignTemplate(reportId, filePath, templeId);
|
|
}
|
|
}
|
|
// 读取模板、数据并渲染
|
|
// 读取模板、数据并渲染
|
|
// 文件是否已存在,则删除
|
|
// 文件是否已存在,则删除
|
|
@@ -150,7 +143,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
*/
|
|
*/
|
|
private XWPFTemplate getstabilityTemplate(Report report, String filePath) throws IOException {
|
|
private XWPFTemplate getstabilityTemplate(Report report, String filePath) throws IOException {
|
|
//装载标的专利信息
|
|
//装载标的专利信息
|
|
- Map<String,Object> signPatent = this.signPantentMess(report.getSignPatentNo());
|
|
|
|
|
|
+ Map<String, Object> signPatent = this.signPantentMess(report.getSignPatentNo());
|
|
//根据报告Id获得报告信息
|
|
//根据报告Id获得报告信息
|
|
// 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
// 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
@@ -173,7 +166,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
//获得对比记录-特征关联ID
|
|
//获得对比记录-特征关联ID
|
|
List<Integer> recordfeatureRecordIds = scenariosRecords.stream().map(AssoScenarIOS::getFeatureRecordID).collect(Collectors.toList());
|
|
List<Integer> recordfeatureRecordIds = scenariosRecords.stream().map(AssoScenarIOS::getFeatureRecordID).collect(Collectors.toList());
|
|
//从关联表里获得是公识的特征Id
|
|
//从关联表里获得是公识的特征Id
|
|
- List<Integer> knowedIds= scenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> knowedIds = scenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
//根据对比记录-特征关联ID查出对比记录-特征关联信息
|
|
//根据对比记录-特征关联ID查出对比记录-特征关联信息
|
|
List<AssoRecordsFeature> assoRecordsFeatures = new ArrayList<>();
|
|
List<AssoRecordsFeature> assoRecordsFeatures = new ArrayList<>();
|
|
if (recordfeatureRecordIds != null && recordfeatureRecordIds.size() != 0) {
|
|
if (recordfeatureRecordIds != null && recordfeatureRecordIds.size() != 0) {
|
|
@@ -206,18 +199,19 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
PatentVO patentVO = new PatentVO();
|
|
PatentVO patentVO = new PatentVO();
|
|
patentVO.setPatentNos(PatentNos);
|
|
patentVO.setPatentNos(PatentNos);
|
|
//根据专利号查询专利的排序
|
|
//根据专利号查询专利的排序
|
|
- LambdaQueryWrapper<CompareFiles> comWrapper =new LambdaQueryWrapper<>();
|
|
|
|
|
|
+ LambdaQueryWrapper<CompareFiles> comWrapper = new LambdaQueryWrapper<>();
|
|
comWrapper
|
|
comWrapper
|
|
- .eq(CompareFiles::getReportId,report.getId())
|
|
|
|
- .last("ORDER BY IF(isnull(SYS_ORDER),1,0), SYS_ORDER ASC");;
|
|
|
|
- List<CompareFiles> compareFiles =compareFilesService.list(comWrapper);
|
|
|
|
|
|
+ .eq(CompareFiles::getReportId, report.getId())
|
|
|
|
+ .last("ORDER BY IF(isnull(SYS_ORDER),1,0), SYS_ORDER ASC");
|
|
|
|
+ ;
|
|
|
|
+ List<CompareFiles> compareFiles = compareFilesService.list(comWrapper);
|
|
//专利号别名的map
|
|
//专利号别名的map
|
|
Map<String, Object> OtherName = new HashMap<>();
|
|
Map<String, Object> OtherName = new HashMap<>();
|
|
- int flag=1;
|
|
|
|
- for(CompareFiles item:compareFiles)
|
|
|
|
- { Integer order = item.getSysOrder()==null?flag:item.getSysOrder();
|
|
|
|
- OtherName.put(item.getPatentNo(),order);
|
|
|
|
- flag++;
|
|
|
|
|
|
+ int flag = 1;
|
|
|
|
+ for (CompareFiles item : compareFiles) {
|
|
|
|
+ Integer order = item.getSysOrder() == null ? flag : item.getSysOrder();
|
|
|
|
+ OtherName.put(item.getPatentNo(), order);
|
|
|
|
+ flag++;
|
|
}
|
|
}
|
|
|
|
|
|
//根据专利号查询专利详细信息
|
|
//根据专利号查询专利详细信息
|
|
@@ -255,7 +249,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
feaListContent.forEach(te -> disclosures.append("(" + te + ")"));
|
|
feaListContent.forEach(te -> disclosures.append("(" + te + ")"));
|
|
disclosures.append("\n");
|
|
disclosures.append("\n");
|
|
}
|
|
}
|
|
- int order=Integer.parseInt(OtherName.get(item.get("publicNo")).toString());
|
|
|
|
|
|
+ int order = Integer.parseInt(OtherName.get(item.get("publicNo")).toString());
|
|
|
|
|
|
patentListMap.put("name", item.get("name"));
|
|
patentListMap.put("name", item.get("name"));
|
|
patentListMap.put("fileName", "D" + order);
|
|
patentListMap.put("fileName", "D" + order);
|
|
@@ -265,11 +259,11 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
patentListMap.put("applicant", applicants);
|
|
patentListMap.put("applicant", applicants);
|
|
patentListMap.put("patentNo", item.get("publicNo"));
|
|
patentListMap.put("patentNo", item.get("publicNo"));
|
|
patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
- patentListMap.put("compareFileName", "对比文件" + (order ));
|
|
|
|
|
|
+ patentListMap.put("compareFileName", "对比文件" + (order));
|
|
patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
patentListMap.put("abstractPath", pasFile + item.get("abstractPath"));
|
|
patentListMap.put("abstractPath", pasFile + item.get("abstractPath"));
|
|
patentListMap.put("disclosures", disclosures);
|
|
patentListMap.put("disclosures", disclosures);
|
|
- patentListMap.put("order",order);
|
|
|
|
|
|
+ patentListMap.put("order", order);
|
|
patentListMaps.add(patentListMap);
|
|
patentListMaps.add(patentListMap);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -313,71 +307,67 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
allRightFeatures.forEach(tem -> {
|
|
allRightFeatures.forEach(tem -> {
|
|
|
|
|
|
- List<AssoRecordsFeature> assoRecordsFeatures2 = assoRecordsFeatures1.stream().filter(item -> item.getFeatureId().equals(tem.getId())).collect(Collectors.toList());
|
|
|
|
- if(comFetIds.contains(tem.getId())){
|
|
|
|
- Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
- map.put("featureContent", tem.getContent());
|
|
|
|
- map.put("compareResult","公识");
|
|
|
|
- map.put("compareContent", "");
|
|
|
|
- maps.add(map);
|
|
|
|
- }
|
|
|
|
- else if(assoRecordsFeatures2.size()!=0) {
|
|
|
|
- Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
- map.put("featureContent", tem.getContent());
|
|
|
|
- List<Map<String,Object>> temMap1=new ArrayList<>();
|
|
|
|
- AssoRecordsFeature assoRecordsFeature =assoRecordsFeatures2.get(0);
|
|
|
|
- CompareRecords record = records.stream().filter(item -> item.getId().equals(assoRecordsFeature.getRecordsId())).findFirst().orElse(new CompareRecords());
|
|
|
|
- String compareContent = "";
|
|
|
|
- //获取对比内容
|
|
|
|
- String content = record.getContent() != null ? record.getContent() : "";
|
|
|
|
- //获得对比专利号
|
|
|
|
- String patentNo = record.getPatentNo() != null ? record.getPatentNo() : "";
|
|
|
|
- if (OtherName.containsKey(patentNo)) {
|
|
|
|
- patentNo ="D"+ OtherName.get(patentNo).toString() + ":";
|
|
|
|
- } else if (!patentNo.equals("")) {
|
|
|
|
- patentNo += ":";
|
|
|
|
- }
|
|
|
|
- //获得解析过程
|
|
|
|
- String paresingProcess = record.getParesingProcess() != null ? "(" + record.getParesingProcess() + ")" : "";
|
|
|
|
- compareContent = patentNo + content + paresingProcess;
|
|
|
|
- //获取对比专利号
|
|
|
|
- if(maps.size()>0) {
|
|
|
|
- Map<String, Object> lastMap = maps.get(maps.size() - 1);
|
|
|
|
- if (lastMap.get("compareContent").toString().equals(compareContent)) {
|
|
|
|
- lastMap.put("featureContent", lastMap.get("featureContent") + tem.getContent());
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "不公开");
|
|
|
|
- map.put("compareContent", compareContent);
|
|
|
|
- map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
|
|
|
|
- if (record.getFields() == null && record.getPosition() == null) {
|
|
|
|
- map.put("position", "");
|
|
|
|
- } else {
|
|
|
|
- map.put("position", "\r" + "(" + record.getFields() + "[" + record.getPosition() + "]" + ")");
|
|
|
|
- }
|
|
|
|
- maps.add(map);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "不公开");
|
|
|
|
- map.put("compareContent", compareContent);
|
|
|
|
- map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
|
|
|
|
- if (record.getFields() == null && record.getPosition() == null) {
|
|
|
|
- map.put("position", "");
|
|
|
|
- } else {
|
|
|
|
- map.put("position", "\r" + "(" + record.getFields() + "[" + record.getPosition() + "]" + ")");
|
|
|
|
- }
|
|
|
|
- maps.add(map);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
- map.put("featureContent", tem.getContent());
|
|
|
|
- map.put("compareResult","未公开");
|
|
|
|
- map.put("compareContent", "");
|
|
|
|
- maps.add(map);
|
|
|
|
- }
|
|
|
|
|
|
+ List<AssoRecordsFeature> assoRecordsFeatures2 = assoRecordsFeatures1.stream().filter(item -> item.getFeatureId().equals(tem.getId())).collect(Collectors.toList());
|
|
|
|
+ if (comFetIds.contains(tem.getId())) {
|
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
+ map.put("featureContent", tem.getContent());
|
|
|
|
+ map.put("compareResult", "公识");
|
|
|
|
+ map.put("compareContent", "");
|
|
|
|
+ maps.add(map);
|
|
|
|
+ } else if (assoRecordsFeatures2.size() != 0) {
|
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
+ map.put("featureContent", tem.getContent());
|
|
|
|
+ List<Map<String, Object>> temMap1 = new ArrayList<>();
|
|
|
|
+ AssoRecordsFeature assoRecordsFeature = assoRecordsFeatures2.get(0);
|
|
|
|
+ CompareRecords record = records.stream().filter(item -> item.getId().equals(assoRecordsFeature.getRecordsId())).findFirst().orElse(new CompareRecords());
|
|
|
|
+ String compareContent = "";
|
|
|
|
+ //获取对比内容
|
|
|
|
+ String content = record.getContent() != null ? record.getContent() : "";
|
|
|
|
+ //获得对比专利号
|
|
|
|
+ String patentNo = record.getPatentNo() != null ? record.getPatentNo() : "";
|
|
|
|
+ if (OtherName.containsKey(patentNo)) {
|
|
|
|
+ patentNo = "D" + OtherName.get(patentNo).toString() + ":";
|
|
|
|
+ } else if (!patentNo.equals("")) {
|
|
|
|
+ patentNo += ":";
|
|
|
|
+ }
|
|
|
|
+ //获得解析过程
|
|
|
|
+ String paresingProcess = record.getParesingProcess() != null ? "(" + record.getParesingProcess() + ")" : "";
|
|
|
|
+ compareContent = patentNo + content + paresingProcess;
|
|
|
|
+ //获取对比专利号
|
|
|
|
+ if (maps.size() > 0) {
|
|
|
|
+ Map<String, Object> lastMap = maps.get(maps.size() - 1);
|
|
|
|
+ if (lastMap.get("compareContent").toString().equals(compareContent)) {
|
|
|
|
+ lastMap.put("featureContent", lastMap.get("featureContent") + tem.getContent());
|
|
|
|
+ } else {
|
|
|
|
+ map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "不公开");
|
|
|
|
+ map.put("compareContent", compareContent);
|
|
|
|
+ map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
|
|
|
|
+ if (record.getFields() == null && record.getPosition() == null) {
|
|
|
|
+ map.put("position", "");
|
|
|
|
+ } else {
|
|
|
|
+ map.put("position", "\r" + "(" + record.getFields() + "[" + record.getPosition() + "]" + ")");
|
|
|
|
+ }
|
|
|
|
+ maps.add(map);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "不公开");
|
|
|
|
+ map.put("compareContent", compareContent);
|
|
|
|
+ map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
|
|
|
|
+ if (record.getFields() == null && record.getPosition() == null) {
|
|
|
|
+ map.put("position", "");
|
|
|
|
+ } else {
|
|
|
|
+ map.put("position", "\r" + "(" + record.getFields() + "[" + record.getPosition() + "]" + ")");
|
|
|
|
+ }
|
|
|
|
+ maps.add(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
+ map.put("featureContent", tem.getContent());
|
|
|
|
+ map.put("compareResult", "未公开");
|
|
|
|
+ map.put("compareContent", "");
|
|
|
|
+ maps.add(map);
|
|
|
|
+ }
|
|
|
|
|
|
});
|
|
});
|
|
//方案内容
|
|
//方案内容
|
|
@@ -398,7 +388,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
List<Integer> temFIds = finalAsso.stream().filter(tm -> temRecordIds.contains(tm.getRecordsId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
List<Integer> temFIds = finalAsso.stream().filter(tm -> temRecordIds.contains(tm.getRecordsId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
String tmName = item;
|
|
String tmName = item;
|
|
if (OtherName.containsKey(item)) {
|
|
if (OtherName.containsKey(item)) {
|
|
- tmName = "D"+OtherName.get(item).toString();
|
|
|
|
|
|
+ tmName = "D" + OtherName.get(item).toString();
|
|
}
|
|
}
|
|
if (temFIds.size() == allRightFeatures.size()) {
|
|
if (temFIds.size() == allRightFeatures.size()) {
|
|
noveltyFiles.add(tmName);
|
|
noveltyFiles.add(tmName);
|
|
@@ -412,7 +402,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
item -> {
|
|
item -> {
|
|
String tmName = item.getPatentNo();
|
|
String tmName = item.getPatentNo();
|
|
if (OtherName.containsKey(tmName)) {
|
|
if (OtherName.containsKey(tmName)) {
|
|
- tmName = "D"+OtherName.get(tmName).toString();
|
|
|
|
|
|
+ tmName = "D" + OtherName.get(tmName).toString();
|
|
}
|
|
}
|
|
if (!creativeFiles.contains(tmName)) {
|
|
if (!creativeFiles.contains(tmName)) {
|
|
creativeFiles.add(tmName);
|
|
creativeFiles.add(tmName);
|
|
@@ -474,20 +464,20 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
String[] ds = date.split("-");
|
|
String[] ds = date.split("-");
|
|
map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
|
|
map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
|
|
- if(patentListMaps.size()>1){
|
|
|
|
- patentListMaps=this.sortMap(patentListMaps);
|
|
|
|
|
|
+ if (patentListMaps.size() > 1) {
|
|
|
|
+ patentListMaps = this.sortMap(patentListMaps);
|
|
}
|
|
}
|
|
map.put("patentList", patentListMaps);
|
|
map.put("patentList", patentListMaps);
|
|
map.put("combinations", allRightScenarios);
|
|
map.put("combinations", allRightScenarios);
|
|
map.put("allResults", resultMaps);
|
|
map.put("allResults", resultMaps);
|
|
- map.put("signPatent",signPatent);
|
|
|
|
- map.put("pantentNo",report.getSignPatentNo());
|
|
|
|
- map.put("rights",signPatent.get("rights"));
|
|
|
|
|
|
+ map.put("signPatent", signPatent);
|
|
|
|
+ map.put("pantentNo", report.getSignPatentNo());
|
|
|
|
+ map.put("rights", signPatent.get("rights"));
|
|
// 为表格的显示绑定行循环
|
|
// 为表格的显示绑定行循环
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
// 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
|
|
// 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
|
|
- Configure configure = Configure.builder().bind("patentList", policy).bind("fileDetails", policy).bind("allResults", policy).bind("signPatent.rights",policy).bind("remark", htmlRenderPolicy).build();
|
|
|
|
|
|
+ Configure configure = Configure.builder().bind("patentList", policy).bind("fileDetails", policy).bind("allResults", policy).bind("signPatent.rights", policy).bind("remark", htmlRenderPolicy).build();
|
|
// 读取模板、数据并渲染
|
|
// 读取模板、数据并渲染
|
|
XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
return template;
|
|
return template;
|
|
@@ -627,93 +617,100 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
* @description 装载侵权分析模板
|
|
* @description 装载侵权分析模板
|
|
*/
|
|
*/
|
|
private XWPFTemplate Torttemplate(Integer reportId, String filePath, Integer templateId) throws IOException {
|
|
private XWPFTemplate Torttemplate(Integer reportId, String filePath, Integer templateId) throws IOException {
|
|
- //根据报告Id查询标的专利号
|
|
|
|
- Report report =reportService.getById(reportId);
|
|
|
|
- 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);
|
|
|
|
|
|
+ //根据报告Id查询标的专利号
|
|
|
|
+ Report report = reportService.getById(reportId);
|
|
|
|
+ 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);
|
|
//装载单个专利的信息
|
|
//装载单个专利的信息
|
|
Map<String, Object> patentMap = new HashMap<>();
|
|
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"));
|
|
|
|
- //图示
|
|
|
|
- patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
|
|
|
|
- //获得专利对比记录的信息
|
|
|
|
- Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
|
|
|
|
- List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
|
|
|
|
- //装载对比记录的信息
|
|
|
|
- patentMap.put("cM", compareMessageVOS);
|
|
|
|
- patentMap.put("rightNum", temMap.get("right"));
|
|
|
|
- patentMap.put("mainRightNum", temMap.get("mainRight"));
|
|
|
|
|
|
+ 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"));
|
|
|
|
+ //图示
|
|
|
|
+ patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
|
|
|
|
+ //获得专利对比记录的信息
|
|
|
|
+ Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
|
|
|
|
+ List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
|
|
|
|
+ //装载对比记录的信息
|
|
|
|
+ patentMap.put("cM", compareMessageVOS);
|
|
|
|
+ patentMap.put("rightNum", temMap.get("right"));
|
|
|
|
+ patentMap.put("mainRightNum", temMap.get("mainRight"));
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
String[] ds = date.split("-");
|
|
String[] ds = date.split("-");
|
|
map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
|
|
map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
|
|
map.put("patentMap", patentMap);
|
|
map.put("patentMap", patentMap);
|
|
- map.put("",patentNo);
|
|
|
|
|
|
+ map.put("", patentNo);
|
|
// 为表格的显示绑定行循环
|
|
// 为表格的显示绑定行循环
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
// 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
|
|
// 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
|
|
- Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription",htmlRenderPolicy).build();
|
|
|
|
|
|
+ Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
|
|
XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
return template;
|
|
return template;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private XWPFTemplate avoidDesignTemplate(Integer reportId, String filePath, Integer templateId) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* function:删除报告时删除
|
|
* function:删除报告时删除
|
|
*/
|
|
*/
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public String deleteByReportId(Integer id){
|
|
|
|
|
|
+ public String deleteByReportId(Integer id) {
|
|
LambdaQueryWrapper<ReportDocument> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReportDocument> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(ReportDocument::getReportId, id);
|
|
wrapper.eq(ReportDocument::getReportId, id);
|
|
remove(wrapper);
|
|
remove(wrapper);
|
|
return Response.success();
|
|
return Response.success();
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<String,Object> signPantentMess(String patentNo) throws IOException {
|
|
|
|
|
|
+ public Map<String, Object> signPantentMess(String patentNo) throws IOException {
|
|
PatentVO patentVO = new PatentVO();
|
|
PatentVO patentVO = new PatentVO();
|
|
patentVO.setPatentNos(Arrays.asList(patentNo));
|
|
patentVO.setPatentNos(Arrays.asList(patentNo));
|
|
//根据专利号查询专利详细信息
|
|
//根据专利号查询专利详细信息
|
|
@@ -739,7 +736,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
//公开日
|
|
//公开日
|
|
patentMap.put("publicDate", patent.get("publicDate"));
|
|
patentMap.put("publicDate", patent.get("publicDate"));
|
|
//公开号
|
|
//公开号
|
|
- patentMap.put("publicNo",patent.get("publicNo"));
|
|
|
|
|
|
+ patentMap.put("publicNo", patent.get("publicNo"));
|
|
//专利号
|
|
//专利号
|
|
patentMap.put("patentNo", patent.get("patentNo"));
|
|
patentMap.put("patentNo", patent.get("patentNo"));
|
|
//专利权人
|
|
//专利权人
|
|
@@ -752,32 +749,33 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
JSONObject jsonObject2 = JSONObject.parseObject(resBody2);
|
|
JSONObject jsonObject2 = JSONObject.parseObject(resBody2);
|
|
//解析jason获得标的专利的权要
|
|
//解析jason获得标的专利的权要
|
|
List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject2.getString("data"), PatentRight.class);
|
|
List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject2.getString("data"), PatentRight.class);
|
|
- List<Map<String,Object>> rights =new ArrayList<>();
|
|
|
|
- patentRightsOrgin.forEach(item->{
|
|
|
|
- Map<String,Object> temMap =new HashMap<>();
|
|
|
|
- temMap.put("rightName","权"+item.getSort());
|
|
|
|
- temMap.put("content",item.getContent());
|
|
|
|
|
|
+ List<Map<String, Object>> rights = new ArrayList<>();
|
|
|
|
+ patentRightsOrgin.forEach(item -> {
|
|
|
|
+ Map<String, Object> temMap = new HashMap<>();
|
|
|
|
+ temMap.put("rightName", "权" + item.getSort());
|
|
|
|
+ temMap.put("content", item.getContent());
|
|
rights.add(temMap);
|
|
rights.add(temMap);
|
|
});
|
|
});
|
|
- patentMap.put("rights",rights);
|
|
|
|
- return patentMap;
|
|
|
|
|
|
+ patentMap.put("rights", rights);
|
|
|
|
+ return patentMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<Map<String, Object>> sortMap(List<Map<String, Object>> maps) {
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < maps.size() - 1; i++) {
|
|
|
|
+ for (int j = 0; j < maps.size() - i - 1; j++) {
|
|
|
|
+ Integer order1 = Integer.parseInt(maps.get(j).get("order").toString());
|
|
|
|
+ Integer order2 = Integer.parseInt(maps.get(j + 1).get("order").toString());
|
|
|
|
+ if (order1 > order2) {
|
|
|
|
+ Map<String, Object> temp = maps.get(j);
|
|
|
|
+ maps.set(j, maps.get(j + 1));
|
|
|
|
+ maps.set(j + 1, temp);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return maps;
|
|
}
|
|
}
|
|
- public List<Map<String,Object>> sortMap(List<Map<String,Object>> maps){
|
|
|
|
-
|
|
|
|
- for(int i=0;i<maps.size()-1;i++) {
|
|
|
|
- for (int j = 0; j < maps.size() - i - 1; j++) {
|
|
|
|
- Integer order1 = Integer.parseInt(maps.get(j).get("order").toString());
|
|
|
|
- Integer order2 =Integer.parseInt(maps.get(j+1).get("order").toString());
|
|
|
|
- if (order1 > order2) {
|
|
|
|
- Map<String,Object> temp = maps.get(j);
|
|
|
|
- maps.set(j,maps.get(j+1));
|
|
|
|
- maps.set(j+1,temp);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return maps;
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|