Commit 60a2c52f authored by tangwei's avatar tangwei

修改bug

parent 27697e1e
...@@ -11,9 +11,13 @@ public class KeySiteDateDto { ...@@ -11,9 +11,13 @@ public class KeySiteDateDto {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Long id; private String key;
@ApiModelProperty(value = "id")
private String value;
@ApiModelProperty(value = "重点部位名称") @ApiModelProperty(value = "重点部位名称")
private String name; private String label;
@ApiModelProperty(value = "位置") @ApiModelProperty(value = "位置")
private String fireLocation; private String fireLocation;
@ApiModelProperty(value = "經度") @ApiModelProperty(value = "經度")
...@@ -21,20 +25,28 @@ public class KeySiteDateDto { ...@@ -21,20 +25,28 @@ public class KeySiteDateDto {
@ApiModelProperty(value = "緯度") @ApiModelProperty(value = "緯度")
private String floorLatitude; private String floorLatitude;
public Long getId() { public String getKey() {
return id; return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
} }
public void setId(Long id) { public void setValue(String value) {
this.id = id; this.value = value;
} }
public String getName() { public String getLabel() {
return name; return label;
} }
public void setName(String name) { public void setLabel(String label) {
this.name = name; this.label = label;
} }
public String getFireLocation() { public String getFireLocation() {
......
...@@ -124,8 +124,9 @@ ...@@ -124,8 +124,9 @@
<select id="getKeySiteDate" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto"> <select id="getKeySiteDate" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto">
SELECT SELECT
c.sequence_nbr AS id, c.sequence_nbr AS `key`,
c.`name` as name, c.sequence_nbr AS `value`,
c.`name` as label,
c.address_desc as fireLocation, c.address_desc as fireLocation,
c.longitude as floorLongitude, c.longitude as floorLongitude,
c.latitude AS floorLatitude c.latitude AS floorLatitude
......
...@@ -285,7 +285,7 @@ public class WaterResourceController extends BaseController { ...@@ -285,7 +285,7 @@ public class WaterResourceController extends BaseController {
// 查询基本信息 // 查询基本信息
WaterResourceDto waterResourceDto = waterResourceServiceImpl.queryBySeq(sequenceNbr); WaterResourceDto waterResourceDto = waterResourceServiceImpl.queryBySeq(sequenceNbr);
waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class)); waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class));
waterResourceDto.setOrientationImgList(JSONArray.parseArray(waterResourceDto.getOrientationImg())); waterResourceDto.setOrientationImgList(waterResourceDto.getOrientationImg()!=null?JSONArray.parseArray(waterResourceDto.getOrientationImg()):null);
Boolean isDelete = waterResourceDto.getIsDelete(); Boolean isDelete = waterResourceDto.getIsDelete();
// 查询属性信息 // 查询属性信息
String resourceType = waterResourceDto.getResourceType(); String resourceType = waterResourceDto.getResourceType();
......
...@@ -45,14 +45,11 @@ public class StartLoader implements ApplicationRunner { ...@@ -45,14 +45,11 @@ public class StartLoader implements ApplicationRunner {
try { try {
emqKeeper.getMqttClient().subscribe(topic, (s, mqttMessage) -> { emqKeeper.getMqttClient().subscribe(topic, (s, mqttMessage) -> {
byte[] payload = mqttMessage.getPayload(); byte[] payload = mqttMessage.getPayload();
try { try {
String obj = new String(payload); String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) { if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj); JSONObject json = JSON.parseObject(obj);
JSONObject date = (JSONObject) JSON.toJSON(json.get("data")); AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", json.get("unitInvolvedName")+","+json.get("address")+",发生警情,请处理。", json.get("id").toString(), obj);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", date.get("unitInvolvedName")+","+date.get("floorName")+"楼,发生警情,请处理。", date.get("id").toString(), obj);
emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes(), RuleConfig.DEFAULT_QOS, true);
} }
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment