Commit 5b9c6449 authored by wangxl's avatar wangxl

1

parent eb9865b5
...@@ -76,6 +76,9 @@ public class TaskInfoToPDFUtil { ...@@ -76,6 +76,9 @@ public class TaskInfoToPDFUtil {
// 添加项目绩效目标表 // 添加项目绩效目标表
addProjectKPITable(document, dto, sfChinese, fsChinese); addProjectKPITable(document, dto, sfChinese, fsChinese);
// 附件清单
addFileTable(document, dto, sfChinese, fsChinese);
// 共同条款 // 共同条款
addCommonTerms(document, dto, sfChinese, fsChinese); addCommonTerms(document, dto, sfChinese, fsChinese);
...@@ -929,6 +932,56 @@ public class TaskInfoToPDFUtil { ...@@ -929,6 +932,56 @@ public class TaskInfoToPDFUtil {
} }
private static void addFileTable(Document document, ComProjectTaskDTO dto, BaseFont bfChinese, BaseFont fsChinese) throws DocumentException {
document.newPage();
Font titleFont = new Font(bfChinese, 14f, Font.BOLD);
Font normalFont = new Font(bfChinese, 12f, Font.NORMAL);
Font labelFont = new Font(bfChinese, 11f, Font.NORMAL);
// 添加标题
addSection(document, "九、附件清单", titleFont);
// 创建附件清单表格
PdfPTable fileTable = new PdfPTable(4);
fileTable.setWidths(new float[]{80f, 300f, 80f, 200f});
fileTable.setWidthPercentage(100);
// 表头
addCell(fileTable, "序号", null, null, labelFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
addCell(fileTable, "附件名称", null, null, labelFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
addCell(fileTable, "份数", null, null, labelFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
addCell(fileTable, "备注", null, null, labelFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
// 附件列表内容
String[][] attachments = {
{"1", "项目申请书", "1", ""},
{"2", "项目可行性研究报告", "1", ""},
{"3", "项目预算书", "1", ""},
{"4", "项目组成员简历", "1", ""},
{"5", "项目承担单位资质证明", "1", ""},
{"6", "项目合作协议(如有合作单位)", "1", ""},
{"7", "项目技术方案", "1", ""},
{"8", "项目进度计划", "1", ""},
{"9", "项目风险分析报告", "1", ""},
{"10", "项目预期成果说明", "1", ""}
};
for (String[] attachment : attachments) {
addCell(fileTable, attachment[0], null, null, normalFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
addCell(fileTable, attachment[1], null, null, normalFont, 40f, Element.ALIGN_LEFT, Element.ALIGN_MIDDLE);
addCell(fileTable, attachment[2], null, null, normalFont, 40f, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE);
addCell(fileTable, attachment[3], null, null, normalFont, 40f, Element.ALIGN_LEFT, Element.ALIGN_MIDDLE);
}
document.add(fileTable);
// 添加说明文字
Paragraph note = new Paragraph("注:以上附件为项目合同书的重要组成部分,请按要求提供完整材料。", new Font(bfChinese, 10f, Font.NORMAL));
note.setSpacingBefore(20f);
note.setFirstLineIndent(28f);
document.add(note);
}
private static void addCommonTerms(Document document, ComProjectTaskDTO dto, BaseFont bfChinese, BaseFont fsChinese) throws DocumentException { private static void addCommonTerms(Document document, ComProjectTaskDTO dto, BaseFont bfChinese, BaseFont fsChinese) throws DocumentException {
document.newPage(); document.newPage();
Font titleFont = new Font(bfChinese, 14f, Font.BOLD); Font titleFont = new Font(bfChinese, 14f, Font.BOLD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment