| | |
| | |
|
| | | if(sensorMap!=null && !sensorMap.isEmpty()) {
|
| | | for (Map<String, Object> map : list) {
|
| | | System.out.println("ScreenController-----AIForecast-----map:"+map);
|
| | | String time = map.get("time").toString();
|
| | | time = time.substring(time.length() - 2);
|
| | | map.put("time", Integer.valueOf(time));
|
| | | map.put("value", map.remove(sensorKey));
|
| | | String sensor = map.get("sensorKey").toString();
|
| | | if(sensorMap.get(sensor)!=null) {
|
| | | map.put("unit", sensorMap.get("unit"));
|
| | | map.put("name", sensorMap.get("name"));
|
| | | map.put("rules", sensorMap.get("rules"));
|
| | | System.out.println("ScreenController-----AIForecast-----map:"+map);
|
| | | System.out.println(sensorMap.get("unit"));
|
| | | //String sensor = map.get("sensorKey").toString();
|
| | | if(sensorMap.get(sensorKey)!=null) {
|
| | | map.put("unit", sensorMap.get(sensorKey).get("name"));
|
| | | }else {
|
| | | map.put("unit", null);
|
| | | map.put("name", null);
|
| | | map.put("rules", null);
|
| | | map.put("unit", "mg/m³");
|
| | | }
|
| | | }
|
| | | }else {
|
| | |
| | | time = time.substring(time.length() - 2);
|
| | | map.put("time", Integer.valueOf(time));
|
| | | map.put("value", map.remove(sensorKey));
|
| | | map.put("unit", null);
|
| | | map.put("name", null);
|
| | | map.put("rules", null);
|
| | | map.put("unit", "mg/m³");
|
| | | }
|
| | | }
|
| | | //return null;
|