Commit 2e4b1523 authored by tangwei's avatar tangwei

修改bug

parent 33075ceb
......@@ -49,7 +49,12 @@ public class StartLoader implements ApplicationRunner {
String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", json.get("unitInvolvedName")+","+json.get("address")+",发生警情,请处理。", json.get("id").toString(), json);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情",
"物联设备发生警情,发生位置:"+json.get("address")!=null?json.get("address").toString():""+
",事发单位:"+json.get("unitInvolvedName")!=null?json.get("unitInvolvedName").toString():""
+",联系人:"+json.get("contactUser")!=null?json.get("contactUser").toString():""
+",联系电话:"+json.get("contactPhone")!=null?json.get("contactPhone").toString():""+".请尽快处理!",
json.get("id").toString(), json);
emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes("UTF-8"), 1, false);
}
} 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