|
@@ -480,7 +480,13 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
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;
|
|
@@ -696,13 +702,20 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
return template;
|
|
return template;
|
|
}
|
|
}
|
|
|
|
|
|
- private XWPFTemplate avoidDesignTemplate(Integer reportId, String filePath) {
|
|
|
|
|
|
+ private XWPFTemplate avoidDesignTemplate(Integer reportId, String filePath) throws IOException {
|
|
log.info("开始处理导出规避设计报告,参数为:{}, {}", reportId, filePath);
|
|
log.info("开始处理导出规避设计报告,参数为:{}, {}", reportId, filePath);
|
|
Report report = reportService.getById(reportId);
|
|
Report report = reportService.getById(reportId);
|
|
String signPatentNo = report.getSignPatentNo();
|
|
String signPatentNo = report.getSignPatentNo();
|
|
|
|
|
|
- //装载公开/公告号
|
|
|
|
|
|
+ //装载标的专利信息
|
|
|
|
+ Map<String, Object> signPatent = this.signPantentMess(report.getSignPatentNo());
|
|
|
|
+ System.out.println(signPatent.get(""));
|
|
|
|
+
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
+ //装载标的专利信息
|
|
|
|
+ map.put("signPatent", signPatent);
|
|
|
|
+ map.put("rights", signPatent.get("rights"));
|
|
|
|
+ //装载公开/公告号
|
|
map.put("pantentNo", signPatentNo);
|
|
map.put("pantentNo", signPatentNo);
|
|
|
|
|
|
//装载年月日
|
|
//装载年月日
|
|
@@ -725,6 +738,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
//把指定元素内容识别传输成html格式
|
|
//把指定元素内容识别传输成html格式
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
Configure configure = Configure.builder()
|
|
Configure configure = Configure.builder()
|
|
|
|
+ .bind("signPatent.rights", policy)
|
|
.bind("features", policy)
|
|
.bind("features", policy)
|
|
.bind("explainText", htmlRenderPolicy)
|
|
.bind("explainText", htmlRenderPolicy)
|
|
.bind("littleDirection", htmlRenderPolicy)
|
|
.bind("littleDirection", htmlRenderPolicy)
|
|
@@ -785,9 +799,11 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
//解析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<>();
|
|
List<Map<String, Object>> rights = new ArrayList<>();
|
|
- patentRightsOrgin.forEach(item -> {
|
|
|
|
|
|
+ //给权要进行格式更改
|
|
|
|
+ List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin);
|
|
|
|
+ patentRights.forEach(item -> {
|
|
Map<String, Object> temMap = new HashMap<>();
|
|
Map<String, Object> temMap = new HashMap<>();
|
|
- temMap.put("rightName", "权" + item.getSort());
|
|
|
|
|
|
+ temMap.put("rightName", "权" + (item.getSort() + 1));
|
|
temMap.put("content", item.getContent());
|
|
temMap.put("content", item.getContent());
|
|
rights.add(temMap);
|
|
rights.add(temMap);
|
|
});
|
|
});
|