Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
169358a5
Commit
169358a5
authored
Oct 27, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复下载乱码
parent
2538852e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
FileHelper.java
...ava/com/yeejoin/amos/patrol/business/util/FileHelper.java
+9
-5
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/util/FileHelper.java
View file @
169358a5
...
...
@@ -870,12 +870,16 @@ public static void exportExcel(List<Map<String, Object>> list, String fileName,
private
static
void
downLoadExcel
(
String
fileName
,
HttpServletResponse
response
,
Workbook
workbook
)
{
try
{
String
name
=
new
String
(
fileName
.
getBytes
(
"UTF-8"
),
"ISO8859_1"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
);
// String name = new String(fileName.getBytes("UTF-8"), "ISO8859_1");
// response.setHeader("content-Type", "application/vnd.ms-excel");
// response.setHeader("Content-Disposition",
// "attachment;filename=" + name);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
workbook
.
write
(
response
.
getOutputStream
());
workbook
.
write
(
response
.
getOutputStream
());
}
catch
(
IOException
e
)
{
throw
new
YeeException
(
e
.
getMessage
());
}
...
...
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