cjl
2023-10-20 4dc15079f5e5fe8620a0c9d1787e838a960269b9
screen-api/src/main/java/com/moral/api/service/impl/HistoryDailyServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -70,7 +71,10 @@
            result.put("avg", Constants.NULL_VALUE);
            return result;
        }
        result.put("avg", data.get(params.get("sensorCode")));
        double aDouble = Double.parseDouble(data.get(params.get("sensorCode")).toString());
        double v = new BigDecimal(aDouble).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
//        result.put("avg", data.get(params.get("sensorCode")));
        result.put("avg", ""+v);
        return result;
    }