fix(powerenv): 更新设备字段插件中的监控数据获取键值
- 将所有 PowerEnvDeviceFiled 插件类中的 alarm 键改为对应的视图键 - 修改 BatIView、BatteryPowerTimeView 等共计 41 个插件类 - 确保每个插件从 monitor_data 中正确提取指定的视图数据 - 统一处理空值判断逻辑,避免 NullPointerException - 提升环境监控数据展示准确性与一致性
This commit is contained in:
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled10Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("FuFaultAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled11Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("InverterFaultAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled12Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("LoadPercentageView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled13Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("LowBatteryAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled14Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nUaView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled15Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nUbView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled16Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nUcView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled17Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("OverLoadAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled18Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("switchView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled19Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("Uab1View", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled20Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("Ubc1View", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled21Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("Uca1View", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled22Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("FlowLoseView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled23Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("HumidityHighAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled24Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("HumidityLowAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled25Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("LeakAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled26Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nRetAirHumView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled27Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nRetAirTempView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled28Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("PhaseSequenceErrorView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled29Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("TemperatureHighAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled2Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("BatIView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled30Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("TemperatureLowAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled31Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("humidityView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled32Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("temperatureView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled33Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("ConcentrateView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled34Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("DustDetectionView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled35Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("CoilFaultView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled36Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("FullWaterAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled37Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("LockWaterAlarmView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled38Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("SensorFaultView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled39Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nIaView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled3Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("BatteryPowerTimeView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled40Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nIbView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled41Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("nIcView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled4Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("BatUView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled5Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("electricFrView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled6Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("electricPaView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled7Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("electricPbView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled8Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("electricPcView", "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class PowerEnvDeviceFiled9Plugin implements VirtualizationFieldPlugin {
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
if (Objects.isNull(dataMap.get("monitor_data"))) return "";
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("alarm", "");
|
||||
return new JSONObject(dataMap.get("monitor_data")).getStr("EmerOutageView", "");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user