添加了火情状态字段,并默认赋值0

This commit is contained in:
XinYi Song 2022-02-24 15:58:08 +08:00
parent 1790e32ecf
commit 4bd6d424e7
3 changed files with 24 additions and 1 deletions

View File

@ -125,10 +125,16 @@ public class Fire {
*/ */
private String picturePath; private String picturePath;
/**
* 火情状态 0 未处理 1已处理
*/
@Column(length = 32, columnDefinition = "varchar(32)")
private String fireState;
public Fire() { 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.id = id;
this.deviceCode = deviceCode; this.deviceCode = deviceCode;
this.channelSeq = channelSeq; this.channelSeq = channelSeq;
@ -148,6 +154,7 @@ public class Fire {
this.fireDistance = fireDistance; this.fireDistance = fireDistance;
this.fireId = fireId; this.fireId = fireId;
this.picturePath = picturePath; this.picturePath = picturePath;
this.fireState = fireState;
} }
public Integer getId() { public Integer getId() {
@ -302,6 +309,14 @@ public class Fire {
this.picturePath = picturePath; this.picturePath = picturePath;
} }
public String getFireState() {
return fireState;
}
public void setFireState(String fireState) {
this.fireState = fireState;
}
@Override @Override
public String toString() { public String toString() {
return "Fire{" + return "Fire{" +
@ -324,6 +339,7 @@ public class Fire {
", fireDistance='" + fireDistance + '\'' + ", fireDistance='" + fireDistance + '\'' +
", fireId='" + fireId + '\'' + ", fireId='" + fireId + '\'' +
", picturePath='" + picturePath + '\'' + ", picturePath='" + picturePath + '\'' +
", fireState='" + fireState + '\'' +
'}'; '}';
} }
} }

View File

@ -60,6 +60,7 @@ public class TopicConsumerListener {
fire.setAltitude(info.get("altitude").asText()); fire.setAltitude(info.get("altitude").asText());
fire.setFireDistance(info.get("fireDistance").asText()); fire.setFireDistance(info.get("fireDistance").asText());
fire.setFireId(info.get("fsid").asText()); fire.setFireId(info.get("fsid").asText());
fire.setFireState("0");
Map<String,String> map = new HashMap<String,String>(); Map<String,String> map = new HashMap<String,String>();
map.put("deviceCode",info.get("deviceCode").asText()); map.put("deviceCode",info.get("deviceCode").asText());
map.put("channelSeq",info.get("channelSeq").asText()); map.put("channelSeq",info.get("channelSeq").asText());
@ -78,6 +79,7 @@ public class TopicConsumerListener {
map.put("altitude",info.get("altitude").asText()); map.put("altitude",info.get("altitude").asText());
map.put("fireDistance",info.get("fireDistance").asText()); map.put("fireDistance",info.get("fireDistance").asText());
map.put("fsid",info.get("fsid").asText()); map.put("fsid",info.get("fsid").asText());
map.put("fireState","0");
String jsonString = JSON.toJSONString(map); String jsonString = JSON.toJSONString(map);
WebSocketServer.BroadCastInfo(jsonString); WebSocketServer.BroadCastInfo(jsonString);

View File

@ -6,6 +6,11 @@ spring.datasource.userName = fire_manage
spring.datasource.password = fire456 spring.datasource.password = fire456
spring.datasource.driverClassName = org.postgresql.Driver 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 server.tomcat.uri-encoding=UTF-8
# 关闭spring data 的redis仓库 # 关闭spring data 的redis仓库