diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java index 209ef6d..0220db3 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/SoeAlarmVo.java +++ b/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; + + } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java index a3b44fe..1b18030 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SoeAlarmServiceImpl.java +++ b/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 stationByCode = stationClient.getStationByCode(item.getStation()); + entity.setStationId(item.getProjectId()); + R stationByCode = stationClient.getStationByCode(item.getProjectId()); if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ entity.setCreateDept(stationByCode.getData().getCreateDept()); entity.setStationName(stationByCode.getData().getName()); diff --git a/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql b/hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 similarity index 100% rename from hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql rename to hzims-service/hzims-alarm/src/main/resources/db/1.0.0.sql.1 diff --git a/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql b/hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1 similarity index 100% rename from hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql rename to hzims-service/hzims-alarm/src/main/resources/db/2.0.0.sql.1