chen_xi
2022-09-22 d5c1061180b0a6867857b7eef3b7cd6d35ef7f7c
screen-api/src/main/java/com/moral/api/utils/AdjustDataUtils.java
@@ -1,5 +1,6 @@
package com.moral.api.utils;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
@@ -75,7 +76,9 @@
                    if (formula.contains("aqi")) {
                        Object aqiValue = null;
                        if (aqiMap != null) {
                            aqiValue = aqiMap.get(key);
                            String jsonStr = JsonUtil.readJsonFile("screen-api/src/main/resources/SensorContrast.json");
                            JSONObject result = JSONObject.parseObject(jsonStr);
                            aqiValue = aqiMap.get(result.get(key));
                        }
                        env.put("aqi", ObjectUtils.isEmpty(aqiValue) ? 0F : Float.parseFloat((String) aqiValue));
                    }