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
51f29838
Commit
51f29838
authored
Dec 26, 2023
by
liufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:移装变更导出的文件的格式,返回文件流
parent
b6c35c6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
JgChangeRegistrationTransferController.java
...iz/controller/JgChangeRegistrationTransferController.java
+26
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationTransferController.java
View file @
51f29838
...
@@ -9,6 +9,13 @@ import io.swagger.annotations.ApiOperation;
...
@@ -9,6 +9,13 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.Map
;
import
java.util.Map
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
@@ -148,8 +155,25 @@ public class JgChangeRegistrationTransferController extends BaseController {
...
@@ -148,8 +155,25 @@ public class JgChangeRegistrationTransferController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
){
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
)
throws
IOException
{
jgChangeRegistrationTransferService
.
exportUseRegistrationCertificate
(
sequenceNbr
);
File
file
=
jgChangeRegistrationTransferService
.
exportUseRegistrationCertificate
(
sequenceNbr
);
if
(
ValidationUtil
.
isEmpty
(
file
)){
throw
new
BadRequest
(
"使用登记证导出失败,请稍后重试!"
);
}
FileInputStream
in
=
new
FileInputStream
(
file
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
"使用登记证"
,
"UTF-8"
)
+
".pdf"
);
response
.
setHeader
(
"content-Type"
,
"application/msword"
);
response
.
setCharacterEncoding
(
"utf-8"
);
OutputStream
out
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
int
b
=
0
;
byte
[]
buffer
=
new
byte
[
2048
];
while
((
b
=
in
.
read
(
buffer
))
!=
-
1
)
{
out
.
write
(
buffer
,
0
,
b
);
}
in
.
close
();
out
.
flush
();
out
.
close
();
}
}
}
}
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