于紫祥_1901
2020-08-24 7c32c8a9ec7943112360adc839e5292be40db74d
src/main/java/com/moral/service/impl/HistoryServiceImpl.java
@@ -555,14 +555,16 @@
            for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
                for (Sensor sensor : sensors) {
                    if (sensor.getSensorKey().equals(entry.getKey())) {
                        dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
                        if (entry.getValue() != null) {
                            dataMap.put(entry.getKey(), new BigDecimal(entry.getValue().toString().replace("\"", "")).stripTrailingZeros().toPlainString() + sensor.getUnit());
                        }
                    }
                }
            }
        }
        Map<String, Object> map = sensorMapper.getSensorBySensorKey(parameters.get("sensorKey").toString());
        parameters.put("unit",map.get("unit"));
        parameters.put("description",map.get("description"));
        parameters.put("unit", map.get("unit"));
        parameters.put("description", map.get("description"));
        return uavSensorData;
    }
@@ -642,4 +644,10 @@
        }
        return maxList;
    }
    @Override
    public String getJsonData(String mac, String time,String table) {
        return historyMapper.getJsonData(mac,time,table);
    }
}