|  |  | 
 |  |  |         data.forEach((key, value) -> { | 
 |  |  |             Map<String, Object> dataMap = new HashMap<>(); | 
 |  |  |             dataMap.put("mac", key); | 
 |  |  |             dataMap.put("time", end); | 
 |  |  |             dataMap.put("time", start); | 
 |  |  |             Map<String, Object> jsonMap = new HashMap<>(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |                             //剔除数据超过上下限的数据 | 
 |  |  |                             double aDouble = Double.parseDouble(sensorValue.toString()); | 
 |  |  |                             if (!ObjectUtils.isEmpty(upper)) { | 
 |  |  |                                 if (aDouble < upper) { | 
 |  |  |                                 if (aDouble > upper) { | 
 |  |  |                                     return null; | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                             if (!ObjectUtils.isEmpty(lower)) { | 
 |  |  |                                 if (aDouble > lower) { | 
 |  |  |                                 if (aDouble < lower) { | 
 |  |  |                                     return null; | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  | 
 |  |  |             }); | 
 |  |  |             dataMap.put("value", JSONObject.toJSONString(jsonMap)); | 
 |  |  |             //存入redis | 
 |  |  |             jsonMap.put("dataTime", DateUtils.dateToDateString(start)); | 
 |  |  |             redisTemplate.opsForHash().put(RedisConstants.DATA_FIVE_MINUTES, key, jsonMap); | 
 |  |  |             insertData.add(dataMap); | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         //5分钟表后缀 | 
 |  |  |         String insertTimeUnits = DateUtils.dateToDateString(now, DateUtils.yyyyMM_EN); | 
 |  |  |         String insertTimeUnits = DateUtils.dateToDateString(start, DateUtils.yyyyMM_EN); | 
 |  |  |         //存入数据库 | 
 |  |  |         historyFiveMinutelyMapper.insertHistoryFiveMinutely(insertData, insertTimeUnits); | 
 |  |  |     } |