|
@@ -11,11 +11,15 @@ import cn.cslg.pas.common.vo.*;
|
|
|
import cn.cslg.pas.domain.ReportDocument;
|
|
|
import cn.cslg.pas.domain.business.*;
|
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
|
+import cn.cslg.pas.domain.es.PatentPerson;
|
|
|
import cn.cslg.pas.domain.es.Text;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.AvoidDesignMapper;
|
|
|
import cn.cslg.pas.service.business.*;
|
|
|
import cn.cslg.pas.service.business.es.*;
|
|
|
+import cn.cslg.pas.service.business.invalidReport.AssoReasonLiteratureService;
|
|
|
+import cn.cslg.pas.service.business.invalidReport.EvidenceReasonService;
|
|
|
+import cn.cslg.pas.service.business.stabilityReport.AssoGroupReasonService;
|
|
|
import cn.cslg.pas.service.common.FileManagerService;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -28,6 +32,7 @@ import com.deepoove.poi.data.PictureType;
|
|
|
import com.deepoove.poi.data.Pictures;
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.ddr.poi.html.HtmlRenderPolicy;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -78,6 +83,20 @@ public class ReportExportService {
|
|
|
private CacheUtils cacheUtils;
|
|
|
@Autowired
|
|
|
private EsLegalEventService esLegalEventService;
|
|
|
+ @Autowired
|
|
|
+ private FeatureService featureService;
|
|
|
+ @Autowired
|
|
|
+ private PatentSplitMessageService patentSplitMessageService;
|
|
|
+ @Autowired
|
|
|
+ private ProofGroupService proofGroupService;
|
|
|
+ @Autowired
|
|
|
+ private AssoGroupReasonService assoGroupReasonService;
|
|
|
+ @Autowired
|
|
|
+ private AssoReasonLiteratureService assoReasonLiteratureService;
|
|
|
+ @Autowired
|
|
|
+ private CompareLiteratureService compareLiteratureService;
|
|
|
+ @Autowired
|
|
|
+ private EvidenceReasonService evidenceReasonService;
|
|
|
|
|
|
/**
|
|
|
* @param projectId
|
|
@@ -105,7 +124,7 @@ public class ReportExportService {
|
|
|
}
|
|
|
XWPFTemplate template = null;
|
|
|
if (report.getReportType() == 0 || report.getReportType() == 2) {
|
|
|
-// template = this.getstabilityTemplate(projectId, templateFilePath);
|
|
|
+ template = this.getstabilityTemplate(projectId, templateFilePath);
|
|
|
} else if (report.getReportType() == 3) {
|
|
|
template = this.FTOTemplate(projectId, templateFilePath, templeId);
|
|
|
} else if (report.getReportType() == 4) {
|
|
@@ -273,7 +292,9 @@ public class ReportExportService {
|
|
|
private PictureRenderData guidToStream(String guid) {
|
|
|
PictureRenderData pictureRenderData = null;
|
|
|
byte[] bytes = null;
|
|
|
-
|
|
|
+ if (guid == null) {
|
|
|
+ return pictureRenderData;
|
|
|
+ }
|
|
|
try {
|
|
|
bytes = fileManagerService.downloadSystemFileFromFMS(guid);
|
|
|
} catch (Exception e) {
|
|
@@ -475,421 +496,490 @@ public class ReportExportService {
|
|
|
return template;
|
|
|
|
|
|
}
|
|
|
-// private XWPFTemplate getstabilityTemplate(Integer projectId, String filePath) throws IOException {
|
|
|
-// List<PatentRight> patentRights = new ArrayList<>();
|
|
|
-//
|
|
|
-// //装载标的专利信息
|
|
|
-// LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper.eq(ReportProject::getProjectId, projectId);
|
|
|
-// ReportProject report = reportProjectService.getOne(queryWrapper, false);
|
|
|
-// String signPatentNo = report.getSignPatentNo();
|
|
|
-// Map<String, Object> signPatent = this.signPantentMess(signPatentNo);
|
|
|
-// //根据报告Id获得报告信息
|
|
|
-// // 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
|
-// LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
|
-// allFeaturesWrapper.eq(Features::getReportId, report.getId());
|
|
|
-// allFeaturesWrapper.and(wrapper -> wrapper.eq(Features::getPartnerId, report.getPersonId()).or().eq(Features::getPartnerId, report.getCreatePersonId()));
|
|
|
-//
|
|
|
-// List<Features> allFeatures = featureService.list(allFeaturesWrapper);
|
|
|
-// //根据报告Id 查询出报告下所有的方案
|
|
|
-// LambdaQueryWrapper<CompareScenarios> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
-// queryWrapper.eq(CompareScenarios::getReportId, report.getId());
|
|
|
-// List<CompareScenarios> compareScenarios = compareScenariosService.list(queryWrapper);
|
|
|
-// List<Integer> scenarioIds = compareScenarios.stream().map(CompareScenarios::getId).collect(Collectors.toList());
|
|
|
-// //根据对比方案Id 查询所有对比方案和(对比记录-特征)关联信息
|
|
|
-// List<AssoScenarIOS> scenariosRecords = new ArrayList<>();
|
|
|
-// if (scenarioIds != null && scenarioIds.size() != 0) {
|
|
|
-// LambdaQueryWrapper<AssoScenarIOS> queryRecordsByIDs = new LambdaQueryWrapper<>();
|
|
|
-// queryRecordsByIDs.in(AssoScenarIOS::getScenariosID, scenarioIds);
|
|
|
-// scenariosRecords = scenariosRecordsService.list(queryRecordsByIDs);
|
|
|
-// }
|
|
|
-// //获得对比记录-特征关联ID
|
|
|
-// List<Integer> recordfeatureRecordIds = scenariosRecords.stream().map(AssoScenarIOS::getFeatureRecordID).collect(Collectors.toList());
|
|
|
-// //从关联表里获得是公识的特征Id
|
|
|
-// List<Integer> knowedIds = scenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
|
-// //根据对比记录-特征关联ID查出对比记录-特征关联信息
|
|
|
-// List<AssoRecordsFeature> assoRecordsFeatures = new ArrayList<>();
|
|
|
-// if (recordfeatureRecordIds != null && recordfeatureRecordIds.size() != 0) {
|
|
|
-// LambdaQueryWrapper<AssoRecordsFeature> wrapper = new LambdaQueryWrapper<>();
|
|
|
-// wrapper.in(AssoRecordsFeature::getId, recordfeatureRecordIds);
|
|
|
-// assoRecordsFeatures = assoRecordsFeatureService.list(wrapper);
|
|
|
-// }
|
|
|
-// List<AssoRecordsFeature> finalAsso = assoRecordsFeatures;
|
|
|
-// //从对比记录-特征关联信息里剔出对比记录Id
|
|
|
-// List<Integer> recordIds = assoRecordsFeatures.stream().map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
|
|
|
-// //从对比记录-特征关联信息里剔出特征Id
|
|
|
-// List<Integer> sFeatureIds = assoRecordsFeatures.stream().map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
-// sFeatureIds.addAll(knowedIds);
|
|
|
-// //根据特征ID查询出报告所有方案的特征
|
|
|
-// List<Features> sFeatures = new ArrayList<>();
|
|
|
-// LambdaQueryWrapper<Features> sFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
|
-// sFeaturesWrapper.eq(Features::getId, sFeatureIds);
|
|
|
-// if (sFeatures != null && sFeatures.size() != 0) {
|
|
|
-// sFeatures = featureService.list(sFeaturesWrapper);
|
|
|
-// }
|
|
|
-// //根据对比记录ID查询出报告所有方案的对比记录
|
|
|
-// List<CompareRecords> compareRecords = new ArrayList<>();
|
|
|
-// if (recordIds != null && recordIds.size() != 0) {
|
|
|
-// LambdaQueryWrapper<CompareRecords> queryPatentByIDs = new LambdaQueryWrapper<>();
|
|
|
-// queryPatentByIDs.in(CompareRecords::getId, recordIds);
|
|
|
-// compareRecords = compareRecordsService.list(queryPatentByIDs);
|
|
|
-// }
|
|
|
-// //根据对比记录ID获得专利号
|
|
|
-// List<String> PatentNos = compareRecords.stream().map(CompareRecords::getPatentNo).collect(Collectors.toList());
|
|
|
-// PatentVO patentVO = new PatentVO();
|
|
|
-// patentVO.setPatentNos(PatentNos);
|
|
|
-// //根据专利号查询专利的排序
|
|
|
-// LambdaQueryWrapper<CompareFiles> comWrapper = new LambdaQueryWrapper<>();
|
|
|
-// 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<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++;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //根据专利号查询专利详细信息
|
|
|
-// String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
|
|
|
-// JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
-// List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
|
|
|
-// //存放专利信息的map集合
|
|
|
-// List<Map<String, Object>> patentListMaps = new ArrayList<>();
|
|
|
-// //填充专利数据到patentListMap
|
|
|
-// for (int i = 0; i < patentDTOS.size(); i++) {
|
|
|
-// JSONObject item = patentDTOS.get(i);
|
|
|
-// Map<String, Object> patentListMap = new HashMap<>();
|
|
|
-// List<JSONObject> applicantJSONs = JSON.parseArray(item.get("applicant").toString(), JSONObject.class);
|
|
|
-// ;
|
|
|
-// StringBuilder applicants = new StringBuilder();
|
|
|
-// applicantJSONs.forEach(tem -> {
|
|
|
-// applicants.append(tem.get("name") + "\r");
|
|
|
-// });
|
|
|
-// //填充相关揭露(对比记录文字和特征组合)
|
|
|
-// StringBuffer disclosures = new StringBuffer("");
|
|
|
-// //根据专利号获得对比记录
|
|
|
-// List<CompareRecords> pantentRecords = compareRecords.stream().filter(tem -> tem.getPatentNo().equals(item.get("publicNo"))).collect(Collectors.toList());
|
|
|
-// //遍历对比记录根据对比记录获得对比记录-特征关联信息并获得特征ID
|
|
|
-// for (CompareRecords tem : pantentRecords) {
|
|
|
-// //填充对比记录文字
|
|
|
-// disclosures.append(tem.getContent());
|
|
|
-// disclosures.append("\r");
|
|
|
-// disclosures.append("(");
|
|
|
-// disclosures.append(tem.getFields());
|
|
|
-// disclosures.append("[" + (tem.getPosition()) + "]");
|
|
|
-// disclosures.append(")");
|
|
|
-// List<Integer> featuresIds = assoRecordsFeatures.stream().filter(te -> te.getRecordsId().equals(tem.getId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
-// //根据特征Id获得特征内容
|
|
|
-// List<String> feaListContent = sFeatures.stream().filter(te -> featuresIds.contains(te.getId())).map(Features::getContent).collect(Collectors.toList());
|
|
|
-// feaListContent.forEach(te -> disclosures.append("(" + te + ")"));
|
|
|
-// disclosures.append("\n");
|
|
|
-// }
|
|
|
-// int order = Integer.parseInt(OtherName.get(item.get("patentNo")).toString());
|
|
|
-//
|
|
|
-// patentListMap.put("name", item.get("name"));
|
|
|
-// patentListMap.put("fileName", "D" + order);
|
|
|
-// patentListMap.put("publicDate", item.get("publicDate"));
|
|
|
-// patentListMap.put("publicNo", item.get("publicNo"));
|
|
|
-// patentListMap.put("SSIM", "");
|
|
|
-// patentListMap.put("applicant", applicants);
|
|
|
-// patentListMap.put("patentNo", item.get("patentNo"));
|
|
|
-// patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
|
-// patentListMap.put("compareFileName", "对比文件" + (order));
|
|
|
-// patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
|
-// patentListMap.put("abstractPath", pasFile + item.get("abstractPath"));
|
|
|
-// patentListMap.put("disclosures", disclosures);
|
|
|
-// patentListMap.put("order", order);
|
|
|
-// patentListMaps.add(patentListMap);
|
|
|
-//
|
|
|
-// }
|
|
|
-// //存放对比方案信息的map集合
|
|
|
-// List<Map<String, Object>> scenariosMaps = new ArrayList<>(compareFiles.size());
|
|
|
-// //存放所有对比方案所有不重复的rightId
|
|
|
-// List<Integer> rightIds = new ArrayList<>();
|
|
|
-// for (int i = 0; i < compareScenarios.size(); i++) {
|
|
|
-// CompareScenarios item1 = compareScenarios.get(i);
|
|
|
-// //获得单个对比方案的
|
|
|
-// List<AssoScenarIOS> partScenariosRecords = scenariosRecords.stream().filter(item -> item.getScenariosID().equals(item1.getId())).collect(Collectors.toList());
|
|
|
-// List<Integer> featureRecordsIds = partScenariosRecords.stream().map(AssoScenarIOS::getFeatureRecordID).collect(Collectors.toList());
|
|
|
-// List<AssoRecordsFeature> assoRecordsFeatures1 = assoRecordsFeatures.stream().filter(item -> featureRecordsIds.contains(item.getId())).collect(Collectors.toList());
|
|
|
-// List<Integer> partRecordIds = assoRecordsFeatures1.stream().map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
|
|
|
-// List<Integer> partFetIds = assoRecordsFeatures1.stream().map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
-// //获得公识特征的ID
|
|
|
-// List<Integer> comFetIds = partScenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
|
-// partFetIds.addAll(comFetIds);
|
|
|
-// //获得单个对比方案的权要的所有特征
|
|
|
-// List<Features> partFeatures = allFeatures.stream().filter(item -> partFetIds.contains(item.getId())).collect(Collectors.toList());
|
|
|
-// List<CompareRecords> records = compareRecords.stream().filter(item -> partRecordIds.contains(item.getId())).collect(Collectors.toList());
|
|
|
-// //获得单条权要所有的特征
|
|
|
-// List<Features> allRightFeatures = allFeatures.stream().filter(item -> item.getRightId().equals(item1.getRightId())).collect(Collectors.toList());
|
|
|
-// //存放单条对比结果的map
|
|
|
-// Map<String, Object> temMap = new HashMap<>();
|
|
|
-// String a = partFeatures.get(0).getRightName().replace("\r", "");
|
|
|
-// if (partFeatures.size() != 0 && partFeatures.get(0).getRightType().equals(1)) {
|
|
|
-// temMap.put("rightName", "独立" + a);
|
|
|
-// } else {
|
|
|
-// temMap.put("rightName", "附属" + a);
|
|
|
-// }
|
|
|
-// temMap.put("rightId", item1.getRightId());
|
|
|
-// if (report.getType() == 1) {
|
|
|
-// String rightContent = patentRights.stream().filter(t -> t.getSort().equals(item1.getRightId())).map(PatentRight::getContent).findFirst().orElse("");
|
|
|
-// temMap.put("rightContent", rightContent);
|
|
|
-// }
|
|
|
-// temMap.put("remark", item1.getContrastResult());
|
|
|
-// // 从关联数据里获得特征id
|
|
|
-// if (!rightIds.contains(item1.getRightId())) {
|
|
|
-// rightIds.add(item1.getRightId());
|
|
|
-// }
|
|
|
-// //存放对比方案每一个特征记录
|
|
|
-// List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
-// 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);
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
-// //方案内容
|
|
|
-// temMap.put("fileDetails", maps);
|
|
|
-// //新颖性模块
|
|
|
-// //获得本方案所有的专利号
|
|
|
-// List<String> patentNOs = new ArrayList<>();
|
|
|
-// records.forEach(item -> {
|
|
|
-// if (!patentNOs.contains(item.getPatentNo())) {
|
|
|
-// patentNOs.add(item.getPatentNo());
|
|
|
-// }
|
|
|
-// });
|
|
|
-// //比较所有专利号和权要所有权要的大小,如果相等则将该专利加入到新颖性列表中
|
|
|
-// List<String> noveltyFiles = new ArrayList<>();
|
|
|
-// patentNOs.forEach(
|
|
|
-// item -> {
|
|
|
-// List<Integer> temRecordIds = records.stream().filter(tm -> tm.getPatentNo().equals(item)).map(CompareRecords::getId).collect(Collectors.toList());
|
|
|
-// List<Integer> temFIds = finalAsso.stream().filter(tm -> temRecordIds.contains(tm.getRecordsId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
-// String tmName = item;
|
|
|
-// if (OtherName.containsKey(item)) {
|
|
|
-// tmName = "D" + OtherName.get(item).toString();
|
|
|
-// }
|
|
|
-// if (temFIds.size() == allRightFeatures.size()) {
|
|
|
-// noveltyFiles.add(tmName);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// );
|
|
|
-// //创造性列表
|
|
|
-// List<String> creativeFiles = new ArrayList<>();
|
|
|
-// //当前方案所有的特征Id
|
|
|
-// records.forEach(
|
|
|
-// item -> {
|
|
|
-// String tmName = item.getPatentNo();
|
|
|
-// if (OtherName.containsKey(tmName)) {
|
|
|
-// tmName = "D" + OtherName.get(tmName).toString();
|
|
|
-// }
|
|
|
-// if (!creativeFiles.contains(tmName)) {
|
|
|
-// creativeFiles.add(tmName);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// );
|
|
|
-// List<AssoScenarIOS> andRecords = partScenariosRecords.stream().filter(tm -> tm.getScenariosID().equals(item1.getId()) && tm.getFeaturesID() != 0).collect(Collectors.toList());
|
|
|
-// if (andRecords.size() != 0) {
|
|
|
-// creativeFiles.add("C");
|
|
|
-// }
|
|
|
-// String creative = creativeFiles.size() == 0 ? "" : StringUtils.join(creativeFiles, "+");
|
|
|
-// String novelty = noveltyFiles.size() == 0 ? "" : StringUtils.join(noveltyFiles, "-");
|
|
|
-// //新颖性
|
|
|
-// temMap.put("novelty", novelty);
|
|
|
-// //创造性
|
|
|
-// temMap.put("creative", creative);
|
|
|
-// scenariosMaps.add(temMap);
|
|
|
-// }
|
|
|
-// List<Map<String, Object>> allRightScenarios = new ArrayList<>();
|
|
|
-// List<Map<String, Object>> resultMaps = new ArrayList<>();
|
|
|
-// // 存放创造性和新颖性的权要
|
|
|
-//
|
|
|
-// rightIds.forEach(tem -> {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// Map<String, Object> resultMap = new HashMap<>();
|
|
|
-// List<Map<String, Object>> rightScenarios = new ArrayList<>();
|
|
|
-// //存放新颖性信息
|
|
|
-// List<String> noveList = new ArrayList<>();
|
|
|
-// List<String> creaList = new ArrayList<>();
|
|
|
-// //存放创造性信息
|
|
|
-// for (int t = 0; t < scenariosMaps.size(); t++) {
|
|
|
-// Map<String, Object> item = scenariosMaps.get(t);
|
|
|
-// if (item.get("rightId").equals(tem)) {
|
|
|
-// item.put("scenariosName", "对比组合" + (t + 1));
|
|
|
-// rightScenarios.add(item);
|
|
|
-// if (item.get("novelty").toString() != "") {
|
|
|
-// if (!noveList.contains(item.get("novelty").toString())) {
|
|
|
-// noveList.add(item.get("novelty").toString());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (item.get("creative").toString() != "") {
|
|
|
-// if (!creaList.contains(item.get("creative").toString())) {
|
|
|
-// creaList.add(item.get("creative").toString());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// map.put("rightScenrios", rightScenarios);
|
|
|
-// map.put("rightName", rightScenarios.get(0).get("rightName"));
|
|
|
-// String creative = creaList.size() == 0 ? "" : StringUtils.join(creaList, "、");
|
|
|
-// String novelty = noveList.size() == 0 ? "" : StringUtils.join(noveList, "-");
|
|
|
-// resultMap.put("rightName", rightScenarios.get(0).get("rightName"));
|
|
|
-// resultMap.put("rightNovelty", novelty);
|
|
|
-// resultMap.put("rightCreative", creative);
|
|
|
-// allRightScenarios.add(map);
|
|
|
-// resultMaps.add(resultMap);
|
|
|
-// });
|
|
|
-// //1.系统数据
|
|
|
-// //存放单条对比结果的map
|
|
|
-// Map<String, Object> map = 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"));
|
|
|
-// if (patentListMaps.size() > 1) {
|
|
|
-// patentListMaps = this.sortMap(patentListMaps);
|
|
|
-// }
|
|
|
-// map.put("patentList", patentListMaps);
|
|
|
-// map.put("combinations", allRightScenarios);
|
|
|
-// map.put("allResults", resultMaps);
|
|
|
-// map.put("signPatent", signPatent);
|
|
|
-// map.put("pantentNo", report.getSignPatentNo());
|
|
|
-// map.put("rights", signPatent.get("rights"));
|
|
|
-// // 为表格的显示绑定行循环
|
|
|
-// LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
|
-// HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
|
-// // 将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();
|
|
|
-// // 读取模板、数据并渲染
|
|
|
-// XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
|
-// return template;
|
|
|
-// }
|
|
|
+
|
|
|
+
|
|
|
+ private XWPFTemplate getstabilityTemplate(Integer projectId, String filePath) throws IOException {
|
|
|
+ //装载标的专利信息
|
|
|
+ LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ReportProject::getProjectId, projectId);
|
|
|
+ ReportProject report = reportProjectService.getOne(queryWrapper, false);
|
|
|
+ String signPatentNo = report.getSignPatentNo();
|
|
|
+ Map<String, Object> signPatent = this.signPantentMess(signPatentNo);
|
|
|
+
|
|
|
+ PatentRightParams params = new PatentRightParams();
|
|
|
+
|
|
|
+ List<RePatentClaim> patentRights = (List<RePatentClaim>) signPatent.get("claims");
|
|
|
+ //获得特征
|
|
|
+ List<Feature> allFeatures = new ArrayList<>();
|
|
|
+ //获得拆分信息
|
|
|
+ LambdaQueryWrapper<PatentSplitMessage> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(PatentSplitMessage::getPatentNo, signPatentNo)
|
|
|
+ .eq(PatentSplitMessage::getProjectId, report.getProjectId());
|
|
|
+ List<PatentSplitMessage> patentSplitMessages = patentSplitMessageService.list(queryWrapper1);
|
|
|
+ if (patentSplitMessages.size() > 0) {
|
|
|
+ LambdaQueryWrapper<Feature> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
|
+ allFeaturesWrapper.eq(Feature::getSplitMessageId, patentSplitMessages.get(0).getId());
|
|
|
+ allFeatures = featureService.list(allFeaturesWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //根据报告Id 查询出报告下所有的方案
|
|
|
+ LambdaQueryWrapper<ProofGroup> proofGroupWrapper = new LambdaQueryWrapper<>();
|
|
|
+ proofGroupWrapper.eq(ProofGroup::getProjectId, report.getProjectId());
|
|
|
+ List<ProofGroup> compareScenarios = proofGroupService.list(proofGroupWrapper);
|
|
|
+ List<Integer> scenarioIds = compareScenarios.stream().map(ProofGroup::getId).collect(Collectors.toList());
|
|
|
+ //根据对比方案Id 查询所有对比方案和(对比记录-特征)关联信息
|
|
|
+ List<AssoGroupReason> scenariosRecords = new ArrayList<>();
|
|
|
+ if (scenarioIds != null && scenarioIds.size() != 0) {
|
|
|
+ LambdaQueryWrapper<AssoGroupReason> queryRecordsByIDs = new LambdaQueryWrapper<>();
|
|
|
+ queryRecordsByIDs.in(AssoGroupReason::getGroupId, scenarioIds);
|
|
|
+ scenariosRecords = assoGroupReasonService.list(queryRecordsByIDs);
|
|
|
+ }
|
|
|
+ //获得对比记录id
|
|
|
+ List<Integer> reasonIds = scenariosRecords.stream().map(AssoGroupReason::getReasonId).collect(Collectors.toList());
|
|
|
+ //获得特征id
|
|
|
+ List<Integer> featureIds = scenariosRecords.stream().map(AssoGroupReason::getFeatureId).collect(Collectors.toList());
|
|
|
+ //查询对比记录
|
|
|
+ List<EvidenceReason> evidenceReasons = new ArrayList<>();
|
|
|
+ if (reasonIds != null && reasonIds.size() > 0) {
|
|
|
+ LambdaQueryWrapper<EvidenceReason> evidenceReasonLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ evidenceReasonLambdaQueryWrapper.in(EvidenceReason::getId, reasonIds);
|
|
|
+ evidenceReasons = evidenceReasonService.list(evidenceReasonLambdaQueryWrapper);
|
|
|
+ }
|
|
|
+ //查询特征
|
|
|
+ List<Feature> features = new ArrayList<>();
|
|
|
+ if (featureIds != null && featureIds.size() > 0) {
|
|
|
+ LambdaQueryWrapper<Feature> featureLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ featureLambdaQueryWrapper.in(Feature::getId, featureIds);
|
|
|
+ features = featureService.list(featureLambdaQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据对比记录id获得对比文献
|
|
|
+ List<String> patentNos = new ArrayList<>();
|
|
|
+ List<AssoReasonLiterature> assoReasonLiteratures = new ArrayList<>();
|
|
|
+ List<CompareLiteratureVO> compareLiteratures = new ArrayList<>();
|
|
|
+ if (reasonIds.size() > 0) {
|
|
|
+ LambdaQueryWrapper<AssoReasonLiterature> literatureLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ literatureLambdaQueryWrapper.eq(AssoReasonLiterature::getReasonId, reasonIds);
|
|
|
+ assoReasonLiteratures = assoReasonLiteratureService.list(literatureLambdaQueryWrapper);
|
|
|
+ if (assoReasonLiteratures.size() > 0) {
|
|
|
+ List<Integer> literatureIds = assoReasonLiteratures.stream().map(AssoReasonLiterature::getLiteratureId).collect(Collectors.toList());
|
|
|
+ if (literatureIds.size() > 0) {
|
|
|
+ compareLiteratures = compareLiteratureService.getByIds(literatureIds);
|
|
|
+ if (compareLiteratures.size() > 0) {
|
|
|
+ patentNos = compareLiteratures.stream().map(CompareLiteratureVO::getLiteratureNo).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //专利号别名的map
|
|
|
+ Map<String, Object> OtherName = new HashMap<>();
|
|
|
+ int flag = 1;
|
|
|
+ for (CompareLiteratureVO item : compareLiteratures) {
|
|
|
+ Integer order = item.getSysOrder() == null ? flag : item.getSysOrder();
|
|
|
+ OtherName.put(item.getLiteratureNo(), order);
|
|
|
+ flag++;
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据专利号查询专利详细信息
|
|
|
+ List<Patent> patentDTOS = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ patentDTOS = esPatentService.getPatentsByNo(patentNos, true, null, null);
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //存放专利信息的map集合
|
|
|
+ List<Map<String, Object>> patentListMaps = new ArrayList<>();
|
|
|
+ //填充专利数据到patentListMap
|
|
|
+ for (int i = 0; i < patentDTOS.size(); i++) {
|
|
|
+ Patent item = patentDTOS.get(i);
|
|
|
+ Map<String, Object> patentListMap = new HashMap<>();
|
|
|
+
|
|
|
+ List<PatentPerson> applicantJSONs = item.getApplicant();
|
|
|
+ StringBuilder applicants = new StringBuilder();
|
|
|
+ applicantJSONs.forEach(tem -> {
|
|
|
+ applicants.append(tem.getName() + "\r");
|
|
|
+ });
|
|
|
+
|
|
|
+ CompareLiteratureVO compareLiteratureVO = compareLiteratures.stream().filter(t -> t.getLiteratureNo().equals(item.getPatentNo())).findFirst().orElse(null);
|
|
|
+
|
|
|
+ List<AssoReasonLiterature> assoReasonLiteratures1 = new ArrayList<>();
|
|
|
+ if (compareLiteratureVO != null) {
|
|
|
+ assoReasonLiteratures1 = assoReasonLiteratures.stream().filter(t -> t.getLiteratureId().equals(compareLiteratureVO.getId())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ //填充相关揭露(对比记录文字和特征组合)
|
|
|
+ StringBuffer disclosures = new StringBuffer("");
|
|
|
+ //根据专利号获得对比记录
|
|
|
+ //遍历对比记录根据对比记录获得对比记录-特征关联信息并获得特征ID
|
|
|
+ for (AssoReasonLiterature tem : assoReasonLiteratures1) {
|
|
|
+ EvidenceReason evidenceReason = evidenceReasons.stream().filter(t -> t.getId().equals(tem.getReasonId())).findFirst().orElse(null);
|
|
|
+ if (evidenceReason != null) {
|
|
|
+ disclosures.append(evidenceReason.getEvidenceText());
|
|
|
+ }
|
|
|
+ //填充对比记录文字
|
|
|
+ disclosures.append("\r");
|
|
|
+ disclosures.append("(");
|
|
|
+ disclosures.append(tem.getFieldName());
|
|
|
+ disclosures.append("[" + (tem.getPosition()) + "]");
|
|
|
+ disclosures.append(")");
|
|
|
+ List<Integer> featuresIds = scenariosRecords.stream().filter(te -> te.getReasonId().equals(tem.getReasonId())).map(AssoGroupReason::getFeatureId).collect(Collectors.toList());
|
|
|
+ //根据特征Id获得特征内容
|
|
|
+ List<String> feaListContent = features.stream().filter(te -> featuresIds.contains(te.getId())).map(Feature::getContent).collect(Collectors.toList());
|
|
|
+ feaListContent.forEach(te -> disclosures.append("(" + te + ")"));
|
|
|
+ disclosures.append("\n");
|
|
|
+ }
|
|
|
+ int order = Integer.parseInt(OtherName.get(item.getPatentNo()).toString());
|
|
|
+
|
|
|
+ patentListMap.put("name", item.getTitle());
|
|
|
+ patentListMap.put("fileName", "D" + order);
|
|
|
+ patentListMap.put("publicDate", item.getPublicDate());
|
|
|
+ patentListMap.put("publicNo", item.getPublicNo());
|
|
|
+ patentListMap.put("SSIM", "");
|
|
|
+ patentListMap.put("applicant", applicants);
|
|
|
+ patentListMap.put("patentNo", item.getPatentNo());
|
|
|
+ if (item.getAbstractStr() != null && item.getAbstractStr().size() > 0) {
|
|
|
+ patentListMap.put("abstractStr", item.getAbstractStr().get(0).getTextContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ patentListMap.put("compareFileName", "对比文件" + (order));
|
|
|
+ patentListMap.put("applicationDate", item.getAppDate());
|
|
|
+ //图示
|
|
|
+ String guid = FormatUtil.getPictureFormat(item.getAppNo());
|
|
|
+ PictureRenderData pictureData = this.guidToStream(guid);
|
|
|
+
|
|
|
+ if (pictureData != null) {
|
|
|
+ patentListMap.put("abstractPath", pictureData);
|
|
|
+ }
|
|
|
+ patentListMap.put("disclosures", disclosures);
|
|
|
+ patentListMap.put("order", order);
|
|
|
+ patentListMaps.add(patentListMap);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //存放对比方案信息的map集合
|
|
|
+ List<Map<String, Object>> scenariosMaps = new ArrayList<>();
|
|
|
+ //存放所有对比方案所有不重复的rightId
|
|
|
+ for (int i = 0; i < compareScenarios.size(); i++) {
|
|
|
+ ProofGroup item1 = compareScenarios.get(i);
|
|
|
+ //获得单个对比方案的
|
|
|
+ List<AssoGroupReason> partScenariosRecords = scenariosRecords.stream().filter(item -> item.getGroupId().equals(item1.getId())).collect(Collectors.toList());
|
|
|
+ //获得单条权要所有的特征
|
|
|
+ List<Feature> allRightFeatures = features.stream().filter(item -> item.getRightSort().equals(item1.getClaimSort())).collect(Collectors.toList());
|
|
|
+ //存放单条对比结果的map
|
|
|
+ Map<String, Object> temMap = new HashMap<>();
|
|
|
+ String a = allRightFeatures.get(0).getRightSort() + "";
|
|
|
+ if (allRightFeatures.size() != 0 && allRightFeatures.get(0).getRightType().equals(1)) {
|
|
|
+ temMap.put("rightName", "独立权要" + a);
|
|
|
+ } else {
|
|
|
+ temMap.put("rightName", "附属权要" + a);
|
|
|
+ }
|
|
|
+ temMap.put("rightId", item1.getClaimSort());
|
|
|
+
|
|
|
+ if (report.getReportType() == 1) {
|
|
|
+ String rightContent = patentRights.stream().filter(t -> t.getSort().equals(item1.getClaimSort())).map(RePatentClaim::getContent).findFirst().orElse("");
|
|
|
+ temMap.put("rightContent", rightContent);
|
|
|
+ }
|
|
|
+ temMap.put("remark", item1.getDescription());
|
|
|
+
|
|
|
+ //存放对比方案每一个特征记录
|
|
|
+ List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
+ for (Feature tem : allRightFeatures) {
|
|
|
+ List<AssoGroupReason> assoGroupReasons = partScenariosRecords.stream().filter(item -> item.getFeatureId().equals(tem.getId())).collect(Collectors.toList());
|
|
|
+ if (assoGroupReasons.size() > 0) {
|
|
|
+ for (AssoGroupReason res : assoGroupReasons) {
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ map.put("featureContent", tem.getContent());
|
|
|
+ if (res.getReasonId().equals(0)) {
|
|
|
+ map.put("compareResult", "公识");
|
|
|
+ map.put("compareContent", "");
|
|
|
+ maps.add(map);
|
|
|
+ } else {
|
|
|
+ EvidenceReason evidenceReason = evidenceReasons.stream().filter(t -> t.getId().equals(res.getReasonId())).findFirst().orElse(null);
|
|
|
+ String content = evidenceReason.getEvidenceText() != null ? evidenceReason.getEvidenceText() : "";
|
|
|
+ AssoReasonLiterature assoReasonLiterature = assoReasonLiteratures.stream().filter(t -> t.getReasonId().equals(res.getReasonId())).findFirst().orElse(null);
|
|
|
+ String patentNo = "";
|
|
|
+ if (assoReasonLiterature != null) {
|
|
|
+ CompareLiteratureVO compareLiterature = compareLiteratures.stream().filter(t -> t.getId().equals(assoReasonLiterature.getLiteratureId())).findFirst().orElse(null);
|
|
|
+ if (compareLiterature != null) {
|
|
|
+ patentNo = compareLiterature.getLiteratureNo() != null ? compareLiterature.getLiteratureNo() : "";
|
|
|
+ }
|
|
|
+ if (OtherName.containsKey(patentNo)) {
|
|
|
+ patentNo = "D" + OtherName.get(patentNo).toString() + ":";
|
|
|
+ } else if (!patentNo.equals("")) {
|
|
|
+ patentNo += ":";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String paresingProcess = evidenceReason.getEvidenceText() != null ? "(" + evidenceReason.getEvidenceText() + ")" : "";
|
|
|
+ String 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", res.getConclusion() != null ? res.getConclusion() : "不公开");
|
|
|
+ map.put("compareContent", compareContent);
|
|
|
+ PictureRenderData pictureData = this.guidToStream(evidenceReason.getFileGuid());
|
|
|
+
|
|
|
+ if (pictureData != null) {
|
|
|
+ map.put("figure", pictureData);
|
|
|
+ }
|
|
|
+ if (assoReasonLiterature.getFieldName() == null && assoReasonLiterature.getPosition() == null) {
|
|
|
+ map.put("position", "");
|
|
|
+ } else {
|
|
|
+ map.put("position", "\r" + "(" + assoReasonLiterature.getFieldName() + "[" + assoReasonLiterature.getPosition() + "]" + ")");
|
|
|
+ }
|
|
|
+ maps.add(map);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ map.put("compareResult", res.getConclusion() != null ? res.getConclusion() : "不公开");
|
|
|
+ map.put("compareContent", compareContent);
|
|
|
+
|
|
|
+ PictureRenderData pictureData = this.guidToStream(evidenceReason.getFileGuid());
|
|
|
+ if (pictureData != null) {
|
|
|
+ map.put("figure", pictureData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (assoReasonLiterature.getFieldName() == null && assoReasonLiterature.getPosition() == null) {
|
|
|
+ map.put("position", "");
|
|
|
+ } else {
|
|
|
+ map.put("position", "\r" + "(" + assoReasonLiterature.getFieldName() + "[" + assoReasonLiterature.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);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //方案内容
|
|
|
+ temMap.put("fileDetails", maps);
|
|
|
+
|
|
|
+ //新颖性模块
|
|
|
+ //获得本方案所有的专利号
|
|
|
+ List<String> patentNOs = new ArrayList<>();
|
|
|
+ List<CompareLiteratureVO> partCompareLiterature = new ArrayList<>();
|
|
|
+ List<Integer> partReasonIds = partScenariosRecords.stream().map(AssoGroupReason::getReasonId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (partReasonIds.size() != 0) {
|
|
|
+ List<Integer> partLiteratureIds = assoReasonLiteratures.stream().filter(t -> partReasonIds.contains(t.getReasonId())).map(AssoReasonLiterature::getLiteratureId).collect(Collectors.toList());
|
|
|
+ if (partLiteratureIds.size() != 0) {
|
|
|
+ partCompareLiterature = compareLiteratures.stream().filter(t -> partLiteratureIds.contains(t.getId())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //比较所有专利号和权要所有权要的大小,如果相等则将该专利加入到新颖性列表中
|
|
|
+ List<String> noveltyFiles = new ArrayList<>();
|
|
|
+ for (CompareLiteratureVO item : partCompareLiterature) {
|
|
|
+ //根据id查询对比理由
|
|
|
+ List<Integer> temReasonIds = assoReasonLiteratures.stream().filter(t -> t.getLiteratureId().equals(item.getId())).map(AssoReasonLiterature::getReasonId).collect(Collectors.toList());
|
|
|
+ List<Integer> temFeatureIds = partScenariosRecords.stream().filter(t->temReasonIds.contains(t.getReasonId())).map(AssoGroupReason::getFeatureId).distinct().collect(Collectors.toList());
|
|
|
+ String tmName = item.getLiteratureNo();
|
|
|
+ if (OtherName.containsKey(item)) {
|
|
|
+ tmName = "D" + OtherName.get(item).toString();
|
|
|
+ }
|
|
|
+ if (temFeatureIds.size() == allRightFeatures.size()) {
|
|
|
+ noveltyFiles.add(tmName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //创造性列表
|
|
|
+ List<String> creativeFiles = new ArrayList<>();
|
|
|
+ //当前方案所有的特征Id
|
|
|
+ partCompareLiterature.forEach(
|
|
|
+ item -> {
|
|
|
+ String tmName = item.getLiteratureNo();
|
|
|
+ if (OtherName.containsKey(tmName)) {
|
|
|
+ tmName = "D" + OtherName.get(tmName).toString();
|
|
|
+ }
|
|
|
+ if (!creativeFiles.contains(tmName)) {
|
|
|
+ creativeFiles.add(tmName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ List<AssoGroupReason> andRecords = partScenariosRecords.stream().filter(tm -> tm.getReasonId().equals(0)).collect(Collectors.toList());
|
|
|
+ if (andRecords.size() != 0) {
|
|
|
+ creativeFiles.add("C");
|
|
|
+ }
|
|
|
+ String creative = creativeFiles.size() == 0 ? "" : StringUtils.join(creativeFiles, "+");
|
|
|
+ String novelty = noveltyFiles.size() == 0 ? "" : StringUtils.join(noveltyFiles, "-");
|
|
|
+ //新颖性
|
|
|
+ temMap.put("novelty", novelty);
|
|
|
+ //创造性
|
|
|
+ temMap.put("creative", creative);
|
|
|
+ scenariosMaps.add(temMap);
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> allRightScenarios = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> resultMaps = new ArrayList<>();
|
|
|
+ // 存放创造性和新颖性的权要
|
|
|
+
|
|
|
+ patentRights.forEach(tem -> {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ List<Map<String, Object>> rightScenarios = new ArrayList<>();
|
|
|
+ //存放新颖性信息
|
|
|
+ List<String> noveList = new ArrayList<>();
|
|
|
+ List<String> creaList = new ArrayList<>();
|
|
|
+ //存放创造性信息
|
|
|
+ for (int t = 0; t < scenariosMaps.size(); t++) {
|
|
|
+ Map<String, Object> item = scenariosMaps.get(t);
|
|
|
+ if (item.get("rightId").equals(tem.getSort())) {
|
|
|
+ item.put("scenariosName", "对比组合" + (t + 1));
|
|
|
+ rightScenarios.add(item);
|
|
|
+ if (item.get("novelty").toString() != "") {
|
|
|
+ if (!noveList.contains(item.get("novelty").toString())) {
|
|
|
+ noveList.add(item.get("novelty").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.get("creative").toString() != "") {
|
|
|
+ if (!creaList.contains(item.get("creative").toString())) {
|
|
|
+ creaList.add(item.get("creative").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("rightScenrios", rightScenarios);
|
|
|
+ map.put("rightName", rightScenarios.get(0).get("rightName"));
|
|
|
+ String creative = creaList.size() == 0 ? "" : StringUtils.join(creaList, "、");
|
|
|
+ String novelty = noveList.size() == 0 ? "" : StringUtils.join(noveList, "-");
|
|
|
+ resultMap.put("rightName", rightScenarios.get(0).get("rightName"));
|
|
|
+ resultMap.put("rightNovelty", novelty);
|
|
|
+ resultMap.put("rightCreative", creative);
|
|
|
+ allRightScenarios.add(map);
|
|
|
+ resultMaps.add(resultMap);
|
|
|
+ });
|
|
|
+ //1.系统数据
|
|
|
+ //存放单条对比结果的map
|
|
|
+ Map<String, Object> map = 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"));
|
|
|
+ if (patentListMaps.size() > 1) {
|
|
|
+ patentListMaps = this.sortMap(patentListMaps);
|
|
|
+ }
|
|
|
+ map.put("patentList", patentListMaps);
|
|
|
+ map.put("combinations", allRightScenarios);
|
|
|
+ map.put("allResults", resultMaps);
|
|
|
+ map.put("signPatent", signPatent);
|
|
|
+ map.put("pantentNo", report.getSignPatentNo());
|
|
|
+ map.put("rights", signPatent.get("rights"));
|
|
|
+ // 为表格的显示绑定行循环
|
|
|
+ LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
|
+ HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
|
+ // 将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();
|
|
|
+ // 读取模板、数据并渲染
|
|
|
+ XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
|
+ return template;
|
|
|
+ }
|
|
|
|
|
|
//
|
|
|
-// public Map<String, Object> signPantentMess(String patentNo) throws IOException {
|
|
|
-//
|
|
|
-// Patent patent = new Patent();
|
|
|
-// try {
|
|
|
-// List<Patent> patentList = esPatentService.getPatentsByNo(Arrays.asList(patentNo), true, null, null);
|
|
|
-// if(patentList.size()>0){
|
|
|
-// patent=patentList.get(0);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new IOException();
|
|
|
-// }
|
|
|
-//
|
|
|
-// //装载单个专利的信息
|
|
|
-// Map<String, Object> patentMap = new HashMap<>();
|
|
|
-// 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");
|
|
|
-// }
|
|
|
-// });
|
|
|
-// //申请日
|
|
|
-// patentMap.put("applicationDate", patent.getAppDate());
|
|
|
-//
|
|
|
-// //公开日
|
|
|
-// patentMap.put("publicDate", patent.getPublicDate());
|
|
|
-// //公开号
|
|
|
-// patentMap.put("publicNo", patent.getPublicNo());
|
|
|
-// //专利号
|
|
|
-// patentMap.put("patentNo", patent.getPatentNo());
|
|
|
-// //专利权人
|
|
|
-// patentMap.put("rightPerson", rightPerson);
|
|
|
-// //图示
|
|
|
-// patentMap.put("abstractPath", pasFile + patent.get("abstractPath"));
|
|
|
-// patentMap.put("name", patent.getTitle());
|
|
|
-// //查询专利权要
|
|
|
-// String resBody2 = outInterfaceService.getPatentRightFromPAS(patentNo);
|
|
|
-// JSONObject jsonObject2 = JSONObject.parseObject(resBody2);
|
|
|
-// //解析jason获得标的专利的权要
|
|
|
-// List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject2.getString("data"), PatentRight.class);
|
|
|
-// List<Map<String, Object>> rights = new ArrayList<>();
|
|
|
-// //给权要进行格式更改
|
|
|
-// List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin, patentNo);
|
|
|
-// patentRights.forEach(item -> {
|
|
|
-// Map<String, Object> temMap = new HashMap<>();
|
|
|
-// temMap.put("rightName", "权" + (item.getSort() + 1));
|
|
|
-// temMap.put("content", item.getContent());
|
|
|
-// temMap.put("rightNameLong", "权利要求" + (item.getSort() + 1));
|
|
|
-// temMap.put("parentSort", item.getParentSort());
|
|
|
-// temMap.put("sort", item.getSort());
|
|
|
-// rights.add(temMap);
|
|
|
-// });
|
|
|
-// patentMap.put("rights", rights);
|
|
|
-// return patentMap;
|
|
|
-// }
|
|
|
+ public Map<String, Object> signPantentMess(String patentNo) throws IOException {
|
|
|
+
|
|
|
+ Patent patent = new Patent();
|
|
|
+ try {
|
|
|
+ List<Patent> patentList = esPatentService.getPatentsByNo(Arrays.asList(patentNo), true, null, null);
|
|
|
+ if (patentList.size() > 0) {
|
|
|
+ patent = patentList.get(0);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new IOException();
|
|
|
+ }
|
|
|
+
|
|
|
+ //装载单个专利的信息
|
|
|
+ Map<String, Object> patentMap = new HashMap<>();
|
|
|
+ StringBuilder applicants = new StringBuilder();
|
|
|
+ StringBuilder rightPerson = new StringBuilder();
|
|
|
+
|
|
|
+ if (patent.getApplicant() != null && patent.getApplicant().size() > 0) {
|
|
|
+ patent.getApplicant().forEach(item -> {
|
|
|
+ applicants.append(item.getName() + "\r");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (patent.getRightHolder() != null && patent.getRightHolder().size() > 0) {
|
|
|
+ patent.getRightHolder().forEach(item -> {
|
|
|
+ rightPerson.append(item.getName() + "\r");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //申请日
|
|
|
+ patentMap.put("applicationDate", patent.getAppDate());
|
|
|
+
|
|
|
+ //公开日
|
|
|
+ patentMap.put("publicDate", patent.getPublicDate());
|
|
|
+ //公开号
|
|
|
+ patentMap.put("publicNo", patent.getPublicNo());
|
|
|
+ //专利号
|
|
|
+ patentMap.put("patentNo", patent.getPatentNo());
|
|
|
+ //专利权人
|
|
|
+ patentMap.put("rightPerson", rightPerson);
|
|
|
+ //图示
|
|
|
+ String guid = FormatUtil.getPictureFormat(patent.getAppNo());
|
|
|
+ PictureRenderData pictureData = this.guidToStream(guid);
|
|
|
+
|
|
|
+ if (pictureData != null) {
|
|
|
+ patentMap.put("abstractPath", pictureData);
|
|
|
+ }
|
|
|
+
|
|
|
+ patentMap.put("name", patent.getTitle());
|
|
|
+
|
|
|
+ //查询专利权要
|
|
|
+ List<Text> patentRights = patent.getClaim();
|
|
|
+ String patentRight = null;
|
|
|
+ if (patentRights != null && patentRights.size() > 0) {
|
|
|
+ patentRight = patentRights.get(0).getTextContent();
|
|
|
+ }
|
|
|
+ PatentRightParams params = new PatentRightParams();
|
|
|
+ params.setContent(patentRight);
|
|
|
+ params.setPatentNo(patentNo);
|
|
|
+ List<RePatentClaim> claims = PatentRightUtils.formatPatentRight(params);
|
|
|
+
|
|
|
+ List<Map<String, Object>> rights = new ArrayList<>();
|
|
|
+ claims.forEach(item -> {
|
|
|
+ Map<String, Object> temMap = new HashMap<>();
|
|
|
+ temMap.put("rightName", "权" + (item.getSort() + 1));
|
|
|
+ temMap.put("content", item.getContent());
|
|
|
+ temMap.put("rightNameLong", "权利要求" + (item.getSort() + 1));
|
|
|
+ temMap.put("parentSort", item.getParentSort());
|
|
|
+ temMap.put("sort", item.getSort());
|
|
|
+ rights.add(temMap);
|
|
|
+ });
|
|
|
+ patentMap.put("rights", rights);
|
|
|
+ patentMap.put("claims", claims);
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|