diff --git a/src/main/java/com/xkrs/model/entity/Fire.java b/src/main/java/com/xkrs/model/entity/Fire.java index af68287..bad425a 100644 --- a/src/main/java/com/xkrs/model/entity/Fire.java +++ b/src/main/java/com/xkrs/model/entity/Fire.java @@ -125,10 +125,16 @@ public class Fire { */ private String picturePath; + /** + * 火情状态 0 未处理 1已处理 + */ + @Column(length = 32, columnDefinition = "varchar(32)") + private String fireState; + public Fire() { } - public Fire(Integer id, String deviceCode, String channelSeq, String unitType, String nodeType, String nodeCode, String alarmCode, String alarmStat, String alarmType, String alarmGrade, String alarmPicture, String alarmDate, String alarmSourceName, String alarmLongitude, String alarmLatitude, String altitude, String fireDistance, String fireId, String picturePath) { + public Fire(Integer id, String deviceCode, String channelSeq, String unitType, String nodeType, String nodeCode, String alarmCode, String alarmStat, String alarmType, String alarmGrade, String alarmPicture, String alarmDate, String alarmSourceName, String alarmLongitude, String alarmLatitude, String altitude, String fireDistance, String fireId, String picturePath, String fireState) { this.id = id; this.deviceCode = deviceCode; this.channelSeq = channelSeq; @@ -148,6 +154,7 @@ public class Fire { this.fireDistance = fireDistance; this.fireId = fireId; this.picturePath = picturePath; + this.fireState = fireState; } public Integer getId() { @@ -302,6 +309,14 @@ public class Fire { this.picturePath = picturePath; } + public String getFireState() { + return fireState; + } + + public void setFireState(String fireState) { + this.fireState = fireState; + } + @Override public String toString() { return "Fire{" + @@ -324,6 +339,7 @@ public class Fire { ", fireDistance='" + fireDistance + '\'' + ", fireId='" + fireId + '\'' + ", picturePath='" + picturePath + '\'' + + ", fireState='" + fireState + '\'' + '}'; } } diff --git a/src/main/java/com/xkrs/util/TopicConsumerListener.java b/src/main/java/com/xkrs/util/TopicConsumerListener.java index 2f42976..a0e198d 100644 --- a/src/main/java/com/xkrs/util/TopicConsumerListener.java +++ b/src/main/java/com/xkrs/util/TopicConsumerListener.java @@ -60,6 +60,7 @@ public class TopicConsumerListener { fire.setAltitude(info.get("altitude").asText()); fire.setFireDistance(info.get("fireDistance").asText()); fire.setFireId(info.get("fsid").asText()); + fire.setFireState("0"); Map map = new HashMap(); map.put("deviceCode",info.get("deviceCode").asText()); map.put("channelSeq",info.get("channelSeq").asText()); @@ -78,6 +79,7 @@ public class TopicConsumerListener { map.put("altitude",info.get("altitude").asText()); map.put("fireDistance",info.get("fireDistance").asText()); map.put("fsid",info.get("fsid").asText()); + map.put("fireState","0"); String jsonString = JSON.toJSONString(map); WebSocketServer.BroadCastInfo(jsonString); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 2ea9f6a..99b8ef0 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -6,6 +6,11 @@ spring.datasource.userName = fire_manage spring.datasource.password = fire456 spring.datasource.driverClassName = org.postgresql.Driver +#spring.datasource.url = jdbc:postgresql://192.168.2.147:5432/smart_urban +#spring.datasource.userName = postgres +#spring.datasource.password = 123456 +#spring.datasource.driverClassName = org.postgresql.Driver + server.tomcat.uri-encoding=UTF-8 # 关闭spring data 的redis仓库