From 4bd6d424e7a5eef4ae327a58001ac8d8430eed4f Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Thu, 24 Feb 2022 15:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=81=AB=E6=83=85?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=B9=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=B5=8B=E5=80=BC0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/model/entity/Fire.java | 18 +++++++++++++++++- .../com/xkrs/util/TopicConsumerListener.java | 2 ++ src/main/resources/application.properties | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) 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仓库