月报导出与标题模板顺序一致

This commit is contained in:
zhn
2022-10-27 14:19:30 +08:00
parent 99f733ec97
commit b511a20216
2 changed files with 20 additions and 10 deletions
@@ -611,10 +611,11 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
/**
*创建word文件
*
* @param path
* @param lawsMonthlyReportWriteEOS 列表数据
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
* @param lawsMonthlyReportWriteEOS 所有月报
* @param lawsMonthlyReportTitleTemplateEOS 二级目录(没有排序)
* @param loginUserList
*/
private void createWord(String path,
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
@@ -763,7 +764,15 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
// }
/**
*
* @param lawsMonthlyReportWriteEOS 月报
* @param lawsMonthlyReportTitleTemplateEOS 二级目录(参数传过来时没有排序)
* @param reportTitleOneList 一级目录(参数传过来时已经进行正序排序)
* @param titleCN
* @param document
* @param cut
*/
private void word(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS,
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList,
@@ -799,12 +808,13 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
0, 12, false, true, "Blue Sky Noto Regular","0","一级标题",null);
0, 11, false, true, "Blue Sky Noto Regular","0","一级标题",null);
oneCount++;
}
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
//二级目录按sort正序排序
Collections.sort(reportTitleTwoList);//正序排序
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
int reportCount = 1;
@@ -822,7 +832,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
2, 12, false, true, "Blue Sky Noto Regular","1","二级标题",null);
2, 11, false, true, "Blue Sky Noto Regular","1","二级标题",null);
twoCount++;
}
@@ -836,7 +846,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT,
4, 12, false, false, "Blue Sky Noto Regular","2","三级标题",null);
4, 11, false, false, "Blue Sky Noto Regular","2","三级标题",null);
reportCount++;
}
}
@@ -1173,7 +1183,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
Collections.sort(reportTitleTwoList);//正序排序
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
int reportCount = 1;
@@ -406,7 +406,7 @@ public class WordUtil {
paragraph.setAlignment(ParagraphAlignment.CENTER);
XWPFRun run = paragraph.createRun();
run.setText("NIO Internal");
run.setFontSize(18);
run.setFontSize(12);
run.setFontFamily("Blue Sky Standard Regular");
// run.setFontFamily("Blue Sky Noto Regular");
run.setBold(true);