萨达电箱对接
This commit is contained in:
parent
cc0080374e
commit
baa82c22b8
@ -91,9 +91,9 @@ public class ElectricalTask {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电箱情况 每5分钟触发任务 0 30 * * * ?
|
||||
* 获取电箱情况 每5分钟触发任务
|
||||
*/
|
||||
@Scheduled(cron = "0 0/1 * * * ?")
|
||||
@Scheduled(cron = "0 30 * * * ?")
|
||||
@RequestMapping("/xmgl/task/getElectricData")
|
||||
public void getElectricData() {
|
||||
log.info("获取设备数据 每1分钟触发任务");
|
||||
@ -140,12 +140,13 @@ public class ElectricalTask {
|
||||
log.info("电箱实时数据" + execute.body());
|
||||
JSONObject result = JSONObject.parseObject(execute.body()).getJSONObject("result");
|
||||
JSONObject metric = result.getJSONObject("metric");
|
||||
String temperatures = result.getJSONArray("temperatures").getJSONObject(0).getString("temperature");
|
||||
ElectricalData electricalData = new ElectricalData(devId, metric.getString("modified"), metric.getString("voltage_a"),
|
||||
metric.getString("voltage_b"),
|
||||
metric.getString("voltage_c"), metric.getString("current_a"), metric.getString("current_b"), metric.getString("current_c"),
|
||||
result.getJSONArray("leakages").getJSONObject(0).getString("leakage"),
|
||||
"0", "0", "0",
|
||||
result.getJSONArray("temperatures").getJSONObject(0).getString("temperature"));
|
||||
temperatures, temperatures, temperatures,
|
||||
temperatures);
|
||||
electricalDataService.saveElectricalData(electricalData);
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user