zhanghua
2023-12-12 bc2da7908a227c09e5cc7b6d8dab3e9c94b784a1
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());
                    }
@@ -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}";