月报导出--一二级目录添加下一页(单独占用一页)

This commit is contained in:
zhn
2022-09-28 15:29:24 +08:00
parent b883a9d180
commit 63ae1789e7
@@ -38,6 +38,7 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.poi.hssf.usermodel.HeaderFooter;
import org.apache.poi.xwpf.usermodel.BreakType;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.TOC;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
@@ -916,6 +917,10 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}else{
oneTitle = lawsMonthlyReportTitleTemplateEO.getTitleEn();
}
//每个一级目录单独占一页
if(oneCount > 1){
document.createParagraph().createRun().addBreak(BreakType.PAGE);
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
0, 14, false, true, "Blue Sky Noto Regular","0","一级标题");
@@ -939,6 +944,10 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}else{
twoTitle = monthlyReportTitleTemplateEO.getTitleEn();
}
//每个二级目录单独占一页
if(twoCount > 1){
document.createParagraph().createRun().addBreak(BreakType.PAGE);
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular","1","二级标题");