Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1ba9cdfc
authored
Feb 06, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
导出字段名称
1 parent
6fb9af34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/account/AccountPreferenceController.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/account/AccountPreferenceController.java
View file @
1ba9cdf
package
com
.
glsx
.
usedcar
.
web
.
rest
.
account
;
package
com
.
glsx
.
usedcar
.
web
.
rest
.
account
;
import
cn.hutool.core.date.DateUtil
;
import
com.glsx.usedcar.export.AccountPreferenceExportBean
;
import
com.glsx.usedcar.export.AccountPreferenceExportBean
;
import
com.glsx.usedcar.export.ExcelExporter
;
import
com.glsx.usedcar.export.ExcelExporter
;
import
com.glsx.usedcar.module.account.dto.*
;
import
com.glsx.usedcar.module.account.dto.*
;
...
@@ -22,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -22,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import
org.summerframework.orm.paging.Pagination
;
import
org.summerframework.orm.paging.Pagination
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -56,7 +56,9 @@ public class AccountPreferenceController {
...
@@ -56,7 +56,9 @@ public class AccountPreferenceController {
// 实体转导出Bean(需自定义AccountPreferenceExportBean)
// 实体转导出Bean(需自定义AccountPreferenceExportBean)
List
<
AccountPreferenceExportBean
>
exportBeans
=
preferences
.
stream
().
map
(
AccountPreferenceExportBean:
:
new
).
toList
();
List
<
AccountPreferenceExportBean
>
exportBeans
=
preferences
.
stream
().
map
(
AccountPreferenceExportBean:
:
new
).
toList
();
// Excel导出(复用项目的ExcelExporter工具类)
// Excel导出(复用项目的ExcelExporter工具类)
String
name
=
String
.
format
(
"收车偏好列表_%s"
,
DateUtil
.
format
(
new
Date
(),
"YYYY-MM-DD_HH_mm"
));
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd_hh-mm"
);
String
format
=
sdf
.
format
(
new
Date
());
String
name
=
String
.
format
(
"收车偏好列表_%s"
,
format
);
ExcelExporter
.
exportExcel
(
response
,
name
,
"用户偏好列表"
,
AccountPreferenceExportBean
.
class
,
exportBeans
);
ExcelExporter
.
exportExcel
(
response
,
name
,
"用户偏好列表"
,
AccountPreferenceExportBean
.
class
,
exportBeans
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment