Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hzjtpushwebsocket
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
gszd
hzjtpushwebsocket
Commits
2563e89c
Commit
2563e89c
authored
Jun 01, 2021
by
wangjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时推送
parent
92b3255a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
+1
-1
src/main/java/com/hzjt/service/TraffFlowService.java
src/main/java/com/hzjt/service/TraffFlowService.java
+1
-1
No files found.
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
View file @
2563e89c
...
@@ -83,7 +83,7 @@ public class ScheduleTaskConfig {
...
@@ -83,7 +83,7 @@ public class ScheduleTaskConfig {
/***
/***
* 每5分钟执行一次查询车流推送给广达
* 每5分钟执行一次查询车流推送给广达
*/
*/
@Scheduled
(
cron
=
"0 */5 * * * ?"
)
@Scheduled
(
fixedDelay
=
1000
*
5
)
private
void
sendToguangdaDevice
()
{
private
void
sendToguangdaDevice
()
{
log
.
info
(
"fiveflow sendto guangda"
);
log
.
info
(
"fiveflow sendto guangda"
);
//查询所有未推送的数据
//查询所有未推送的数据
...
...
src/main/java/com/hzjt/service/TraffFlowService.java
View file @
2563e89c
...
@@ -111,7 +111,7 @@ public class TraffFlowService {
...
@@ -111,7 +111,7 @@ public class TraffFlowService {
log
.
info
(
"fiveflow url"
+
url
);
log
.
info
(
"fiveflow url"
+
url
);
HttpEntity
<
List
<
VideoDeviceTraffic
>>
requestEntity
=
new
HttpEntity
<>(
list
,
headers
);
HttpEntity
<
List
<
VideoDeviceTraffic
>>
requestEntity
=
new
HttpEntity
<>(
list
,
headers
);
try
{
try
{
ResultObj
obj
=
CompletableFuture
.
supplyAsync
(()
->
restTemplate
.
postForObject
(
url
,
requestEntity
,
ResultObj
.
class
)).
get
(
timeout
,
TimeUnit
.
MILLISECONDS
);
ResultObj
obj
=
restTemplate
.
postForObject
(
url
,
requestEntity
,
ResultObj
.
class
);
log
.
info
(
"send devicelist to guangda result "
+
obj
.
getStatus
()+
obj
.
getData
()+
obj
.
getMsg
());
log
.
info
(
"send devicelist to guangda result "
+
obj
.
getStatus
()+
obj
.
getData
()+
obj
.
getMsg
());
}
catch
(
Exception
ex
){
}
catch
(
Exception
ex
){
log
.
error
(
"send devicelist to guangda error:"
+
ex
.
toString
());
log
.
error
(
"send devicelist to guangda error:"
+
ex
.
toString
());
...
...
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