|
@@ -294,14 +294,8 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getThisWeekElectricity(){
|
|
|
- String str = "[{\"number\":\"1# 1-3\",\"EqName\":\"设备名称\",\"type\":\"设备所属类别\",\"Kwh\":\"56.2\"},{\"number\":\"1# 1-3\",\"EqName\":\"设备名称\",\"type\":\"设备所属类别\",\"Kwh\":\"56.2\"},{\"number\":\"1# 1-3\",\"EqName\":\"设备名称\",\"type\":\"设备所属类别\",\"Kwh\":\"56.2\"},{\"number\":\"1# 1-3\",\"EqName\":\"设备名称\",\"type\":\"设备所属类别\",\"Kwh\":\"56.2\"},{\"number\":\"1# 1-3\",\"EqName\":\"设备名称\",\"type\":\"设备所属类别\",\"Kwh\":\"56.2\"}]";
|
|
|
- JSONArray jsonArray = new JSONArray(str);
|
|
|
LargeBuildingControl largeBuildingControl = platBuildingMapper.getThisWeekElectricity();
|
|
|
JSONArray weekElectricity = JSONArray.parseArray(largeBuildingControl.getWeekElectricity());
|
|
|
- for (Object obj : weekElectricity){
|
|
|
- JSONObject jsonObject = (JSONObject) obj;
|
|
|
- jsonObject.put("detail", jsonArray);
|
|
|
- }
|
|
|
JSONArray roomElectricity = JSONArray.parseArray(largeBuildingControl.getRoomElectricity());
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("total", weekElectricity);
|
|
@@ -309,6 +303,42 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ public JSONArray getThisAmmeterDetail(){
|
|
|
+ String str = "[\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"number\": \"1# 1-3\",\n" +
|
|
|
+ " \"EqName\": \"设备名称\",\n" +
|
|
|
+ " \"type\": \"设备所属类别\",\n" +
|
|
|
+ " \"Kwh\": \"56.2\",\n" +
|
|
|
+ " },\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"number\": \"1# 1-3\",\n" +
|
|
|
+ " \"EqName\": \"设备名称\",\n" +
|
|
|
+ " \"type\": \"设备所属类别\",\n" +
|
|
|
+ " \"Kwh\": \"56.2\",\n" +
|
|
|
+ " },\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"number\": \"1# 1-3\",\n" +
|
|
|
+ " \"EqName\": \"设备名称\",\n" +
|
|
|
+ " \"type\": \"设备所属类别\",\n" +
|
|
|
+ " \"Kwh\": \"56.2\",\n" +
|
|
|
+ " },\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"number\": \"1# 1-3\",\n" +
|
|
|
+ " \"EqName\": \"设备名称\",\n" +
|
|
|
+ " \"type\": \"设备所属类别\",\n" +
|
|
|
+ " \"Kwh\": \"56.2\",\n" +
|
|
|
+ " },\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"number\": \"1# 1-3\",\n" +
|
|
|
+ " \"EqName\": \"设备名称\",\n" +
|
|
|
+ " \"type\": \"设备所属类别\",\n" +
|
|
|
+ " \"Kwh\": \"56.2\",\n" +
|
|
|
+ " },\n" +
|
|
|
+ " ]";
|
|
|
+ return JSONArray.parseArray(str);
|
|
|
+ }
|
|
|
+
|
|
|
public List<Map<String, Object>> getTodayElectricity(){
|
|
|
String json = platBuildingMapper.getTodayElectricity();
|
|
|
JSONArray jsonArray = JSONArray.parseArray(json);
|
|
@@ -375,10 +405,29 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ public JSONArray getAbnormalPoint(){
|
|
|
+ String str = "[\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"alertTime\": \"2025-01-01 15:12:11\",\n" +
|
|
|
+ " \"alertName\": \"液位过低\",\n" +
|
|
|
+ " \"alertValue\": \"1.11m\",\n" +
|
|
|
+ " \"alertEquipment\": \"液位计编号(如电表的话:为1# 1-5等)\",\n" +
|
|
|
+ " \"alertPosition\": \"B2层2号配电室\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " {\n" +
|
|
|
+ " \"alertTime\": \"2025-01-01 15:12:11\",\n" +
|
|
|
+ " \"alertName\": \"设备离线\",\n" +
|
|
|
+ " \"alertValue\": \"0.00m\",\n" +
|
|
|
+ " \"alertEquipment\": \"液位计编号(如电表的话:为1# 1-5等)\",\n" +
|
|
|
+ " \"alertPosition\": \"B2层2号配电室\"\n" +
|
|
|
+ " }\n" +
|
|
|
+ " ]";
|
|
|
+ return JSONArray.parseArray(str);
|
|
|
+ }
|
|
|
+
|
|
|
public Map<String, Object> getWarnEvent(){
|
|
|
String json = platBuildingMapper.getWarnEvent();
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
- return jsonObject;
|
|
|
+ return JSONObject.parseObject(json);
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getWarnState(){
|
|
@@ -391,11 +440,8 @@ public class PlatBuildingServiceImpl implements IPlatBuildingService {
|
|
|
|
|
|
|
|
|
private JSONObject repeatWarnDevice(JSONObject jsonObject){
|
|
|
- String str = "[{\"alertTime\":\"2025-01-01 15:12:11\",\"alertName\":\"液位过低\",\"alertValue\":\"1.11m\",\"alertEquipment\":\"液位计编号如电表的话为1# 1-5等\",\"alertPosition\":\"B2层2号配电室\"},{\"alertTime\":\"2025-01-01 15:12:11\",\"alertName\":\"设备离线\",\"alertValue\":\"0.00m\",\"alertEquipment\":\"液位计编号如电表的话为1# 1-5等\",\"alertPosition\":\"B2层2号配电室\"}]";
|
|
|
- JSONArray jsonArray = new JSONArray(str);
|
|
|
Long x = Long.parseLong(jsonObject.getString("zcdw")) + Long.parseLong(jsonObject.getString("ycdw"));
|
|
|
jsonObject.put("total", x);
|
|
|
- jsonObject.put("abnormal", jsonArray);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|