|
@@ -40,6 +40,19 @@ public class WaterAndElectricity {
|
|
|
@Autowired
|
|
|
private EnergyEnvDeviceMapper envDeviceMapper;
|
|
|
|
|
|
+ //发送设备状态到华统平台
|
|
|
+ @Scheduled(cron = "0 0/5 * * * ? ")
|
|
|
+ private void sendDeviceStatus() {
|
|
|
+ List<EnergyEnvDevice> devices = envDeviceMapper.selectList(null);
|
|
|
+ HashMap<String, String> paramsMap = new HashMap<>();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("result", devices);
|
|
|
+ System.out.println(jsonObject);
|
|
|
+ paramsMap.put("Content-Type", "application/json;charset=utf-8");
|
|
|
+ String post = HttpRequest.post("https://huatong.ifarmcloud.com/huatongApi/energy-data/getDeviceStatus")
|
|
|
+ .headerMap(paramsMap, false).body(jsonObject.toJSONString()).timeout(30 * 1000).execute().body();
|
|
|
+ System.out.println(post);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 59 * * * ? ")
|
|
@@ -370,6 +383,7 @@ public class WaterAndElectricity {
|
|
|
.headerMap(paramsMap, false).body(jsonObject.toJSONString()).timeout(30 * 1000).execute().body();
|
|
|
System.out.println(post);
|
|
|
}
|
|
|
+
|
|
|
//百风林31
|
|
|
@Scheduled(cron = "0 59 * * * ? ")
|
|
|
private void sendDate7() throws Exception {
|
|
@@ -419,6 +433,7 @@ public class WaterAndElectricity {
|
|
|
.headerMap(paramsMap, false).body(jsonObject.toJSONString()).timeout(30 * 1000).execute().body();
|
|
|
System.out.println(post);
|
|
|
}
|
|
|
+
|
|
|
//瑞溪32
|
|
|
@Scheduled(cron = "0 59 * * * ? ")
|
|
|
private void sendDate8() throws Exception {
|
|
@@ -566,6 +581,7 @@ public class WaterAndElectricity {
|
|
|
.headerMap(paramsMap, false).body(jsonObject.toJSONString()).timeout(30 * 1000).execute().body();
|
|
|
System.out.println(post);
|
|
|
}
|
|
|
+
|
|
|
//下各水34
|
|
|
@Scheduled(cron = "0 59 * * * ? ")
|
|
|
private void sendDate11() throws Exception {
|