Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-task-scheduler
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ed18ff1e
authored
Aug 26, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加打印日志
1 parent
76213420
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/MySimpleJobService.java
src/main/java/cn/com/glsx/schedulerjob/task/taskscheduler/MySimpleJob.java
src/main/java/cn/com/glsx/schedulerjob/task/modules/service/MySimpleJobService.java
View file @
ed18ff1
...
@@ -3,6 +3,7 @@ package cn.com.glsx.schedulerjob.task.modules.service;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.schedulerjob.task.modules.service;
import
cn.com.glsx.stdinterface.api.StatisticsDriveClient
;
import
cn.com.glsx.stdinterface.api.StatisticsDriveClient
;
import
cn.com.glsx.stdinterface.dto.StatisticsDriveDto
;
import
cn.com.glsx.stdinterface.dto.StatisticsDriveDto
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -23,8 +24,10 @@ public class MySimpleJobService {
...
@@ -23,8 +24,10 @@ public class MySimpleJobService {
private
StatisticsDriveClient
statisticsDriveClient
;
private
StatisticsDriveClient
statisticsDriveClient
;
public
void
statisticsDriveDataEveryDay
()
{
public
void
statisticsDriveDataEveryDay
()
{
log
.
info
(
"开始统计数据==="
);
R
statisticsDriveR
=
statisticsDriveClient
.
statisticsDriveDataEveryDay
();
R
statisticsDriveR
=
statisticsDriveClient
.
statisticsDriveDataEveryDay
();
if
(
statisticsDriveR
==
null
)
{
if
(
statisticsDriveR
==
null
)
{
log
.
info
(
"statisticsDriveR is null"
);
return
;
return
;
}
}
...
@@ -32,6 +35,11 @@ public class MySimpleJobService {
...
@@ -32,6 +35,11 @@ public class MySimpleJobService {
}.
getType
());
}.
getType
());
// 调用标准接口 将数据入库
// 调用标准接口 将数据入库
if
(
CollectionUtil
.
isEmpty
(
statisticsDriveDtoList
))
{
log
.
info
(
"statisticsDriveDtoList is null"
);
return
;
}
log
.
info
(
"开始保存数据===,数据集合的大小为"
+
statisticsDriveDtoList
.
size
());
log
.
info
(
"开始保存数据===,数据集合的大小为"
+
statisticsDriveDtoList
.
size
());
statisticsDriveClient
.
insertStatisticsDriveList
(
statisticsDriveDtoList
);
statisticsDriveClient
.
insertStatisticsDriveList
(
statisticsDriveDtoList
);
}
}
...
...
src/main/java/cn/com/glsx/schedulerjob/task/taskscheduler/MySimpleJob.java
View file @
ed18ff1
...
@@ -14,7 +14,7 @@ import java.util.Date;
...
@@ -14,7 +14,7 @@ import java.util.Date;
@Slf4j
@Slf4j
@Component
@Component
@ElasticSimpleJob
(
jobName
=
"MySimpleJob"
,
cron
=
"0 1
5 5
* * ?"
)
@ElasticSimpleJob
(
jobName
=
"MySimpleJob"
,
cron
=
"0 1
0 10
* * ?"
)
public
class
MySimpleJob
implements
SimpleJob
{
public
class
MySimpleJob
implements
SimpleJob
{
@Autowired
@Autowired
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment