From 115da13fcf590175dcb778ba442a8bcafefcdab2 Mon Sep 17 00:00:00 2001 From: tangwei Date: Fri, 3 Jul 2026 09:13:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=94=B5=E7=AB=99?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yfd/platform/config/RedisConfig.java | 1 + .../qgc_base/service/impl/SdEngInfoBHServiceImpl.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/backend/src/main/java/com/yfd/platform/config/RedisConfig.java b/backend/src/main/java/com/yfd/platform/config/RedisConfig.java index f57ac0e2..e23850cb 100644 --- a/backend/src/main/java/com/yfd/platform/config/RedisConfig.java +++ b/backend/src/main/java/com/yfd/platform/config/RedisConfig.java @@ -63,6 +63,7 @@ public class RedisConfig { Map cacheConfigs = new HashMap<>(); cacheConfigs.put("dictCache", defaultConfig.entryTtl(Duration.ofHours(6))); cacheConfigs.put("dataCache", defaultConfig.entryTtl(Duration.ofMinutes(5))); + cacheConfigs.put("engInfoCache", defaultConfig.entryTtl(Duration.ofHours(2))); return RedisCacheManager.builder(redisConnectionFactory) .cacheDefaults(defaultConfig) diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java index be1aa4b8..65b23e36 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java @@ -38,6 +38,8 @@ import com.yfd.platform.system.service.IAdminAuthService; import com.yfd.platform.utils.QgcQueryWrapperUtil; import com.yfd.platform.utils.SecurityUtils; import jakarta.annotation.Resource; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; @@ -104,16 +106,19 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl getByBaseId(String baseId) { return engInfoBHMapper.selectByBaseId(baseId); } @Override + @Cacheable(cacheNames = "engInfoCache", key = "'eng:hycd:' + #hycd") public List getByHycd(String hycd) { return engInfoBHMapper.selectByHycd(hycd); } @Override + @Cacheable(cacheNames = "engInfoCache", key = "'eng:rvcd:' + #rvcd + ':' + #reachcd") public List getByRvcd(String rvcd,String reachcd) { return engInfoBHMapper.selectByRvcd(rvcd,reachcd); } @@ -223,6 +228,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl ids, String source) { List stcdList = ids == null ? new ArrayList<>() : ids.stream()