|
@@ -25,7 +25,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
|
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
|
import com.deepoove.poi.config.Configure;
|
|
|
import com.deepoove.poi.config.ConfigureBuilder;
|
|
|
-import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
|
|
+import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
|
|
import com.deepoove.poi.policy.RenderPolicy;
|
|
|
import com.deepoove.poi.template.ElementTemplate;
|
|
|
import com.deepoove.poi.util.TableTools;
|
|
@@ -68,7 +68,7 @@ public abstract class AbstractReportExporter {
|
|
|
//word导出位置
|
|
|
String reportTempWordFile = basicPath + "/" + label + ".docx";
|
|
|
// 定义策略
|
|
|
- ConfigureBuilder builder = Configure.builder();
|
|
|
+ ConfigureBuilder builder = Configure.newBuilder();
|
|
|
this.bindConfigure(builder);
|
|
|
// 渲染数据
|
|
|
this.renderTemplate(reportTempWordFile, templatePath, builder, data);
|
|
@@ -124,7 +124,7 @@ public abstract class AbstractReportExporter {
|
|
|
* @throws IOException io异常
|
|
|
*/
|
|
|
protected abstract void renderTemplate(String reportTempWordFile, String templatePath, ConfigureBuilder builder,
|
|
|
- Map<String, Object> data) throws IOException;
|
|
|
+ Map<String, Object> data) throws IOException;
|
|
|
|
|
|
protected abstract String getBasicPath() throws IOException;
|
|
|
|
|
@@ -135,7 +135,7 @@ public abstract class AbstractReportExporter {
|
|
|
PdfPage page = pdfDoc.getPage(i);
|
|
|
final int currentPage = i;
|
|
|
new PdfCanvasProcessor(new HeadingDetectionStrategy(headings, pdfDoc, currentPage))
|
|
|
- .processPageContent(page);
|
|
|
+ .processPageContent(page);
|
|
|
}
|
|
|
}
|
|
|
return headings;
|
|
@@ -154,7 +154,7 @@ public abstract class AbstractReportExporter {
|
|
|
TocEntity last = result.get(result.size() - 1);
|
|
|
if (last.getPageNumber() == current.getPageNumber()) {
|
|
|
TocEntity combined = new TocEntity(last.getTitle() + current.getTitle(), last.getPageNumber(),
|
|
|
- last.getLevel(), last.getRect(), last.getFontSize(), last.getParagraphHeight());
|
|
|
+ last.getLevel(), last.getRect(), last.getFontSize(), last.getParagraphHeight());
|
|
|
result.set(result.size() - 1, combined);
|
|
|
continue;
|
|
|
}
|
|
@@ -164,7 +164,7 @@ public abstract class AbstractReportExporter {
|
|
|
if (i + 1 < headings.size()) {
|
|
|
TocEntity next = headings.get(i + 1);
|
|
|
TocEntity combined = new TocEntity(current.getTitle() + next.getTitle(), current.getPageNumber(),
|
|
|
- current.getLevel(), current.getRect(), current.getFontSize(), current.getParagraphHeight());
|
|
|
+ current.getLevel(), current.getRect(), current.getFontSize(), current.getParagraphHeight());
|
|
|
result.add(combined);
|
|
|
i++;
|
|
|
continue;
|
|
@@ -177,7 +177,7 @@ public abstract class AbstractReportExporter {
|
|
|
}
|
|
|
|
|
|
protected RenderPolicy getScoreRenderPolicy() {
|
|
|
- RenderPolicy policy = new LoopRowTableRenderPolicy() {
|
|
|
+ RenderPolicy policy = new HackLoopTableRenderPolicy() {
|
|
|
@SuppressWarnings("checkstyle:NestedForDepth")
|
|
|
@Override
|
|
|
public void render(ElementTemplate eleTemplate, Object data, XWPFTemplate template) {
|
|
@@ -311,7 +311,7 @@ public abstract class AbstractReportExporter {
|
|
|
}
|
|
|
|
|
|
private void addHeading(TextRenderInfo info, int level, PdfDocument pdfDoc, int i,
|
|
|
- ArrayList<TocEntity> headings) {
|
|
|
+ ArrayList<TocEntity> headings) {
|
|
|
String text = info.getText().trim();
|
|
|
LineSegment ascentLine = info.getAscentLine();
|
|
|
LineSegment descentLine = info.getDescentLine();
|