| | |
| | | Map<String, Object> mapAvg = new LinkedHashMap<>();
|
| | | Map<String, Object> mapMin = new LinkedHashMap<>();
|
| | | Map<String, Object> mapMax = new LinkedHashMap<>();
|
| | | mapAvg.put("时间", map.get("time"));
|
| | | mapMin.put("时间", map.get("time"));
|
| | | mapMax.put("时间", map.get("time"));
|
| | | mapAvg.put("time", map.get("time"));
|
| | | mapMin.put("time", map.get("time"));
|
| | | mapMax.put("time", map.get("time"));
|
| | | for (String key : map.keySet()) {
|
| | | for (Sensor sensor : sensors) {
|
| | | if (sensor.getSensorKey().equals(key)) {
|
| | | mapAvg.put(sensor.getDescription(), new BigDecimal(map.get(key).toString()).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | mapAvg.put(key, new BigDecimal(map.get(key).toString()).stripTrailingZeros().toPlainString() + sensor.getUnit());
|
| | | } else if (("min" + sensor.getSensorKey()).equals(key)) {
|
| | | mapMin.put(sensor.getDescription(), new BigDecimal(map.get(key).toString().replace("\"", "")).stripTrailingZeros().toPlainString());
|
| | | mapMin.put(key.substring(3), new BigDecimal(map.get(key).toString().replace("\"", "")).stripTrailingZeros().toPlainString());
|
| | | } else if (("max" + sensor.getSensorKey()).equals(key)) {
|
| | | mapMax.put(sensor.getDescription(), new BigDecimal(map.get(key).toString().replace("\"", "")).stripTrailingZeros().toPlainString());
|
| | | mapMax.put(key.substring(3), new BigDecimal(map.get(key).toString().replace("\"", "")).stripTrailingZeros().toPlainString());
|
| | | }
|
| | | }
|
| | | }
|