月报导出与标题模板顺序一致
This commit is contained in:
+19
-9
@@ -611,10 +611,11 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*创建word文件
|
*
|
||||||
* @param path
|
* @param path
|
||||||
* @param lawsMonthlyReportWriteEOS 列表数据
|
* @param lawsMonthlyReportWriteEOS 所有月报
|
||||||
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
|
* @param lawsMonthlyReportTitleTemplateEOS 二级目录(没有排序)
|
||||||
|
* @param loginUserList
|
||||||
*/
|
*/
|
||||||
private void createWord(String path,
|
private void createWord(String path,
|
||||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
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,
|
private void word(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS,
|
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS,
|
||||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList,
|
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList,
|
||||||
@@ -799,12 +808,13 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(oneTitle)){
|
if(StringUtils.isNotBlank(oneTitle)){
|
||||||
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT,
|
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++;
|
oneCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
|
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
|
||||||
|
//二级目录按sort正序排序
|
||||||
|
Collections.sort(reportTitleTwoList);//正序排序
|
||||||
|
|
||||||
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
|
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
|
||||||
int reportCount = 1;
|
int reportCount = 1;
|
||||||
@@ -822,7 +832,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(twoTitle)){
|
if(StringUtils.isNotBlank(twoTitle)){
|
||||||
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT,
|
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++;
|
twoCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -836,7 +846,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
}
|
}
|
||||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
|
||||||
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT,
|
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++;
|
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());
|
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
|
||||||
|
Collections.sort(reportTitleTwoList);//正序排序
|
||||||
|
|
||||||
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
|
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
|
||||||
int reportCount = 1;
|
int reportCount = 1;
|
||||||
|
|||||||
+1
-1
@@ -406,7 +406,7 @@ public class WordUtil {
|
|||||||
paragraph.setAlignment(ParagraphAlignment.CENTER);
|
paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||||
XWPFRun run = paragraph.createRun();
|
XWPFRun run = paragraph.createRun();
|
||||||
run.setText("NIO Internal");
|
run.setText("NIO Internal");
|
||||||
run.setFontSize(18);
|
run.setFontSize(12);
|
||||||
run.setFontFamily("Blue Sky Standard Regular");
|
run.setFontFamily("Blue Sky Standard Regular");
|
||||||
// run.setFontFamily("Blue Sky Noto Regular");
|
// run.setFontFamily("Blue Sky Noto Regular");
|
||||||
run.setBold(true);
|
run.setBold(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user