|
|
|
@ -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()); |
|
|
|
|