|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.os.ems.record.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -188,9 +190,18 @@ public class EmsRecordAlarmDataServiceImpl implements IEmsRecordAlarmDataService
|
|
|
|
|
public void exceedDnbThresholdAlarmsTask() {
|
|
|
|
|
EmsBaseMonitorThreshold monitorThreshold = new EmsBaseMonitorThreshold();
|
|
|
|
|
monitorThreshold.setMonitorType(2L);
|
|
|
|
|
String nowTime = DateUtils.getTime();
|
|
|
|
|
String endTime = LocalDateTime
|
|
|
|
|
.parse(nowTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
|
|
|
|
|
.plusMinutes(1) // 加一分钟
|
|
|
|
|
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
List<EmsBaseMonitorThreshold> thresholdList = emsBaseMonitorThresholdMapper.selectEmsBaseMonitorThresholdList(monitorThreshold);
|
|
|
|
|
|
|
|
|
|
EmsRecordDnbInstant dnbInstant = new EmsRecordDnbInstant();
|
|
|
|
|
HashMap<String, Object> selectMap = new HashMap<>();
|
|
|
|
|
selectMap.put("beginRecordTime", nowTime);
|
|
|
|
|
selectMap.put("endRecordTime", endTime);
|
|
|
|
|
dnbInstant.setParams(selectMap);
|
|
|
|
|
List<EmsRecordDnbInstant> dnbInstantList = emsRecordDnbInstantMapper.selectEmsRecordDnbInstantList(dnbInstant);
|
|
|
|
|
Map<String, String> thresholdMap = compareThresholdAndRecord(thresholdList, dnbInstantList);
|
|
|
|
|
//防止多次存入异常数据
|
|
|
|
|