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
9143322a
Commit
9143322a
authored
Apr 21, 2022
by
李成龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
f297d4f8
7b0ff5c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
WebServicesFileFransferResource.java
...amos/avic/controller/WebServicesFileFransferResource.java
+14
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/WebServicesFileFransferResource.java
View file @
9143322a
...
...
@@ -6,8 +6,10 @@ import java.io.FileNotFoundException;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -21,6 +23,8 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.cxf.endpoint.Client
;
import
org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory
;
import
org.apache.cxf.transport.http.HTTPConduit
;
import
org.apache.cxf.transports.http.configuration.HTTPClientPolicy
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -77,6 +81,9 @@ public class WebServicesFileFransferResource {
@Value
(
value
=
"${upload.temp.dir}"
)
String
tempDir
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSSS"
);
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"文件下载"
)
...
...
@@ -130,8 +137,9 @@ public class WebServicesFileFransferResource {
}
String
fileName
=
file
.
getOriginalFilename
();
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
String
name
=
fileName
.
substring
(
0
,
fileName
.
lastIndexOf
(
"."
)
-
1
);
String
filePath
=
tempDir
;
fileName
=
UUID
.
randomUUID
(
)
+
suffixName
;
fileName
=
name
+
"-"
+
sdf
.
format
(
new
Date
()
)
+
suffixName
;
File
dest
=
new
File
(
filePath
+
fileName
);
if
(!
dest
.
getParentFile
().
exists
())
{
dest
.
getParentFile
().
mkdirs
();
...
...
@@ -210,6 +218,11 @@ public class WebServicesFileFransferResource {
try
{
JaxWsDynamicClientFactory
dcf
=
JaxWsDynamicClientFactory
.
newInstance
();
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
HTTPConduit
conduit
=
(
HTTPConduit
)
client
.
getConduit
();
HTTPClientPolicy
policy
=
new
HTTPClientPolicy
();
policy
.
setConnectionTimeout
(
1000000
);
// 连接超时时间
policy
.
setReceiveTimeout
(
1000000
);
// 请求超时时间.
conduit
.
setClient
(
policy
);
if
(
ObjectUtils
.
isEmpty
(
transferModel
.
getAvicCode
()))
{
for
(
String
file
:
transferModel
.
getFiles
().
stream
().
map
(
m
->
m
.
getUrl
())
.
collect
(
Collectors
.
toList
()))
{
...
...
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