|
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.poi.poifs.filesystem.DirectoryEntry;
|
|
import org.apache.poi.poifs.filesystem.DirectoryEntry;
|
|
import org.apache.poi.poifs.filesystem.DocumentEntry;
|
|
import org.apache.poi.poifs.filesystem.DocumentEntry;
|
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
|
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.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -53,62 +54,71 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
private final FileUtils fileUtils;
|
|
private final FileUtils fileUtils;
|
|
private final LoginUtils loginUtils;
|
|
private final LoginUtils loginUtils;
|
|
private final CacheUtils cacheUtils;
|
|
private final CacheUtils cacheUtils;
|
|
|
|
+ private final ReportFieldService reportFieldService;
|
|
|
|
+ private final TemplateConfigService templateConfigService;
|
|
|
|
+ private final ReportFieldPatentLinkService reportFieldPatentLinkService;
|
|
|
|
|
|
- public String reportDocument(ReportDocument reportDocument) {
|
|
|
|
|
|
+ public String reportDocument(ReportDocument reportDocument) {
|
|
|
|
|
|
- return Response.success();
|
|
|
|
|
|
+ return Response.success();
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @function: 根据报告Id获得报告的导出记录
|
|
|
|
* @param reportDocument
|
|
* @param reportDocument
|
|
* @return
|
|
* @return
|
|
|
|
+ * @function: 根据报告Id获得报告的导出记录
|
|
*/
|
|
*/
|
|
- public String getExportList(ReportDocument reportDocument){
|
|
|
|
- LambdaQueryWrapper<ReportDocument> wrapper =new LambdaQueryWrapper<>();
|
|
|
|
- wrapper.eq(ReportDocument::getReportId,reportDocument.getReportId());
|
|
|
|
- IPage<ReportDocument> pages =this.page(new Page<>(reportDocument.getCurrent(),reportDocument.getSize()),wrapper);
|
|
|
|
- return Response.success(pages);
|
|
|
|
|
|
+ public String getExportList(ReportDocument reportDocument) {
|
|
|
|
+ LambdaQueryWrapper<ReportDocument> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(ReportDocument::getReportId, reportDocument.getReportId());
|
|
|
|
+ IPage<ReportDocument> pages = this.page(new Page<>(reportDocument.getCurrent(), reportDocument.getSize()), wrapper);
|
|
|
|
+ return Response.success(pages);
|
|
}
|
|
}
|
|
|
|
|
|
public String deleteExport(Integer id) {
|
|
public String deleteExport(Integer id) {
|
|
- this.removeById(id);
|
|
|
|
- return Response.success();
|
|
|
|
|
|
+ this.removeById(id);
|
|
|
|
+ return Response.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @function: 导出报告
|
|
|
|
* @param reportId
|
|
* @param reportId
|
|
* @param templeId
|
|
* @param templeId
|
|
* @return
|
|
* @return
|
|
* @throws IOException
|
|
* @throws IOException
|
|
|
|
+ * @function: 导出报告
|
|
*/
|
|
*/
|
|
- public String exportReport(Integer reportId,Integer templeId) throws IOException {
|
|
|
|
- //根据模板ID获得模板
|
|
|
|
- Template reportTemplate= templateService.getById(templeId);
|
|
|
|
|
|
+ public String exportReport(Integer reportId, Integer templeId) throws IOException {
|
|
|
|
+ //根据模板ID获得模板
|
|
|
|
+ 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;
|
|
|
|
-
|
|
|
|
- XWPFTemplate template =this.getstabilityMaps(reportId,filePath);
|
|
|
|
|
|
+ String outPath = fileUtils.getSavePath(directoryName) + fileName;
|
|
|
|
+ Report report = reportService.getById(reportId);
|
|
|
|
+ XWPFTemplate template =null;
|
|
|
|
+ if(report.getType()==0||report.getType()==2) {
|
|
|
|
+ template = this.getstabilityMaps(report, filePath);
|
|
|
|
+ }
|
|
|
|
+ else if(report.getType()==3){
|
|
|
|
+ template= this.FTOtemplate(reportId, filePath,templeId);
|
|
|
|
+ }
|
|
// 读取模板、数据并渲染
|
|
// 读取模板、数据并渲染
|
|
// 文件是否已存在,则删除
|
|
// 文件是否已存在,则删除
|
|
File file = new File(outPath);
|
|
File file = new File(outPath);
|
|
if (file.exists()) {
|
|
if (file.exists()) {
|
|
file.delete();
|
|
file.delete();
|
|
}
|
|
}
|
|
-// 生成word保存在指定目录
|
|
|
|
|
|
+// 生成word保存在指定目录
|
|
template.writeToFile(outPath);
|
|
template.writeToFile(outPath);
|
|
template.close();
|
|
template.close();
|
|
//导出成功后,导出报告记录入库
|
|
//导出成功后,导出报告记录入库
|
|
String url = fileUtils.getDirectory2(directoryName) + fileName;
|
|
String url = fileUtils.getDirectory2(directoryName) + fileName;
|
|
- PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
|
- ReportDocument reportDocument =new ReportDocument();
|
|
|
|
|
|
+ PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
|
+ ReportDocument reportDocument = new ReportDocument();
|
|
reportDocument.setReportId(reportId);
|
|
reportDocument.setReportId(reportId);
|
|
reportDocument.setFileName(fileName);
|
|
reportDocument.setFileName(fileName);
|
|
reportDocument.setFilePath(url);
|
|
reportDocument.setFilePath(url);
|
|
@@ -121,57 +131,59 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * @autor
|
|
|
|
|
|
+ /**
|
|
* @return
|
|
* @return
|
|
|
|
+ * @autor
|
|
* @description 装载稳定和无效模板信息
|
|
* @description 装载稳定和无效模板信息
|
|
*/
|
|
*/
|
|
- private XWPFTemplate getstabilityMaps(Integer reportId,String filePath) throws IOException {
|
|
|
|
- //根据报告Id获得报告信息
|
|
|
|
- Report report = reportService.getById(reportId);
|
|
|
|
|
|
+ private XWPFTemplate getstabilityMaps(Report report, String filePath) throws IOException {
|
|
|
|
+ //根据报告Id获得报告信息
|
|
// 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
// 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
allFeaturesWrapper.eq(Features::getReportId, report.getId());
|
|
allFeaturesWrapper.eq(Features::getReportId, report.getId());
|
|
- allFeaturesWrapper.and(wrapper->wrapper.eq(Features::getPartnerId, report.getPersonId()).or().eq(Features::getPartnerId, report.getCreatePersonId()));
|
|
|
|
|
|
+ allFeaturesWrapper.and(wrapper -> wrapper.eq(Features::getPartnerId, report.getPersonId()).or().eq(Features::getPartnerId, report.getCreatePersonId()));
|
|
|
|
|
|
List<Features> allFeatures = featureService.list(allFeaturesWrapper);
|
|
List<Features> allFeatures = featureService.list(allFeaturesWrapper);
|
|
//根据报告Id 查询出报告下所有的方案
|
|
//根据报告Id 查询出报告下所有的方案
|
|
LambdaQueryWrapper<CompareScenarios> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CompareScenarios> queryWrapper = new LambdaQueryWrapper<>();
|
|
- queryWrapper.eq(CompareScenarios::getReportId, reportId);
|
|
|
|
|
|
+ queryWrapper.eq(CompareScenarios::getReportId, report.getId());
|
|
List<CompareScenarios> compareScenarios = compareScenariosService.list(queryWrapper);
|
|
List<CompareScenarios> compareScenarios = compareScenariosService.list(queryWrapper);
|
|
List<Integer> scenarioIds = compareScenarios.stream().map(CompareScenarios::getId).collect(Collectors.toList());
|
|
List<Integer> scenarioIds = compareScenarios.stream().map(CompareScenarios::getId).collect(Collectors.toList());
|
|
//根据对比方案Id 查询所有对比方案和(对比记录-特征)关联信息
|
|
//根据对比方案Id 查询所有对比方案和(对比记录-特征)关联信息
|
|
- List<AssoScenarIOS> scenariosRecords =new ArrayList<>();
|
|
|
|
- if(scenarioIds!=null&&scenarioIds.size()!=0) {
|
|
|
|
|
|
+ List<AssoScenarIOS> scenariosRecords = new ArrayList<>();
|
|
|
|
+ if (scenarioIds != null && scenarioIds.size() != 0) {
|
|
LambdaQueryWrapper<AssoScenarIOS> queryRecordsByIDs = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<AssoScenarIOS> queryRecordsByIDs = new LambdaQueryWrapper<>();
|
|
queryRecordsByIDs.in(AssoScenarIOS::getScenariosID, scenarioIds);
|
|
queryRecordsByIDs.in(AssoScenarIOS::getScenariosID, scenarioIds);
|
|
scenariosRecords = scenariosRecordsService.list(queryRecordsByIDs);
|
|
scenariosRecords = scenariosRecordsService.list(queryRecordsByIDs);
|
|
}
|
|
}
|
|
- //获得对比记录-特征关联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<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;
|
|
|
|
|
|
+ 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
|
|
//从对比记录-特征关联信息里剔出对比记录Id
|
|
- List<Integer> recordIds =assoRecordsFeatures.stream().map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> recordIds = assoRecordsFeatures.stream().map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
|
|
//从对比记录-特征关联信息里剔出特征Id
|
|
//从对比记录-特征关联信息里剔出特征Id
|
|
- List<Integer> sFeatureIds =assoRecordsFeatures.stream().map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> sFeatureIds = assoRecordsFeatures.stream().map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
//根据特征ID查询出报告所有方案的特征
|
|
//根据特征ID查询出报告所有方案的特征
|
|
- List<Features> sFeatures =new ArrayList<>();
|
|
|
|
|
|
+ List<Features> sFeatures = new ArrayList<>();
|
|
LambdaQueryWrapper<Features> sFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Features> sFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
sFeaturesWrapper.eq(Features::getId, sFeatureIds);
|
|
sFeaturesWrapper.eq(Features::getId, sFeatureIds);
|
|
- if(sFeatures!=null&&sFeatures.size()!=0){
|
|
|
|
- sFeatures = featureService.list(sFeaturesWrapper);}
|
|
|
|
|
|
+ if (sFeatures != null && sFeatures.size() != 0) {
|
|
|
|
+ sFeatures = featureService.list(sFeaturesWrapper);
|
|
|
|
+ }
|
|
//根据对比记录ID查询出报告所有方案的对比记录
|
|
//根据对比记录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);}
|
|
|
|
|
|
+ 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获得专利号
|
|
//根据对比记录ID获得专利号
|
|
List<String> PatentNos = compareRecords.stream().map(CompareRecords::getPatentNo).collect(Collectors.toList());
|
|
List<String> PatentNos = compareRecords.stream().map(CompareRecords::getPatentNo).collect(Collectors.toList());
|
|
PatentVO patentVO = new PatentVO();
|
|
PatentVO patentVO = new PatentVO();
|
|
@@ -194,21 +206,21 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
applicantJSONs.forEach(tem -> {
|
|
applicantJSONs.forEach(tem -> {
|
|
applicants.append(tem.get("name") + "\r");
|
|
applicants.append(tem.get("name") + "\r");
|
|
});
|
|
});
|
|
- //填充相关揭露(对比记录文字和特征组合)
|
|
|
|
- StringBuffer disclosures =new StringBuffer("");
|
|
|
|
|
|
+ //填充相关揭露(对比记录文字和特征组合)
|
|
|
|
+ StringBuffer disclosures = new StringBuffer("");
|
|
//根据专利号获得对比记录
|
|
//根据专利号获得对比记录
|
|
- List<CompareRecords> pantentRecords = compareRecords.stream().filter(tem->tem.getPatentNo().equals(item.get("publicNo"))).collect(Collectors.toList());
|
|
|
|
|
|
+ List<CompareRecords> pantentRecords = compareRecords.stream().filter(tem -> tem.getPatentNo().equals(item.get("publicNo"))).collect(Collectors.toList());
|
|
//遍历对比记录根据对比记录获得对比记录-特征关联信息并获得特征ID
|
|
//遍历对比记录根据对比记录获得对比记录-特征关联信息并获得特征ID
|
|
- for (CompareRecords tem:pantentRecords) {
|
|
|
|
|
|
+ for (CompareRecords tem : pantentRecords) {
|
|
//填充对比记录文字
|
|
//填充对比记录文字
|
|
disclosures.append(tem.getContent());
|
|
disclosures.append(tem.getContent());
|
|
disclosures.append("\r");
|
|
disclosures.append("\r");
|
|
disclosures.append(tem.getFields());
|
|
disclosures.append(tem.getFields());
|
|
- disclosures.append("["+(tem.getPosition())+"]");
|
|
|
|
- List<Integer> featuresIds= assoRecordsFeatures.stream().filter(te->te.getRecordsId().equals(tem.getId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
|
|
|
|
+ disclosures.append("[" + (tem.getPosition()) + "]");
|
|
|
|
+ List<Integer> featuresIds = assoRecordsFeatures.stream().filter(te -> te.getRecordsId().equals(tem.getId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
//根据特征Id获得特征内容
|
|
//根据特征Id获得特征内容
|
|
- List<String> feaListContent =sFeatures.stream().filter(te->featuresIds.contains(te.getId())).map(Features::getContent).collect(Collectors.toList());
|
|
|
|
- feaListContent.forEach(te->disclosures.append("("+te+")"));
|
|
|
|
|
|
+ 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");
|
|
disclosures.append("\n");
|
|
}
|
|
}
|
|
patentListMap.put("name", item.get("name"));
|
|
patentListMap.put("name", item.get("name"));
|
|
@@ -221,8 +233,8 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
patentListMap.put("compareFileName", "对比文件" + (i + 1));
|
|
patentListMap.put("compareFileName", "对比文件" + (i + 1));
|
|
patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
- patentListMap.put("abstractPath", "http://139.224.24.90:8081"+item.get("abstractPath"));
|
|
|
|
- patentListMap.put("disclosures",disclosures);
|
|
|
|
|
|
+ patentListMap.put("abstractPath", "http://139.224.24.90:8081" + item.get("abstractPath"));
|
|
|
|
+ patentListMap.put("disclosures", disclosures);
|
|
patentListMaps.add(patentListMap);
|
|
patentListMaps.add(patentListMap);
|
|
//给出现的专利添加别名
|
|
//给出现的专利添加别名
|
|
OtherName.put(item.get("publicNo").toString(), ("D" + (i + 1)));
|
|
OtherName.put(item.get("publicNo").toString(), ("D" + (i + 1)));
|
|
@@ -236,27 +248,27 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
//获得单个对比方案的
|
|
//获得单个对比方案的
|
|
List<AssoScenarIOS> partScenariosRecords = scenariosRecords.stream().filter(item -> item.getScenariosID().equals(item1.getId())).collect(Collectors.toList());
|
|
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<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<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());
|
|
List<Integer> partFetIds = assoRecordsFeatures1.stream().map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
|
|
//获得共识特征的ID
|
|
//获得共识特征的ID
|
|
- List<Integer> comFetIds =partScenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> comFetIds = partScenariosRecords.stream().map(AssoScenarIOS::getFeaturesID).collect(Collectors.toList());
|
|
partFetIds.addAll(comFetIds);
|
|
partFetIds.addAll(comFetIds);
|
|
//获得单个对比方案的权要的所有特征
|
|
//获得单个对比方案的权要的所有特征
|
|
List<Features> partFeatures = allFeatures.stream().filter(item -> partFetIds.contains(item.getId())).collect(Collectors.toList());
|
|
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<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());
|
|
|
|
|
|
+ List<Features> allRightFeatures = allFeatures.stream().filter(item -> item.getRightId().equals(item1.getRightId())).collect(Collectors.toList());
|
|
//存放单条对比结果的map
|
|
//存放单条对比结果的map
|
|
Map<String, Object> temMap = new HashMap<>();
|
|
Map<String, Object> temMap = new HashMap<>();
|
|
- if (partFeatures.size()!=0&&partFeatures.get(0).getRightType().equals(1)) {
|
|
|
|
|
|
+ if (partFeatures.size() != 0 && partFeatures.get(0).getRightType().equals(1)) {
|
|
temMap.put("rightName", "独立" + partFeatures.get(0).getRightName());
|
|
temMap.put("rightName", "独立" + partFeatures.get(0).getRightName());
|
|
} else {
|
|
} else {
|
|
temMap.put("rightName", "附属" + partFeatures.get(0).getRightName());
|
|
temMap.put("rightName", "附属" + partFeatures.get(0).getRightName());
|
|
}
|
|
}
|
|
temMap.put("rightId", item1.getRightId());
|
|
temMap.put("rightId", item1.getRightId());
|
|
|
|
|
|
- temMap.put("remark",item1.getContrastResult());
|
|
|
|
|
|
+ temMap.put("remark", item1.getContrastResult());
|
|
// 从关联数据里获得特征id
|
|
// 从关联数据里获得特征id
|
|
if (!rightIds.contains(item1.getRightId())) {
|
|
if (!rightIds.contains(item1.getRightId())) {
|
|
rightIds.add(item1.getRightId());
|
|
rightIds.add(item1.getRightId());
|
|
@@ -267,23 +279,23 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("featureContent", tem.getContent());
|
|
map.put("featureContent", tem.getContent());
|
|
AssoRecordsFeature assoRecordsFeature = finalAsso.stream().filter(item -> item.getFeatureId().equals(tem.getId())).findFirst().orElse(new AssoRecordsFeature());
|
|
AssoRecordsFeature assoRecordsFeature = finalAsso.stream().filter(item -> item.getFeatureId().equals(tem.getId())).findFirst().orElse(new AssoRecordsFeature());
|
|
- map.put("compareResult", assoRecordsFeature.getComResult()!=null?assoRecordsFeature.getComResult():"");
|
|
|
|
|
|
+ map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "");
|
|
CompareRecords record = records.stream().filter(item -> item.getId().equals(assoRecordsFeature.getRecordsId())).findFirst().orElse(new CompareRecords());
|
|
CompareRecords record = records.stream().filter(item -> item.getId().equals(assoRecordsFeature.getRecordsId())).findFirst().orElse(new CompareRecords());
|
|
- String compareContent ="";
|
|
|
|
|
|
+ String compareContent = "";
|
|
//获取对比内容
|
|
//获取对比内容
|
|
- String content = record.getContent()!=null?record.getContent():"";
|
|
|
|
- //获得对比专利号
|
|
|
|
- String patentNo =record.getPatentNo()!=null?record.getPatentNo():"";
|
|
|
|
|
|
+ String content = record.getContent() != null ? record.getContent() : "";
|
|
|
|
+ //获得对比专利号
|
|
|
|
+ String patentNo = record.getPatentNo() != null ? record.getPatentNo() : "";
|
|
if (OtherName.containsKey(patentNo)) {
|
|
if (OtherName.containsKey(patentNo)) {
|
|
patentNo = OtherName.get(patentNo).toString();
|
|
patentNo = OtherName.get(patentNo).toString();
|
|
}
|
|
}
|
|
//获得解析过程
|
|
//获得解析过程
|
|
- String paresingProcess =record.getParesingProcess()!=null?"("+record.getParesingProcess()+")":"";
|
|
|
|
- compareContent =patentNo+":"+content+paresingProcess;
|
|
|
|
|
|
+ String paresingProcess = record.getParesingProcess() != null ? "(" + record.getParesingProcess() + ")" : "";
|
|
|
|
+ compareContent = patentNo + ":" + content + paresingProcess;
|
|
//获取对比专利号
|
|
//获取对比专利号
|
|
map.put("compareContent", compareContent);
|
|
map.put("compareContent", compareContent);
|
|
- map.put("figure",fileUtils.getSystemPath()+record.getFilePath());
|
|
|
|
- map.put("position",record.getFields()+"["+record.getPosition()+"]");
|
|
|
|
|
|
+ map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
|
|
|
|
+ map.put("position", record.getFields() + "[" + record.getPosition() + "]");
|
|
maps.add(map);
|
|
maps.add(map);
|
|
});
|
|
});
|
|
//方案内容
|
|
//方案内容
|
|
@@ -320,16 +332,17 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
if (OtherName.containsKey(tmName)) {
|
|
if (OtherName.containsKey(tmName)) {
|
|
tmName = OtherName.get(tmName).toString();
|
|
tmName = OtherName.get(tmName).toString();
|
|
}
|
|
}
|
|
- if(!creativeFiles.contains(tmName)){
|
|
|
|
- creativeFiles.add(tmName);}
|
|
|
|
|
|
+ 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());
|
|
|
|
|
|
+ List<AssoScenarIOS> andRecords = partScenariosRecords.stream().filter(tm -> tm.getScenariosID().equals(item1.getId()) && tm.getFeaturesID() != 0).collect(Collectors.toList());
|
|
if (andRecords.size() != 0) {
|
|
if (andRecords.size() != 0) {
|
|
creativeFiles.add("C");
|
|
creativeFiles.add("C");
|
|
}
|
|
}
|
|
- String creative =creativeFiles.size()==0?"": StringUtils.join(creativeFiles, "+");
|
|
|
|
- String novelty =noveltyFiles.size()==0?"": StringUtils.join(noveltyFiles, "-");
|
|
|
|
|
|
+ String creative = creativeFiles.size() == 0 ? "" : StringUtils.join(creativeFiles, "+");
|
|
|
|
+ String novelty = noveltyFiles.size() == 0 ? "" : StringUtils.join(noveltyFiles, "-");
|
|
//新颖性
|
|
//新颖性
|
|
temMap.put("novelty", novelty);
|
|
temMap.put("novelty", novelty);
|
|
//创造性
|
|
//创造性
|
|
@@ -337,43 +350,44 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
scenariosMaps.add(temMap);
|
|
scenariosMaps.add(temMap);
|
|
|
|
|
|
}
|
|
}
|
|
- List<Map<String,Object>> allRightScenarios=new ArrayList<>();
|
|
|
|
- List<Map<String,Object>> resultMaps =new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, Object>> allRightScenarios = new ArrayList<>();
|
|
|
|
+ List<Map<String, Object>> resultMaps = new ArrayList<>();
|
|
rightIds.forEach(tem -> {
|
|
rightIds.forEach(tem -> {
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
|
- Map<String,Object> resultMap =new HashMap<>();
|
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
List<Map<String, Object>> rightScenarios = new ArrayList<>();
|
|
List<Map<String, Object>> rightScenarios = new ArrayList<>();
|
|
//存放新颖性信息
|
|
//存放新颖性信息
|
|
- List<String> noveList=new ArrayList<>();
|
|
|
|
- List<String> creaList=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);
|
|
|
|
|
|
+ for (int t = 0; t < scenariosMaps.size(); t++) {
|
|
|
|
+ Map<String, Object> item = scenariosMaps.get(t);
|
|
if (item.get("rightId").equals(tem)) {
|
|
if (item.get("rightId").equals(tem)) {
|
|
- item.put("scenariosName","对比组合"+(t+1));
|
|
|
|
|
|
+ item.put("scenariosName", "对比组合" + (t + 1));
|
|
rightScenarios.add(item);
|
|
rightScenarios.add(item);
|
|
- if(item.get("novelty").toString()!="") {
|
|
|
|
- if(!noveList.contains(item.get("novelty").toString())){
|
|
|
|
- noveList.add(item.get("novelty").toString());}
|
|
|
|
|
|
+ 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());}
|
|
|
|
|
|
+ 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);
|
|
|
|
|
|
+ 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);
|
|
allRightScenarios.add(map);
|
|
resultMaps.add(resultMap);
|
|
resultMaps.add(resultMap);
|
|
});
|
|
});
|
|
- //1.系统数据
|
|
|
|
|
|
+ //1.系统数据
|
|
//存放单条对比结果的map
|
|
//存放单条对比结果的map
|
|
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);
|
|
@@ -381,22 +395,62 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
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("patentList", patentListMaps);
|
|
map.put("patentList", patentListMaps);
|
|
map.put("combinations", allRightScenarios);
|
|
map.put("combinations", allRightScenarios);
|
|
- map.put("allResults",resultMaps);
|
|
|
|
|
|
+ map.put("allResults", resultMaps);
|
|
// 为表格的显示绑定行循环
|
|
// 为表格的显示绑定行循环
|
|
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("remark",htmlRenderPolicy).build();
|
|
|
|
|
|
+ Configure configure = Configure.builder().bind("patentList", policy).bind("fileDetails", policy).bind("allResults", 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;
|
|
}
|
|
}
|
|
-//
|
|
|
|
-// private XWPFTemplate FTOtemplate(Integer reportId,String filePath){
|
|
|
|
-//
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param reportId
|
|
|
|
+ * @param filePath
|
|
|
|
+ * @return
|
|
|
|
+ * @description 装载FTO模板
|
|
|
|
+ */
|
|
|
|
+ private XWPFTemplate FTOtemplate(Integer reportId, String filePath, Integer templateId) throws IOException {
|
|
|
|
+ //根据报告ID获得自定义字段值的信息
|
|
|
|
+ List<Map<String, Object>> fieldMaps = reportFieldService.getFieldsMap(reportId);
|
|
|
|
+ //获得模板的配置信息
|
|
|
|
+ LambdaQueryWrapper<TemplateConfig> templateConfigWrapper = new LambdaQueryWrapper<TemplateConfig>();
|
|
|
|
+ templateConfigWrapper.eq(TemplateConfig::getTemplateId, templateId);
|
|
|
|
+ List<TemplateConfig> templateConfigs = templateConfigService.list(templateConfigWrapper);
|
|
|
|
+ List<Map<String, Object>> loadMaps = new ArrayList<>();
|
|
|
|
+ //根据配置信息装载
|
|
|
|
+ for (TemplateConfig item : templateConfigs) {
|
|
|
|
+ for (Map<String, Object> map : fieldMaps) {
|
|
|
|
+ //如果自定义字段的值映射到配置则装载
|
|
|
|
+ if (map.get("CName").toString().equals(item.getValueName())) {
|
|
|
|
+ //装载
|
|
|
|
+ map.put("CName", item.getMapName());
|
|
|
|
+ map.put("order", item.getOrderNum());
|
|
|
|
+ loadMaps.add(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> classifyMaps = new ArrayList<>();
|
|
|
|
+ //装载信息
|
|
|
|
+ for (Map<String, Object> map : loadMaps) {
|
|
|
|
+ Map<String, Object> classifyMap = new HashMap<>();
|
|
|
|
+ classifyMap.put("classify" + map.get("order"), map.get("CName"));
|
|
|
|
+ //根据自定义字段ID和值Id查询专利号
|
|
|
|
+ List<String> patentNos = reportFieldPatentLinkService.getPatentNos(Integer.parseInt(map.get("FId").toString()), Integer.parseInt(map.get("CId").toString()));
|
|
|
|
+ PatentVO patentVO = new PatentVO();
|
|
|
|
+ patentVO.setPatentNos(patentNos);
|
|
|
|
+ //根据专利号查询专利详细信息
|
|
|
|
+ String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
|
+ List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
|
|
|
|
+ }
|
|
|
|
+ XWPFTemplate template = null;
|
|
// XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
// XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
-// return template;
|
|
|
|
-// }
|
|
|
|
|
|
+ return template;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|