|  |  |  | 
|---|
|  |  |  | Object vocsValue = ObjectUtils.isEmpty(deviceData.get(Constants.SENSOR_CODE_VOCS)) ? 0F : deviceData.get(Constants.SENSOR_CODE_VOCS); | 
|---|
|  |  |  | env.put("vocs", vocsValue); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (formula.contains("cel")) { | 
|---|
|  |  |  | if (formula.contains("ce1")) { | 
|---|
|  |  |  | //env.put("cel", Float.parseFloat((String) measuredValue)); | 
|---|
|  |  |  | env.put("ce1", new BigDecimal(String.valueOf(measuredValue)).floatValue()); | 
|---|
|  |  |  | }else if(formula.contains("cel")){ | 
|---|
|  |  |  | env.put("cel", new BigDecimal(String.valueOf(measuredValue)).floatValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //校准 | 
|---|
|  |  |  | measuredValue = expression.execute(env); | 
|---|
|  |  |  | //温度处理 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(map)){ | 
|---|
|  |  |  | return deviceData; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21005"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a21005 = jsonObject.get("a21005").toString(); | 
|---|
|  |  |  | deviceData.put("a21005",Double.parseDouble(a21005)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21026"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a21026 = jsonObject.get("a21026").toString(); | 
|---|
|  |  |  | deviceData.put("a21026",Double.parseDouble(a21026)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21004"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a21004 = jsonObject.get("a21004").toString(); | 
|---|
|  |  |  | deviceData.put("a21004",Double.parseDouble(a21004)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a34002"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a34002 = jsonObject.get("a34002").toString(); | 
|---|
|  |  |  | deviceData.put("a34002",Double.parseDouble(a34002)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a34004"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a34004 = jsonObject.get("a34004").toString(); | 
|---|
|  |  |  | deviceData.put("a34004",Double.parseDouble(a34004)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a05024"))){ | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a05024 = jsonObject.get("a05024").toString(); | 
|---|
|  |  |  | deviceData.put("a05024",Double.parseDouble(a05024)); | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap)){ | 
|---|
|  |  |  | deviceData.put("a21005",Double.parseDouble(jsonObject.get("a21005").toString())); | 
|---|
|  |  |  | deviceData.put("a21026",Double.parseDouble(jsonObject.get("a21026").toString())); | 
|---|
|  |  |  | deviceData.put("a21004",Double.parseDouble(jsonObject.get("a21004").toString())); | 
|---|
|  |  |  | deviceData.put("a34002",Double.parseDouble(jsonObject.get("a34002").toString())); | 
|---|
|  |  |  | deviceData.put("a34004",Double.parseDouble(jsonObject.get("a34004").toString())); | 
|---|
|  |  |  | deviceData.put("a05024",Double.parseDouble(jsonObject.get("a05024").toString())); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21005"))){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String a21005 = jsonObject.get("a21005").toString(); | 
|---|
|  |  |  | deviceData.put("a21005",Double.parseDouble(a21005)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21026"))){ | 
|---|
|  |  |  | //                  JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a21026 = jsonObject.get("a21026").toString(); | 
|---|
|  |  |  | deviceData.put("a21026",Double.parseDouble(a21026)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a21004"))){ | 
|---|
|  |  |  | //                  JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a21004 = jsonObject.get("a21004").toString(); | 
|---|
|  |  |  | deviceData.put("a21004",Double.parseDouble(a21004)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a34002"))){ | 
|---|
|  |  |  | //                  JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a34002 = jsonObject.get("a34002").toString(); | 
|---|
|  |  |  | deviceData.put("a34002",Double.parseDouble(a34002)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a34004"))){ | 
|---|
|  |  |  | //                  JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a34004 = jsonObject.get("a34004").toString(); | 
|---|
|  |  |  | deviceData.put("a34004",Double.parseDouble(a34004)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(aqiMap.get("a05024"))){ | 
|---|
|  |  |  | //                  JSONObject jsonObject = JSONObject.parseObject(map.get("value").toString()); | 
|---|
|  |  |  | String a05024 = jsonObject.get("a05024").toString(); | 
|---|
|  |  |  | deviceData.put("a05024",Double.parseDouble(a05024)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|