|  |  |  | 
|---|
|  |  |  | logger.warn(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, String> msgData = JSON.parseObject(message, new TypeReference<Map<String, String>>() {}); | 
|---|
|  |  |  | String mac = msgData.get("mac"); | 
|---|
|  |  |  | String ver = msgData.get("ver"); | 
|---|
|  |  |  | Map<String, Object> msgData = JSON.parseObject(message, new TypeReference<Map<String, Object>>() {}); | 
|---|
|  |  |  | String mac = msgData.get("mac").toString(); | 
|---|
|  |  |  | String ver = msgData.get("ver").toString(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isEmpty(ver) || StringUtils.isEmpty(mac)) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | 
|---|
|  |  |  | String key = entry.getKey(); | 
|---|
|  |  |  | if(msgData.containsKey(key)) { | 
|---|
|  |  |  | Float value = entry.getValue(); | 
|---|
|  |  |  | Float dataValue = Float.valueOf(msgData.get(key)) ; | 
|---|
|  |  |  | msgData.put(key, String.valueOf(dataValue + value)); | 
|---|
|  |  |  | Float dataValue = Float.valueOf(msgData.get(key).toString()) ; | 
|---|
|  |  |  | msgData.put(key, dataValue + value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | History history = new History(); | 
|---|
|  |  |  | history.setMac(mac); | 
|---|
|  |  |  | history.setMac_key(key); | 
|---|
|  |  |  | history.setTime(new Date(Long.parseLong(msgData.get("time")))); | 
|---|
|  |  |  | history.setTime(new Date(Long.parseLong(msgData.get("time").toString()))); | 
|---|
|  |  |  | history.setSensor(sensor.getSensor()); | 
|---|
|  |  |  | history.setMac_value(Double.valueOf(msgData.get(key))); | 
|---|
|  |  |  | history.setMac_value(Double.valueOf(msgData.get(key).toString())); | 
|---|
|  |  |  | histories.add(history); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //根据三级警报阀值,确定设备状态 | 
|---|
|  |  |  | private int detEquState(Map<String,String> data) throws IOException { | 
|---|
|  |  |  | private int detEquState(Map<String,Object> data) throws IOException { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String,Double[]> alarmLevles = getAlarmLevels(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int state = 0; | 
|---|
|  |  |  | Map<String, Object> equMap = new HashMap<String, Object>(); | 
|---|
|  |  |  | String mac = data.get("mac"); | 
|---|
|  |  |  | String mac = data.get("mac").toString(); | 
|---|
|  |  |  | equMap.putAll(data); | 
|---|
|  |  |  | if(data!=null) { | 
|---|
|  |  |  | for(String key:alarmLevles.keySet()) { | 
|---|
|  |  |  | String value = data.get(key); | 
|---|
|  |  |  | String value = data.get(key).toString(); | 
|---|
|  |  |  | if(!StringUtils.isEmpty(value)) { | 
|---|
|  |  |  | double val = Double.parseDouble(value); | 
|---|
|  |  |  | //获取三级警报阀值 | 
|---|