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
2d6b4554
Commit
2d6b4554
authored
Apr 24, 2022
by
chenzhao
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
542f72b1
9dfe2add
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
12 deletions
+137
-12
TransferModel.java
.../java/com/yeejoin/amos/avic/face/model/TransferModel.java
+2
-0
AmosAuth.java
.../src/main/java/com/yeejoin/amos/avic/config/AmosAuth.java
+89
-0
WebServicesFileFransferResource.java
...amos/avic/controller/WebServicesFileFransferResource.java
+36
-8
FileFransferServiceImpl.java
...ejoin/amos/avic/service/impl/FileFransferServiceImpl.java
+3
-1
application-dev.properties
...system-avic/src/main/resources/application-dev.properties
+5
-2
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+2
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-avic-api/src/main/java/com/yeejoin/amos/avic/face/model/TransferModel.java
View file @
2d6b4554
...
...
@@ -12,4 +12,6 @@ public class TransferModel extends UploadFileModel{
private
String
processDefinitionId
;
private
String
result
;
private
String
comment
;
private
Boolean
autoConfirm
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/config/AmosAuth.java
0 → 100644
View file @
2d6b4554
package
com
.
yeejoin
.
amos
.
avic
.
config
;
import
java.util.HashMap
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
lombok.Data
;
@Component
@ConfigurationProperties
(
prefix
=
"amos.auth"
)
@EnableScheduling
@Data
public
class
AmosAuth
{
private
String
userName
;
private
String
password
;
private
String
appKey
;
private
String
product
;
@Autowired
Privilege
privilege
;
HashMap
<
String
,
Object
>
model
=
null
;
@PostConstruct
public
void
login
()
{
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
boolean
flag
=
false
;
do
{
try
{
IdPasswordAuthModel
arg0
=
new
IdPasswordAuthModel
();
arg0
.
setLoginId
(
userName
);
arg0
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
FeignClientResult
o
=
privilege
.
authClient
.
idpassword
(
arg0
);
model
=
(
HashMap
<
String
,
Object
>)
o
.
getResult
();
flag
=
false
;
}
catch
(
Exception
e
)
{
if
(!
flag
)
{
e
.
printStackTrace
();
}
flag
=
true
;
try
{
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e1
)
{
e1
.
printStackTrace
();
}
}
}
while
(
flag
);
configureTasks
();
}
}).
start
();
}
public
String
getToken
()
{
return
model
.
get
(
"token"
).
toString
();
}
public
String
getUserId
()
{
return
model
.
get
(
"userId"
).
toString
();
}
// 或直接指定时间间隔,例如:5秒
@Scheduled
(
fixedRate
=
3600000
)
private
void
configureTasks
()
{
RequestContext
.
setToken
(
getToken
());
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
Privilege
.
agencyUserClient
.
getme
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/controller/WebServicesFileFransferResource.java
View file @
2d6b4554
...
...
@@ -2,18 +2,16 @@ package com.yeejoin.amos.avic.controller;
import
java.io.File
;
import
java.io.FileInputStream
;
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
;
import
java.util.UUID
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.stream.Collectors
;
import
javax.activation.DataHandler
;
...
...
@@ -41,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudResource
;
...
...
@@ -48,7 +47,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONArray
;
import
com.
alibaba.fastjson.JSONObject
;
import
com.
yeejoin.amos.avic.config.AmosAuth
;
import
com.yeejoin.amos.avic.face.model.AvicCustomPathModel
;
import
com.yeejoin.amos.avic.face.model.TransferModel
;
import
com.yeejoin.amos.avic.face.orm.entity.AvicCustomPath
;
...
...
@@ -78,9 +77,15 @@ public class WebServicesFileFransferResource {
@Autowired
private
AvicCustomPathService
simpleService
;
@Autowired
AmosAuth
amosAuth
;
@Value
(
value
=
"${upload.temp.dir}"
)
String
tempDir
;
@Value
(
value
=
"${avic.time.connection.timeout}"
)
long
connectionTimeout
;
@Value
(
value
=
"${avic.time.receive.timeout}"
)
long
receiveTimeout
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSSS"
);
...
...
@@ -188,13 +193,36 @@ public class WebServicesFileFransferResource {
indicatorsManager
.
indicatorClient
.
saveBizRecord
(
transferModel
.
getTaskId
(),
bizTable
.
get
(
"id"
).
toString
(),
list
);
workflowManager
.
workflowClient
.
startFormByProcess
(
null
,
tmpl
.
get
(
"processDefinition"
).
toString
());
//
workflowManager.workflowClient.startFormByProcess(null, tmpl.get("processDefinition").toString());
indicatorsManager
.
indicatorClient
.
adopt
(
transferModel
.
getTaskId
());
}
catch
(
java
.
lang
.
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
transferModel
.
getAutoConfirm
())
{
Timer
timer
=
new
Timer
();
timer
.
schedule
(
new
MyTimerTask
(
transferModel
),
1000
);
}
return
ResponseHelper
.
buildResponse
(
null
);
}
class
MyTimerTask
extends
TimerTask
{
TransferModel
transferModel
;
MyTimerTask
(
TransferModel
transferModel
)
{
this
.
transferModel
=
transferModel
;
}
@Override
public
void
run
()
{
RequestContext
.
setToken
(
amosAuth
.
getToken
());
RequestContext
.
setProduct
(
amosAuth
.
getProduct
());
RequestContext
.
setAppKey
(
amosAuth
.
getAppKey
());
postfile
(
transferModel
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"传输"
)
...
...
@@ -220,8 +248,8 @@ public class WebServicesFileFransferResource {
Client
client
=
dcf
.
createClient
(
webserviceUrl
);
HTTPConduit
conduit
=
(
HTTPConduit
)
client
.
getConduit
();
HTTPClientPolicy
policy
=
new
HTTPClientPolicy
();
policy
.
setConnectionTimeout
(
1000000
);
// 连接超时时间
policy
.
setReceiveTimeout
(
1000000
);
// 请求超时时间.
policy
.
setConnectionTimeout
(
connectionTimeout
);
// 连接超时时间
policy
.
setReceiveTimeout
(
receiveTimeout
);
// 请求超时时间.
conduit
.
setClient
(
policy
);
if
(
ObjectUtils
.
isEmpty
(
transferModel
.
getAvicCode
()))
{
for
(
String
file
:
transferModel
.
getFiles
().
stream
().
map
(
m
->
m
.
getUrl
())
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-avic-biz/src/main/java/com/yeejoin/amos/avic/service/impl/FileFransferServiceImpl.java
View file @
2d6b4554
...
...
@@ -9,6 +9,7 @@ import javax.activation.DataHandler;
import
javax.jws.WebService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -25,7 +26,8 @@ public class FileFransferServiceImpl implements FileFransferService {
@Autowired
AvicCustomPathService
avicCustomPathService
;
String
baseDir
=
"E:\\webservice\\"
;
@Value
(
"${avic.file.store.path}"
)
String
baseDir
;
@Override
public
void
useCodetransferFile
(
DataHandler
handler
,
String
fileName
,
String
path
,
String
code
)
{
...
...
amos-boot-system-avic/src/main/resources/application-dev.properties
View file @
2d6b4554
...
...
@@ -12,4 +12,7 @@ spring.redis.port=6379
spring.redis.password
=
yeejoin@2020
upload.temp.dir
=
E:
\\
ftp
\\
avic.webservice.path
=
http://localhost:8808/avic/services/fileFransfer?wsdl
\ No newline at end of file
avic.file.store.path
=
E:
\\
webservice
avic.webservice.path
=
http://localhost:8808/avic/services/fileFransfer?wsdl
avic.time.connection.timeout
=
100000
avic.time.receive.timeout
=
100000
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
2d6b4554
...
...
@@ -207,7 +207,8 @@
'equipment' as componentKey,
'equipment' as `key`,
equ.img as imgPath,
spe.qr_code as equipCode,
-- spe.qr_code as equipCode,
spe.code as equipCode,
stru.source_id as parentId,
cat.id as equipId,
cat.code as categoryCode,
...
...
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