|  |  | 
 |  |  |  | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.Iterator; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Optional; | 
 |  |  | 
 |  |  |                         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); |