Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
yn-health-science
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐俊
yn-health-science
Commits
5b9c6449
Commit
5b9c6449
authored
Aug 13, 2025
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
eb9865b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
TaskInfoToPDFUtil.java
...ain/java/com/yiboshi/science/utils/TaskInfoToPDFUtil.java
+53
-0
No files found.
science-admin/src/main/java/com/yiboshi/science/utils/TaskInfoToPDFUtil.java
View file @
5b9c6449
...
...
@@ -76,6 +76,9 @@ public class TaskInfoToPDFUtil {
// 添加项目绩效目标表
addProjectKPITable
(
document
,
dto
,
sfChinese
,
fsChinese
);
// 附件清单
addFileTable
(
document
,
dto
,
sfChinese
,
fsChinese
);
// 共同条款
addCommonTerms
(
document
,
dto
,
sfChinese
,
fsChinese
);
...
...
@@ -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
,
14
f
,
Font
.
BOLD
);
Font
normalFont
=
new
Font
(
bfChinese
,
12
f
,
Font
.
NORMAL
);
Font
labelFont
=
new
Font
(
bfChinese
,
11
f
,
Font
.
NORMAL
);
// 添加标题
addSection
(
document
,
"九、附件清单"
,
titleFont
);
// 创建附件清单表格
PdfPTable
fileTable
=
new
PdfPTable
(
4
);
fileTable
.
setWidths
(
new
float
[]{
80
f
,
300
f
,
80
f
,
200
f
});
fileTable
.
setWidthPercentage
(
100
);
// 表头
addCell
(
fileTable
,
"序号"
,
null
,
null
,
labelFont
,
40
f
,
Element
.
ALIGN_CENTER
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
"附件名称"
,
null
,
null
,
labelFont
,
40
f
,
Element
.
ALIGN_CENTER
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
"份数"
,
null
,
null
,
labelFont
,
40
f
,
Element
.
ALIGN_CENTER
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
"备注"
,
null
,
null
,
labelFont
,
40
f
,
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
,
40
f
,
Element
.
ALIGN_CENTER
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
attachment
[
1
],
null
,
null
,
normalFont
,
40
f
,
Element
.
ALIGN_LEFT
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
attachment
[
2
],
null
,
null
,
normalFont
,
40
f
,
Element
.
ALIGN_CENTER
,
Element
.
ALIGN_MIDDLE
);
addCell
(
fileTable
,
attachment
[
3
],
null
,
null
,
normalFont
,
40
f
,
Element
.
ALIGN_LEFT
,
Element
.
ALIGN_MIDDLE
);
}
document
.
add
(
fileTable
);
// 添加说明文字
Paragraph
note
=
new
Paragraph
(
"注:以上附件为项目合同书的重要组成部分,请按要求提供完整材料。"
,
new
Font
(
bfChinese
,
10
f
,
Font
.
NORMAL
));
note
.
setSpacingBefore
(
20
f
);
note
.
setFirstLineIndent
(
28
f
);
document
.
add
(
note
);
}
private
static
void
addCommonTerms
(
Document
document
,
ComProjectTaskDTO
dto
,
BaseFont
bfChinese
,
BaseFont
fsChinese
)
throws
DocumentException
{
document
.
newPage
();
Font
titleFont
=
new
Font
(
bfChinese
,
14
f
,
Font
.
BOLD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment