解决生成手册最后一页有换行符问题

This commit is contained in:
zhaol 2025-02-10 09:19:26 +08:00
parent a7ff9a43ba
commit 2d377beec9
2 changed files with 20 additions and 13 deletions

View File

@ -556,7 +556,7 @@ public class OutputWordUtil {
//定义表格数据
String[] header = {"版本", "拟制/修订单位","拟制/修订人","拟制/修订日期","审核人","复核人","审批人","修订内容及理由"};
String[][] strArray2 = new String[versionHistoryTable.size()][];
List<String[]> list = new LinkedList<>();
List<String[]> list = new LinkedList<>();
for (int i = 0; i < versionHistoryTable.size(); i++) {
JSONObject jsonObject = versionHistoryTable.getJSONObject(i);
String[] strArray = new String[8];
@ -898,10 +898,9 @@ public class OutputWordUtil {
Section section = doc.getLastSection();
//添加段落设置一级序列
Paragraph paragraph = section.addParagraph();
//Paragraph paragraph = section.addParagraph();
//paragraph.appendBreak(BreakType.Page_Break);
//Section section2 = doc.addSection();
//关键控制点风险矩阵 开始
PALRepositoryPropertyModel riskMatrixInfo = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(), "riskMatrixInfo");
@ -1265,18 +1264,18 @@ public class OutputWordUtil {
if (relationList.size() > 0) {
for (DesignerShapeRelationModel relation : relationList) {
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
List<PALRepositoryModel> models = PALRepositoryCache.getByVersionId(relationFileId);
if (models != null && models.size() > 0) {
index++;
for(PALRepositoryModel oneModel:models){
if(oneModel.isUse()==true){
JSONObject tmp = new JSONObject();
tmp.put("name", oneModel.getName());
tmp.put("desc", index);
related_support_files.add(tmp);
}
List<PALRepositoryModel> models = PALRepositoryCache.getByVersionId(relationFileId);
if (models != null && models.size() > 0) {
index++;
for(PALRepositoryModel oneModel:models){
if(oneModel.isUse()==true){
JSONObject tmp = new JSONObject();
tmp.put("name", oneModel.getName());
tmp.put("desc", index);
related_support_files.add(tmp);
}
}
}
}
@ -1438,6 +1437,7 @@ public class OutputWordUtil {
if (suffix.equals(".doc") || suffix.equals(".docx")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/word.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".doc")) {
paragraph5.appendOleObject(stream1, pic1, "doc");
} else if (suffix.equals(".docx")) {
@ -1446,10 +1446,12 @@ public class OutputWordUtil {
} else if (suffix.equals(".pdf")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/pdf.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
paragraph5.appendOleObject(stream1, pic1, "pdf");
} else if (suffix.equals(".xls") || suffix.equals(".xlsx")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/xls.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".xls")) {
paragraph5.appendOleObject(stream1, pic1, "xls");
} else if (suffix.equals(".xlsx")) {
@ -1458,6 +1460,7 @@ public class OutputWordUtil {
} else if (suffix.equals(".png") || suffix.equals(".jgp")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/png.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".png")) {
paragraph5.appendOleObject(stream1, pic1, "png");
} else if (suffix.equals(".jpg")) {
@ -1466,6 +1469,7 @@ public class OutputWordUtil {
} else if (suffix.equals(".zip") || suffix.equals(".rar")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/zip.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".zip")) {
paragraph5.appendOleObject(stream1, pic1, "zip");
} else if (suffix.equals(".rar")) {
@ -1474,6 +1478,7 @@ public class OutputWordUtil {
} else if (suffix.equals(".mp3") || suffix.equals(".mp4")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/mp3.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".mp3")) {
paragraph5.appendOleObject(stream1, pic1, "mp3");
} else if (suffix.equals(".mp4")) {
@ -1482,6 +1487,7 @@ public class OutputWordUtil {
} else if (suffix.equals(".ppt") || suffix.equals(".pptx")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/ppt.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
if (suffix.equals(".ppt")) {
paragraph5.appendOleObject(stream1, pic1, "ppt");
} else if (suffix.equals(".pptx")) {
@ -1490,6 +1496,7 @@ public class OutputWordUtil {
} else if (suffix.equals(".txt")) {
pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png");
paragraph5.appendText(dcContextModel.getFileName()+" ");
paragraph5.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
paragraph5.appendOleObject(stream1, pic1, "txt");
}