Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
78ef0514
Commit
78ef0514
authored
Nov 12, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export fileName
parent
89fcee22
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+6
-3
OutputInvoiceController.java
.../pwc/taxtech/atms/controller/OutputInvoiceController.java
+6
-3
vatExportService.js
...rc/main/webapp/app/common/vatservices/vatExportService.js
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
78ef0514
...
...
@@ -47,11 +47,14 @@ public class InputInvoiceImportController {
public
void
downloadInvoiceQueryData
(
@RequestBody
InputInvoicePreviewQueryParam
paras
,
HttpServletResponse
response
,
@RequestHeader
(
"from"
)
String
projectId
)
{
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xlsx
"
);
response
.
set
Header
(
"x-file-name"
,
UUID
.
randomUUID
()
+
".xlsx
"
);
response
.
addHeader
(
"Access-Control-Expose-Headers"
,
"Content-Type,Content-Disposition,x-file-name
"
);
response
.
set
CharacterEncoding
(
"UTF-8
"
);
String
fileName
=
paras
.
getPeriodStart
()
+
"-"
+
paras
.
getPeriodEnd
();
OutputStream
os
=
null
;
try
{
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xls"
);
response
.
addHeader
(
"x-file-name"
,
fileName
+
".xlsx"
);
os
=
response
.
getOutputStream
();
int
count
=
getDownloadFilePath
(
paras
,
os
,
projectId
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OutputInvoiceController.java
View file @
78ef0514
...
...
@@ -53,11 +53,14 @@ public class OutputInvoiceController {
@RequestMapping
(
value
=
"getExportOutputInvoiceList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
downloadInvoiceQueryData
(
@RequestBody
QueryOutputDto
paras
,
@RequestHeader
(
"from"
)
String
projectId
,
HttpServletResponse
response
)
{
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xls"
);
response
.
set
Header
(
"x-file-name"
,
UUID
.
randomUUID
()
+
".xlsx
"
);
response
.
addHeader
(
"Access-Control-Expose-Headers"
,
"Content-Type,Content-Disposition,x-file-name"
);
String
fileName
=
paras
.
getPeriodStart
()
+
"-"
+
paras
.
getPeriodEnd
(
);
response
.
set
CharacterEncoding
(
"UTF-8
"
);
OutputStream
os
=
null
;
try
{
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
UUID
.
randomUUID
()
+
".xls"
);
response
.
addHeader
(
"x-file-name"
,
fileName
+
".xlsx"
);
os
=
response
.
getOutputStream
();
int
count
=
getDownloadFilePath
(
paras
,
projectId
,
os
);
...
...
atms-web/src/main/webapp/app/common/vatservices/vatExportService.js
View file @
78ef0514
...
...
@@ -15,7 +15,7 @@
headers
=
headers
();
// Get the filename from the x-filename header or default to "download.bin"
var
filename
=
decodeURI
(
headers
[
'x-file-name'
])
||
defaultFileName
;
var
filename
=
decodeURI
(
headers
[
'x-file-name'
])
+
defaultFileName
;
// Determine the content type from the header or default to "application/octet-stream"
var
contentType
=
headers
[
'content-type'
]
||
octetStreamMime
;
...
...
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