把一个map转换成json字符串后存放在Redis中,然后在redis中取出json字符串,再把字符串转变成原来的Map
这里使用是阿里巴巴fastjson
Map<String, Object> reportData = dssDashboardService.getReportData(yearMonth, DssDef.DssDashboardType.MONTH_INDEX.getCode());
String jsonString = JSON.toJSONString(reportData);
Object object = redisTemplate.opsForValue().get(key);
reportData = JSON.parseObject((String) object, Map.class);