Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-api
Project
Project
Details
Activity
Releases
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
中汽研标准应用数据库
car-database-api
Commits
ace6e061
Commit
ace6e061
authored
Sep 04, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出方案
parent
56106ce8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
TestPlanRecordController.java
...src/main/java/com/ruoyi/web/TestPlanRecordController.java
+1
-1
ExcelMultipleSheetsUtil.java
...a/com/ruoyi/common/utils/poi/ExcelMultipleSheetsUtil.java
+5
-2
No files found.
quality-review/src/main/java/com/ruoyi/web/TestPlanRecordController.java
View file @
ace6e061
...
@@ -168,7 +168,7 @@ public class TestPlanRecordController extends BaseController{
...
@@ -168,7 +168,7 @@ public class TestPlanRecordController extends BaseController{
}
}
});
});
ExcelMultipleSheetsUtil
.
excelMultipleSheets
(
result
,
"导出方案"
+
DateUtil
.
format
(
new
Date
(),
"yyyyMMdd
HHmmss
"
),
XLSX_SUFFIX
,
respon
);
ExcelMultipleSheetsUtil
.
excelMultipleSheets
(
result
,
"导出方案"
+
DateUtil
.
format
(
new
Date
(),
"yyyyMMdd"
),
XLSX_SUFFIX
,
respon
);
}
}
}
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelMultipleSheetsUtil.java
View file @
ace6e061
...
@@ -100,7 +100,11 @@ public class ExcelMultipleSheetsUtil {
...
@@ -100,7 +100,11 @@ public class ExcelMultipleSheetsUtil {
private
static
void
createHeaderRow
(
Sheet
sheet
,
Class
<?>
clazz
)
{
private
static
void
createHeaderRow
(
Sheet
sheet
,
Class
<?>
clazz
)
{
// 创建单元格样式
// 创建单元格样式
CellStyle
headerCellStyle
=
createCellStyle
(
sheet
.
getWorkbook
());
CellStyle
headerCellStyle
=
createCellStyle
(
sheet
.
getWorkbook
());
headerCellStyle
.
setFillForegroundColor
(
IndexedColors
.
GREY_50_PERCENT
.
getIndex
());
// 填充效果(全景填充)
headerCellStyle
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
headerCellStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
headerCellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
// 创建标题行
// 创建标题行
Row
headerRow
=
sheet
.
createRow
(
0
);
Row
headerRow
=
sheet
.
createRow
(
0
);
Field
[]
fields
=
clazz
.
getDeclaredFields
();
Field
[]
fields
=
clazz
.
getDeclaredFields
();
...
@@ -150,7 +154,6 @@ public class ExcelMultipleSheetsUtil {
...
@@ -150,7 +154,6 @@ public class ExcelMultipleSheetsUtil {
cellStyle
.
setLeftBorderColor
(
IndexedColors
.
GREY_50_PERCENT
.
getIndex
());
cellStyle
.
setLeftBorderColor
(
IndexedColors
.
GREY_50_PERCENT
.
getIndex
());
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
cellStyle
.
setRightBorderColor
(
IndexedColors
.
GREY_50_PERCENT
.
getIndex
());
cellStyle
.
setRightBorderColor
(
IndexedColors
.
GREY_50_PERCENT
.
getIndex
());
// 设置字体
// 设置字体
Font
dataFont
=
workbook
.
createFont
();
Font
dataFont
=
workbook
.
createFont
();
dataFont
.
setFontName
(
"Arial"
);
dataFont
.
setFontName
(
"Arial"
);
...
...
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