From 2078aee230bc109d66da296da8b7f24377befa1b Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 20 十二月 2024 11:08:44 +0800
Subject: [PATCH] 1
---
ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java b/ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java
index 0a3bd26..4455b51 100644
--- a/ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java
+++ b/ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java
@@ -17,6 +17,7 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -112,6 +113,19 @@
public void setLocaleDocumentService(IOdsLocaleDocumentService localeDocumentService) {
this.localeDocumentService = localeDocumentService;
}
+
+ @PostConstruct
+ public void start() {
+ alarmMsgTask();
+ queryDataDetectorDaily2Task();
+ queryTenMinData();
+ listLocale();
+ listAlarmRecord();
+ listCurAlarm();
+ listDataDetectorDailyStats();
+ listDetectorDaily();
+ }
+
@Scheduled(cron = "0 0 1 * * ?") // 姣忓ぉ闆剁偣鎵ц
// @Scheduled(cron = "0/1 * * * * ?") // 姣忕鎵ц
@@ -289,7 +303,7 @@
list.forEach(o -> {
try {
o.setCustomerString(JSON.toJSONString(o.getCustomer()));
- localeService.save(o);
+ localeService.saveOrUpdate(o);
} catch (Exception ex) {
System.out.printf(ex.getMessage());
}
@@ -354,7 +368,7 @@
list.forEach(o -> {
try {
o.setAlarmRecordPicsString(JSON.toJSONString(o.getAlarmRecordPics()));
- alarmRecordService.save(o);
+ alarmRecordService.saveOrUpdate(o);
} catch (Exception ex) {
System.out.printf(ex.getMessage());
}
@@ -412,8 +426,8 @@
/**
* 妫�娴嬩华鎬讳綋鎯呭喌鎶ヨ〃
*/
- @Scheduled(cron = "0 0 1 * * ?") // 姣忓ぉ闆剁偣鎵ц
-// @Scheduled(cron = "0/1 * * * * ?") // 姣忕鎵ц
+// @Scheduled(cron = "0 0 1 * * ?") // 姣忓ぉ闆剁偣鎵ц
+ @Scheduled(cron = "0/1 * * * * ?") // 姣忕鎵ц
public void listDataDetectorDailyStats() {
try {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
@@ -498,7 +512,7 @@
String listLocaleJson = "{\"Param\":{\"id\":\"" + locale.getId() + "\"}}";
String listLocale = HttpUtil.HttpPostWithJson(host + "/admin/listLocale", listLocaleJson, auth);
- String detectorDailyJson = "{\"LocaleId\":\"" + locale.getId() + "\",\"AcquitAtBegin\":" + dates[1] + ",\"AcquitAtEnd\":" + (dates[1] + 86400) + "}";
+ String detectorDailyJson = "{\"LocaleId\":\"" + locale.getId() + "\",\"AcquitAtBegin\":" + (dates[1] - 7 * 86400) + ",\"AcquitAtEnd\":" + dates[1] + "}";
String detectorDaily = HttpUtil.HttpPostWithJson(host + "/admin/queryDataDetectorDaily", detectorDailyJson, auth);
String listIntimeDataJson = "{\"StartAt\":0,\"Size\":20,\"mn\":\"" + locale.getMnLast() + "\",\"typ\":2,\"at\":0}";
--
Gitblit v1.8.0