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
908e4b7e
Commit
908e4b7e
authored
Jul 13, 2021
by
付培阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
值班导入导出
parent
7d1f1741
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
ExcelUtil.java
.../yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
+5
-2
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
View file @
908e4b7e
...
...
@@ -120,7 +120,8 @@ public class ExcelUtil {
}
}
}
// String s = new String(fileName.getBytes(), "UTF-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
ExcelWriterSheetBuilder
excelWriterSheetBuilder
=
EasyExcel
.
write
(
getOutputStream
(
fileName
,
response
,
ExcelTypeEnum
.
XLSX
)).
head
(
dutyCarTitleList
).
excelType
(
ExcelTypeEnum
.
XLSX
)
.
sheet
(
sheetName
).
registerWriteHandler
(
new
TemplateCellWriteHandlerDate
(
explicitListConstraintMap
))
...
...
@@ -251,10 +252,12 @@ public class ExcelUtil {
//创建本地文件
String
filePath
=
fileName
+
excelTypeEnum
.
getValue
();
try
{
fileName
=
new
String
(
filePath
.
getBytes
(),
StandardCharsets
.
ISO_8859_1
);
fileName
=
new
String
(
filePath
.
getBytes
(),
"UTF-8"
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setContentType
(
"application/vnd.ms-excel"
);
response
.
addHeader
(
"Content-Disposition"
,
"filename="
+
fileName
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
fileName
,
StandardCharsets
.
UTF_8
.
name
()));
return
response
.
getOutputStream
();
}
catch
(
IOException
e
)
{
throw
new
Exception
(
"系统异常"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ExcelController.java
View file @
908e4b7e
...
...
@@ -159,7 +159,7 @@ public class ExcelController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"上传文件数据-"
)
@PostMapping
(
"/upload"
)
public
void
template2
(
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
{
public
void
template2
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
{
try
{
switch
(
excelDto
.
getType
())
{
...
...
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