|
|
@@ -118,10 +118,96 @@ public class SpSj2017ServiceImpl extends AbstractCrudService<SpSj2017Mapper, SpS
|
|
|
device_status = "WP1";
|
|
|
dbMap3.put("value","1");
|
|
|
payloadVO1.put("type","ALARM");
|
|
|
+ SpSj2017 spSj2017 = new SpSj2017();
|
|
|
+ spSj2017.setPort("TSM-10P");
|
|
|
+ spSj2017.setDeviceCode(device_code);
|
|
|
+ spSj2017.setStatus("17");
|
|
|
+ spSj2017.setAddress("127.0.0.1");
|
|
|
+ spSj2017.setNcmd("");
|
|
|
+ spSj2017.setTime(LocalDateTime.now());
|
|
|
+ spSj2017.setData1(device_status);
|
|
|
+ spSj2017.setData2(bat_level.toString());
|
|
|
+ spSj2017.setData3(CSQ.toString());
|
|
|
+ spSj2017.setData4(device_value);
|
|
|
+ spSj2017.setData5("11111111111");
|
|
|
+ spSj2017.setCllxr("");
|
|
|
+ spSj2017.setClsj(LocalDateTime.now());
|
|
|
+ spSj2017.setClr("");
|
|
|
+ spSj2017.setClnr("");
|
|
|
+ spSj2017.setClwb("");
|
|
|
+ spSj2017.setCldh("");
|
|
|
+ spSj2017.setClzt(0);
|
|
|
+ spSj2017.setCllx("");
|
|
|
+ spSj2017.setVideo("");
|
|
|
+ this.save(spSj2017);
|
|
|
+ Long insertid1 = spSj2017.getId();
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ map.put("IMEI", device_code);
|
|
|
+ map.put("insert_id", String.valueOf(insertid1));
|
|
|
+ map.put("phone", "17630065224");
|
|
|
+ map.put("time", samp_time);
|
|
|
+ map.put("evt", device_status);
|
|
|
+ String httpurl = "https://iot.usky.cn/jdxf/wxapp2.php/Home/Waterwarn/message_water";
|
|
|
+ String httpOrgCreateTestRtn = HttpClientUtil.doPost(httpurl, map, "utf-8");
|
|
|
+
|
|
|
+ //增加水表数据推送总队逻辑
|
|
|
+ //QString("{\"SubType\":6,\"DeviceId\":\"%1\",\"InsertId\":%2,\"Confirmed\":false}").arg(addr).arg(insertid)
|
|
|
+ HashMap<String, String> map1 = new HashMap<>();
|
|
|
+ map1.put("SubType", "2");
|
|
|
+ map1.put("DeviceId", device_code);
|
|
|
+ map1.put("InsertId", String.valueOf(insertid1));
|
|
|
+ map1.put("Confirmed", "false");
|
|
|
+ String httpurl1 = "http://47.98.201.187:55335/report";
|
|
|
+
|
|
|
+ String response = HttpClientUtil.doPost(httpurl1, map1, "utf-8");
|
|
|
+ System.out.println("http://47.98.201.187:55335/report response:"+response);
|
|
|
}else if (alarm.equals("262144")){
|
|
|
device_status = "WP2";
|
|
|
dbMap3.put("value","2");
|
|
|
payloadVO1.put("type","ALARM");
|
|
|
+ SpSj2017 spSj2017 = new SpSj2017();
|
|
|
+ spSj2017.setPort("TSM-10P");
|
|
|
+ spSj2017.setDeviceCode(device_code);
|
|
|
+ spSj2017.setStatus("17");
|
|
|
+ spSj2017.setAddress("127.0.0.1");
|
|
|
+ spSj2017.setNcmd("");
|
|
|
+ spSj2017.setTime(LocalDateTime.now());
|
|
|
+ spSj2017.setData1(device_status);
|
|
|
+ spSj2017.setData2(bat_level.toString());
|
|
|
+ spSj2017.setData3(CSQ.toString());
|
|
|
+ spSj2017.setData4(device_value);
|
|
|
+ spSj2017.setData5("11111111111");
|
|
|
+ spSj2017.setCllxr("");
|
|
|
+ spSj2017.setClsj(LocalDateTime.now());
|
|
|
+ spSj2017.setClr("");
|
|
|
+ spSj2017.setClnr("");
|
|
|
+ spSj2017.setClwb("");
|
|
|
+ spSj2017.setCldh("");
|
|
|
+ spSj2017.setClzt(0);
|
|
|
+ spSj2017.setCllx("");
|
|
|
+ spSj2017.setVideo("");
|
|
|
+ this.save(spSj2017);
|
|
|
+ Long insertid1 = spSj2017.getId();
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ map.put("IMEI", device_code);
|
|
|
+ map.put("insert_id", String.valueOf(insertid1));
|
|
|
+ map.put("phone", "17630065224");
|
|
|
+ map.put("time", samp_time);
|
|
|
+ map.put("evt", device_status);
|
|
|
+ String httpurl = "https://iot.usky.cn/jdxf/wxapp2.php/Home/Waterwarn/message_water";
|
|
|
+ String httpOrgCreateTestRtn = HttpClientUtil.doPost(httpurl, map, "utf-8");
|
|
|
+
|
|
|
+ //增加水表数据推送总队逻辑
|
|
|
+ //QString("{\"SubType\":6,\"DeviceId\":\"%1\",\"InsertId\":%2,\"Confirmed\":false}").arg(addr).arg(insertid)
|
|
|
+ HashMap<String, String> map1 = new HashMap<>();
|
|
|
+ map1.put("SubType", "2");
|
|
|
+ map1.put("DeviceId", device_code);
|
|
|
+ map1.put("InsertId", String.valueOf(insertid1));
|
|
|
+ map1.put("Confirmed", "false");
|
|
|
+ String httpurl1 = "http://47.98.201.187:55335/report";
|
|
|
+
|
|
|
+ String response = HttpClientUtil.doPost(httpurl1, map1, "utf-8");
|
|
|
+ System.out.println("http://47.98.201.187:55335/report response:"+response);
|
|
|
}
|
|
|
db.add(dbMap3);
|
|
|
}else if (dev_type.equals(2)){
|
|
|
@@ -173,6 +259,18 @@ public class SpSj2017ServiceImpl extends AbstractCrudService<SpSj2017Mapper, SpS
|
|
|
map.put("evt", device_status);
|
|
|
String httpurl = "https://iot.usky.cn/jdxf/wxapp2.php/Home/Waterwarn/message_water";
|
|
|
String httpOrgCreateTestRtn = HttpClientUtil.doPost(httpurl, map, "utf-8");
|
|
|
+
|
|
|
+ //增加水表数据推送总队逻辑
|
|
|
+ //QString("{\"SubType\":6,\"DeviceId\":\"%1\",\"InsertId\":%2,\"Confirmed\":false}").arg(addr).arg(insertid)
|
|
|
+ HashMap<String, String> map1 = new HashMap<>();
|
|
|
+ map1.put("SubType", "5");
|
|
|
+ map1.put("DeviceId", device_code);
|
|
|
+ map1.put("InsertId", String.valueOf(insertid1));
|
|
|
+ map1.put("Confirmed", "false");
|
|
|
+ String httpurl1 = "http://47.98.201.187:55335/report";
|
|
|
+
|
|
|
+ String response = HttpClientUtil.doPost(httpurl1, map1, "utf-8");
|
|
|
+ System.out.println("http://47.98.201.187:55335/report response:"+response);
|
|
|
}else if (alarm.equals("262144")){
|
|
|
payloadVO1.put("type","ALARM");
|
|
|
dbMap3.put("value","2");
|
|
|
@@ -186,6 +284,8 @@ public class SpSj2017ServiceImpl extends AbstractCrudService<SpSj2017Mapper, SpS
|
|
|
spSj2017.setTime(LocalDateTime.now());
|
|
|
spSj2017.setData1(device_status);
|
|
|
spSj2017.setData2(bat_level.toString());
|
|
|
+
|
|
|
+
|
|
|
spSj2017.setData3(CSQ.toString());
|
|
|
spSj2017.setData4(device_value);
|
|
|
spSj2017.setData5("11111111111");
|
|
|
@@ -208,6 +308,18 @@ public class SpSj2017ServiceImpl extends AbstractCrudService<SpSj2017Mapper, SpS
|
|
|
map.put("evt", device_status);
|
|
|
String httpurl = "https://iot.usky.cn/jdxf/wxapp2.php/Home/Waterwarn/message_water";
|
|
|
String httpOrgCreateTestRtn = HttpClientUtil.doPost(httpurl, map, "utf-8");
|
|
|
+
|
|
|
+ //增加水表数据推送总队逻辑
|
|
|
+ //QString("{\"SubType\":6,\"DeviceId\":\"%1\",\"InsertId\":%2,\"Confirmed\":false}").arg(addr).arg(insertid)
|
|
|
+ HashMap<String, String> map1 = new HashMap<>();
|
|
|
+ map1.put("SubType", "5");
|
|
|
+ map1.put("DeviceId", device_code);
|
|
|
+ map1.put("InsertId", String.valueOf(insertid1));
|
|
|
+ map1.put("Confirmed", "false");
|
|
|
+ String httpurl1 = "http://47.98.201.187:55335/report";
|
|
|
+
|
|
|
+ String response = HttpClientUtil.doPost(httpurl1, map1, "utf-8");
|
|
|
+ System.out.println("http://47.98.201.187:55335/report response:"+response);
|
|
|
}
|
|
|
db.add(dbMap3);
|
|
|
}
|