Ver Fonte

Merge branch 'redis' of wangfan/adweb3-server into master

wangfan há 4 meses atrás
pai
commit
bc1754d391

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/dmp/service/impl/GADailyReportServiceImpl.java

@@ -112,6 +112,6 @@ public class GADailyReportServiceImpl extends ServiceImpl<GADailyReportMapper, G
         // 3. 根据日期排序并返回
         // 3. 根据日期排序并返回
         return dailyStatsVOs.values().stream()
         return dailyStatsVOs.values().stream()
                 .sorted(Comparator.comparing(DailyStatsVO::getDate)) // 排日期升序排序
                 .sorted(Comparator.comparing(DailyStatsVO::getDate)) // 排日期升序排序
-                .toList();
+                .collect(Collectors.toList()); // 使用toList()方法会导致Redis类型解析异常
     }
     }
 }
 }

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/redis/CacheConfig.java

@@ -4,6 +4,7 @@ import static org.springframework.data.redis.serializer.RedisSerializationContex
 
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.MapperFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 
 import org.jeecg.common.modules.redis.config.RedisConfig;
 import org.jeecg.common.modules.redis.config.RedisConfig;
@@ -65,6 +66,7 @@ public class CacheConfig {
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
         objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
         objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
         objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
         objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        objectMapper.configure(MapperFeature.USE_ANNOTATIONS, false); // 忽略@JsonIgnore注解,缓存所有字段
 
 
         // 配置缓存默认TTL,以及键值序列化方式 - 解决乱码的问题
         // 配置缓存默认TTL,以及键值序列化方式 - 解决乱码的问题
         RedisCacheConfiguration cacheConfiguration =
         RedisCacheConfiguration cacheConfiguration =