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
b6a1b65e
Commit
b6a1b65e
authored
May 31, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed excel get method
parent
44f8a49e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
TemplateController.java
.../java/pwc/taxtech/atms/controller/TemplateController.java
+12
-6
TemplateService.java
...c/main/java/pwc/taxtech/atms/service/TemplateService.java
+3
-0
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+5
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/TemplateController.java
View file @
b6a1b65e
...
...
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
import
pwc.taxtech.atms.common.ApplicationException
;
import
pwc.taxtech.atms.common.ftp.FTPClientPool
;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.entitiy.Template
;
import
pwc.taxtech.atms.service.TemplateService
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -57,21 +58,26 @@ public class TemplateController {
String
filePath
;
File
templateFile
;
InputStream
inputStream
=
null
;
String
templatePath
=
templateService
.
getTemplatePath
(
templateID
);
if
(
StringUtils
.
isEmpty
(
templateID
))
{
Template
template
=
templateService
.
getTemplateByID
(
templateID
);
String
templatePath
=
template
.
getPath
();
if
(
StringUtils
.
isBlank
(
templateID
))
{
return
;
}
if
(
templatePath
==
null
||
StringUtils
.
isEmpty
(
templatePath
))
{
if
(
StringUtils
.
isBlank
(
templatePath
))
{
return
;
}
filePath
=
this
.
getClass
().
getResource
(
""
).
toURI
().
getPath
();
String
tempPath
=
filePath
.
substring
(
0
,
filePath
.
indexOf
(
"classes"
)
+
"\\classes"
.
length
());
templateFile
=
new
File
(
tempPath
+
template
Service
.
getTemplatePath
(
templateID
)
);
templateFile
=
new
File
(
tempPath
+
template
Path
);
try
{
inputStream
=
new
BufferedInputStream
(
new
FileInputStream
(
templateFile
));
//如果是系统报表就取本地文件夹,如果不是就取FTP
if
(
template
.
getIsSystemType
())
{
inputStream
=
new
BufferedInputStream
(
new
FileInputStream
(
templateFile
));
}
else
{
inputStream
=
ftpClientPool
.
download
(
templatePath
);
}
//客户端保存的文件名
String
customFileName
=
"template_"
+
DateTime
.
now
().
toString
(
"yyyyMMddHHmmss"
)
+
".xlsx"
;
response
.
setHeader
(
"Content-Disposition"
,
String
.
format
(
"inline; filename=\""
+
customFileName
+
"\""
));
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/TemplateService.java
View file @
b6a1b65e
package
pwc
.
taxtech
.
atms
.
service
;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.entitiy.Template
;
import
java.util.List
;
...
...
@@ -14,6 +15,8 @@ public interface TemplateService {
String
getTemplatePath
(
String
templateID
);
Template
getTemplateByID
(
String
templateID
);
List
<
TemplateUniqDto
>
getTemplateUniqList
(
String
serviceTypeID
,
Integer
payTaxType
,
Integer
reportType
,
String
industryIDs
);
OperationResultDto
<
Object
>
updateTemplateName
(
UpateNameParam
param
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
b6a1b65e
...
...
@@ -58,6 +58,11 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return
result
;
}
@Override
public
Template
getTemplateByID
(
String
templateID
)
{
return
templateMapper
.
selectByPrimaryKey
(
templateID
);
}
@Override
public
List
<
TemplateUniqDto
>
getTemplateUniqList
(
String
serviceTypeID
,
Integer
payTaxType
,
Integer
reportType
,
String
industryIDs
)
{
...
...
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