Browse Source

调整:soe告警字段

zhongwei
ty 8 months ago
parent
commit
ae464f50b1
  1. 32
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java
  2. 18
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java
  3. 0
      hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1
  4. 0
      hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1

32
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java

@ -15,22 +15,28 @@ public class SoeAlarmVo {
private static final long serialVersionUID = 1L;
private String ts;
private Date ts;
private String station;
private String deviceCode;
private String sid;
private String id;
private String realId;
private String type;
private String kind;
private String level;
private String state;
private String stateLabel;
private String type;
private String deviceName;
private String tenantId;
private String name;
private String context;
private String opvalue;
private String trace;
private String duration;
private String traceCount;
private String signage;
private String projectId;
private String currentValue;
}

18
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java

@ -66,19 +66,21 @@ public class SoeAlarmServiceImpl implements SoeAlarmService {
private AlarmEntity getAlarmEntity(SoeAlarmVo item) {
AlarmEntity entity = new AlarmEntity();
String format = DateUtil.format(item.getTs(), org.springblade.core.tool.utils.DateUtil.PATTERN_DATETIME_MINI);
entity.setAlarmId(format+"-"+item.getDeviceCode());
entity.setAlarmSource(LEVEL_ALARM);
entity.setAlarmType(ONE_LEVEL);
entity.setAlarmContext(item.getContext());
Date date = new Date(Long.valueOf(item.getTs()));
entity.setAlarmTime(date);
entity.setAlarmValue(item.getOpvalue());
entity.setAlarmSignage(item.getSid());
entity.setAlarmContext(item.getName());
entity.setAlarmTime(item.getTs());
entity.setAlarmValue(item.getCurrentValue());
entity.setAlarmSignage(item.getSignage());
entity.setAlarmLevel(Integer.valueOf(item.getLevel()));
entity.setAlarmCount(Integer.valueOf(item.getTraceCount()));
entity.setAlarmStatus(1);
entity.setDeviceCode(item.getRealId());
entity.setDeviceCode(item.getDeviceCode());
entity.setTenantId("200000");
R<StationEntity> stationByCode = stationClient.getStationByCode(item.getStation());
entity.setStationId(item.getProjectId());
R<StationEntity> stationByCode = stationClient.getStationByCode(item.getProjectId());
if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){
entity.setCreateDept(stationByCode.getData().getCreateDept());
entity.setStationName(stationByCode.getData().getName());

0
hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql → hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1

0
hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql → hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1

Loading…
Cancel
Save