| | |
| | | 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; |
| | |
| | | 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 * * * * ?") // 每秒执行 |
| | |
| | | list.forEach(o -> { |
| | | try { |
| | | o.setCustomerString(JSON.toJSONString(o.getCustomer())); |
| | | localeService.save(o); |
| | | localeService.saveOrUpdate(o); |
| | | } catch (Exception ex) { |
| | | System.out.printf(ex.getMessage()); |
| | | } |
| | |
| | | list.forEach(o -> { |
| | | try { |
| | | o.setAlarmRecordPicsString(JSON.toJSONString(o.getAlarmRecordPics())); |
| | | alarmRecordService.save(o); |
| | | alarmRecordService.saveOrUpdate(o); |
| | | } catch (Exception ex) { |
| | | System.out.printf(ex.getMessage()); |
| | | } |
| | |
| | | String listLocaleJson = "{\"Param\":{\"id\":\"" + locale.getId() + "\"}}"; |
| | | String listLocale = HttpUtil.HttpPostWithJson(host + "/admin/listLocale", listLocaleJson, auth); |
| | | |
| | | String detectorDailyJson = "{\"LocaleId\":\"" + locale.getId() + "\",\"AcquitAtBegin\":" + (dates[1]- 7*86400) + ",\"AcquitAtEnd\":" + dates[1] + "}"; |
| | | 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}"; |