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
37feffd7
Commit
37feffd7
authored
Jul 17, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add attachment file upload function -- frank
parent
470d28f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
OrganizationHKServiceImpl.java
.../taxtech/atms/service/impl/OrganizationHKServiceImpl.java
+3
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationHKServiceImpl.java
View file @
37feffd7
...
...
@@ -519,7 +519,7 @@ public class OrganizationHKServiceImpl {
public
OperationResultDto
<
Object
>
uploadAttachs
(
CommonsMultipartFile
[]
files
,
String
orgId
)
{
logger
.
debug
(
"OrganizationHKServiceImpl uploadAttachs start"
);
OperationResultDto
<
Object
>
result
=
new
OperationResultDto
<>();
List
<
OrganizationAttachment
>
organizationAttachments
=
new
ArrayList
<>();
List
<
OrganizationAttachment
Dto
>
organizationAttachments
=
new
ArrayList
<>();
for
(
CommonsMultipartFile
file
:
files
)
{
final
String
orginalName
=
file
.
getOriginalFilename
();
logger
.
debug
(
"orgianal file name[{}]"
,
orginalName
);
...
...
@@ -561,7 +561,7 @@ public class OrganizationHKServiceImpl {
logger
.
debug
(
"save file in database"
);
OrganizationAttachment
organizationAttachment
=
saveOrgAttachments
(
filePath
,
filePathToSave
,
fileNameToSave
,
orgId
,
file
,
fileExtension
);
organizationAttachments
.
add
(
organizationAttachment
);
organizationAttachments
.
add
(
organizationAttachment
TMapper
.
toOrganizationAttachmentDto
(
organizationAttachment
)
);
}
if
(
CollectionUtils
.
isEmpty
(
organizationAttachments
))
{
...
...
@@ -608,7 +608,7 @@ public class OrganizationHKServiceImpl {
public
void
downloadAttachment
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Long
attachmentId
)
{
OrganizationAttachment
attachment
=
organizationAttachmentMapper
.
selectByPrimaryKey
(
attachmentId
);
Assert
.
notNull
(
attachment
,
"attach
emtn
is null"
);
Assert
.
notNull
(
attachment
,
"attach
ment
is null"
);
String
fileName
=
attachment
.
getDocumentName
();
String
filePath
=
fileDirectory
+
"/"
+
attachment
.
getDocumentPath
();
FileExcelUtil
.
downloadFile
(
request
,
response
,
fileName
,
filePath
);
...
...
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