Commit aee5f071 by zhouhaibao

feat(supervisor): 添加缓存开关配置功能

- 在 SupervisorDashboardService 中增加环境属性检查
- 实现 sup.cache.flag 配置项用于控制缓存逻辑
- 当配置项存在时返回 null 跳过缓存读取
- 保留原有缓存读取逻辑作为默认行为
1 parent 2a0634a1
...@@ -3247,6 +3247,10 @@ public class SupervisorDashboardService { ...@@ -3247,6 +3247,10 @@ public class SupervisorDashboardService {
*/ */
private List<SupervisorPerformanceDTO> getFromCache(String cacheKey) { private List<SupervisorPerformanceDTO> getFromCache(String cacheKey) {
try { try {
String property = environment.getProperty("sup.cache.flag");
if (property != null) {
return null;
}
String cachedJson = redisTemplate.opsForValue().get(cacheKey); String cachedJson = redisTemplate.opsForValue().get(cacheKey);
if (cachedJson != null && !cachedJson.trim().isEmpty()) { if (cachedJson != null && !cachedJson.trim().isEmpty()) {
log.info("[督导业绩查询] 从缓存获取数据,键:{}", cacheKey); log.info("[督导业绩查询] 从缓存获取数据,键:{}", cacheKey);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!