Commit aad83460 authored by wujiang's avatar wujiang

修改离散率告警

parent 07e79ebb
......@@ -18,10 +18,12 @@ public class EquipDic {
@TableId(value = "sequence_nbr", type = IdType.ID_WORKER)
private Long sequenceNumber;
@TableField("value")
Double value;
@TableField("dic_value")
Double dicValue;
@TableField("desc")
String desc;
@TableField("description")
String description;
@TableField("dic_key")
String dicKey;
}
package com.yeejoin.amos.boot.module.jxiop.biz.scheduled;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.EquipDicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipDic;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipDivergenceAlarmEvent;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.EquipDivergenceAlarmEventMapper;
@Service
@EnableScheduling
public class EquipWarnSchedule {
@Autowired
private MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Autowired
private StationBasicMapper stationBasicMapper;
@Autowired
private EquipDivergenceAlarmEventMapper equipDivergenceAlarmEventMapper;
@Autowired
private EquipDicMapper equipDicMapper;
@Scheduled(cron = "${equip.warn.cron}")
//@PostConstruct
private void doEquipDivergencWarn() {
List<EquipDivergenceAlarmEvent> eventList = new ArrayList<EquipDivergenceAlarmEvent>();
EquipDic equipDic = equipDicMapper
.selectOne(new LambdaQueryWrapper<EquipDic>().eq(EquipDic::getDicKey, "LSVGJYZ"));
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StationBasic::getStationType, "GFDZ");
List<StationBasic> stationList = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationList) {
ArrayList<Map<String, Object>> resultList = monitorFanIndicatorImpl.getLSV(stationBasic.getFanGatewayId());
if (!resultList.isEmpty()) {
for (Map<String, Object> map : resultList) {
Double lsv = Double.valueOf( String.valueOf(map.get("lsv")));
if (lsv > equipDic.getDicValue()) {
String zz = (String) map.get("zz");
String nbq = (String) map.get("nbq");
String hlx = (String) map.get("hlx");
EquipDivergenceAlarmEvent equipDivergenceAlarmEvent = new EquipDivergenceAlarmEvent();
equipDivergenceAlarmEvent.setEquipName(zz + "/" + nbq + "/" + hlx);
equipDivergenceAlarmEvent.setGatewayId(stationBasic.getFanGatewayId());
equipDivergenceAlarmEvent.setValue(lsv.toString());
equipDivergenceAlarmEvent.setAlarmGroupName("离散率告警");
equipDivergenceAlarmEvent.setEventDesc("离散率超过告警阈值");
eventList.add(equipDivergenceAlarmEvent);
}
}
}
}
equipDivergenceAlarmEventMapper.save(eventList);
}
}
......@@ -76,7 +76,7 @@ gl.sum.column=日发电量,月发电量,年发电量
gl.avg.column=有功功率,日利用小时,瞬时风速
equip.warn.cron= 0 0/10 * * * ?
#ES 曲线图定时 0 57 23 * * ?
windSpeed.cron = 0 25 9 * * ?
#本地使用 0 0 5 29 2 ? ? 线上使用 0 */5 * * * ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment