cjl
2023-11-15 28776b56db3bbd2fbbfd64394e40aa11a6b7ea29
screen-api/src/main/java/com/moral/api/utils/AdjustDataUtils.java
@@ -9,6 +9,7 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -78,12 +79,13 @@
                        Object aqiValue = null;
                        if (aqiMap != null) {
                            //String jsonStr = JsonUtil.readJsonFile("classpath:SensorContrast.json");
                            /*String jsonStr = JsonUtil.testReadFile("SensorContrast.json");
                            JSONObject result = JSONObject.parseObject(jsonStr);
                            aqiValue = aqiMap.get(result.get(key));*/
                            aqiValue = aqiMap.get(SensorContrasts.sensorContrastMap.get(key));
//                           String jsonStr = JsonUtil.testReadFile("SensorContrast.json");
//                            JSONObject result = JSONObject.parseObject(jsonStr);
//                            aqiValue = aqiMap.get(result.get(key));
//                            aqiValue = aqiMap.get(SensorContrasts.sensorContrastMap.get(key));
                            aqiValue = aqiMap.get(key);
                        }
                        env.put("aqi", ObjectUtils.isEmpty(aqiValue) ? 0F : Float.parseFloat((String) aqiValue));
                        env.put("aqi", ObjectUtils.isEmpty(aqiValue) ? 0F : Float.parseFloat(String.valueOf(aqiValue)));
                    }
                    if (formula.contains("vocs")) {
                        Object vocsValue = ObjectUtils.isEmpty(deviceData.get(Constants.SENSOR_CODE_VOCS)) ? 0F : deviceData.get(Constants.SENSOR_CODE_VOCS);