Browse Source

项目归集前置机测试数据定时任务

master
CMM 1 year ago
parent
commit
dcc56e4aa3
3 changed files with 7 additions and 3 deletions
  1. +3
    -1
      syn-data-task/src/main/java/com/ningdatech/syndataapi/scheduler/task/SynDataTask.java
  2. +2
    -1
      syn-data-task/src/main/resources/application-dev.yml
  3. +2
    -1
      syn-data-task/src/main/resources/application-pre.yml

+ 3
- 1
syn-data-task/src/main/java/com/ningdatech/syndataapi/scheduler/task/SynDataTask.java View File

@@ -188,9 +188,10 @@ public class SynDataTask {
* 定时同步前置机数据 每天3点开始执行一次
*
*/
@Scheduled(cron = "0 20 11 * * ?")
@Scheduled(cron = "0 24 14 * * ?")
public void doTask() throws UnknownHostException {
if (flag && HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("数据同步任务开始");
// 先删除表中的所有数据,再插入数据,测试数据只有一条,这里只插入一条
List<ProjectBaseInfo> baseInfos = projectBaseInfoService.list();
if (CollUtil.isNotEmpty(baseInfos)) {
@@ -240,6 +241,7 @@ public class SynDataTask {
// 运维项目实施信息
ProjectMimplement projectMimplement = JSON.parseObject(PROJECT_MIMPLEMENT_TEST_DATA, ProjectMimplement.class);
projectMimplementService.save(projectMimplement);
log.info("数据同步任务结束");
}
}
}

+ 2
- 1
syn-data-task/src/main/resources/application-dev.yml View File

@@ -1,4 +1,5 @@

server:
port: 38088
spring:
application:
name: syn-data-task


+ 2
- 1
syn-data-task/src/main/resources/application-pre.yml View File

@@ -1,4 +1,5 @@

server:
port: 38088
spring:
application:
name: syn-data-task


Loading…
Cancel
Save