| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | import com.moral.api.service.HistoryMinutelyService; |
| | | import com.moral.api.service.SensorService; |
| | | import com.moral.constant.Constants; |
| | | import com.moral.constant.RedisConstants; |
| | | import com.moral.util.AmendUtils; |
| | | import com.moral.util.DateUtils; |
| | | |
| | |
| | | public void createTable(String timeUnits) { |
| | | historyFiveMinutelyMapper.createTable(timeUnits); |
| | | } |
| | | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | } |
| | | }); |
| | | dataMap.put("value", JSONObject.toJSONString(jsonMap)); |
| | | //存入redis |
| | | redisTemplate.opsForHash().put(RedisConstants.DATA_FIVE_MINUTES, key, jsonMap); |
| | | insertData.add(dataMap); |
| | | }); |
| | | |