| | |
| | | if(sensorUnitMap!=null && !sensorUnitMap.isEmpty()) {
|
| | | if(sensorUnitMap.get(string)!=null) {
|
| | | units.add(sensorUnitMap.get(string).get("name").toString());
|
| | | System.out.println("ScreenController-----AIForecast-----map2:"+string+":"+map.get(string));
|
| | | String rules = sensorUnitMap.get(string).get("rules").toString();
|
| | | rules = rules.replace("{0}", "a");
|
| | | rules = rules.replace("d", "");
|
| | | System.out.println(rules);
|
| | | Expression expression = AviatorEvaluator.compile(rules);
|
| | | Double value;
|
| | | Map<String, Object> ev = new HashMap<>();
|
| | |
| | | //保留两位小数
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | | value = Double.parseDouble(df.format(value));
|
| | | System.out.println(map.get(string));
|
| | | System.out.println(value);
|
| | | values.add(value);
|
| | | }else {
|
| | | Map<String, Object> sensorMap = sensorService.getSensorBySensorKey(string);
|