页眉添加期数
This commit is contained in:
+1
-1
@@ -1257,7 +1257,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
|||||||
// WordUtil.exportHeardAndFoot(document,moth);
|
// WordUtil.exportHeardAndFoot(document,moth);
|
||||||
|
|
||||||
//生成页眉页脚
|
//生成页眉页脚
|
||||||
WordUtil.exportHeardAndFoot(document,moth);
|
WordUtil.exportHeardAndFoot(document,moth,cut);
|
||||||
//生成标题
|
//生成标题
|
||||||
// WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, 18,
|
// WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, 18,
|
||||||
// false, true, "Blue Sky Noto Regular",null,null,null);
|
// false, true, "Blue Sky Noto Regular",null,null,null);
|
||||||
|
|||||||
+9
-2
@@ -208,7 +208,7 @@ public class WordUtil {
|
|||||||
|
|
||||||
//主要内容生成页眉页脚(office版本)
|
//主要内容生成页眉页脚(office版本)
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public static void exportHeardAndFoot(XWPFDocument document,String month){
|
public static void exportHeardAndFoot(XWPFDocument document,String month,String cut){
|
||||||
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
|
||||||
if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
|
||||||
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
|
||||||
@@ -232,7 +232,14 @@ public class WordUtil {
|
|||||||
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
|
||||||
run.addTab();
|
run.addTab();
|
||||||
is.close();
|
is.close();
|
||||||
run.setText(" "+month);
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
|
run.setText(" "+month+" (总第 期)");
|
||||||
|
}else{
|
||||||
|
String replace = month.replace("年", " ").replace("月", "");
|
||||||
|
String monthTemp = replace.split(" ")[1]+"/"+replace.split(" ")[0];
|
||||||
|
run.setText(" "+monthTemp+" (Issue No. )");
|
||||||
|
}
|
||||||
|
|
||||||
run.setFontSize(11);
|
run.setFontSize(11);
|
||||||
run.setFontFamily("Blue Sky Noto Regular");
|
run.setFontFamily("Blue Sky Noto Regular");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user