diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java index 43e012c..23ba9d5 100644 --- a/kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java @@ -114,6 +114,34 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean { } public Boolean init() { + mattersUrlCache = Caffeine.newBuilder() + .refreshAfterWrite(7, TimeUnit.DAYS) + .maximumSize(1024 * 100) + .build(key -> { + DscSxAdsShareItemQltQlsxCommonIDVKq matter = kqService.getOne(Wrappers.lambdaQuery(DscSxAdsShareItemQltQlsxCommonIDVKq.class) + .eq(DscSxAdsShareItemQltQlsxCommonIDVKq::getQlName, key) + .last(BizConst.LIMIT_1) + .isNotNull(DscSxAdsShareItemQltQlsxCommonIDVKq::getWebapplyurl)); + if (Objects.isNull(matter)) { + //查不到直接返回null + return null; + } + return matter.getWebapplyurl(); + }); + mattersDupCache = Caffeine.newBuilder() + .refreshAfterWrite(7, TimeUnit.DAYS) + .maximumSize(1024 * 100) + .build(key -> { + NdKqZzsfwMattersDeduplicate dup = deduplicateService.getOne(Wrappers.lambdaQuery(NdKqZzsfwMattersDeduplicate.class) + .eq(NdKqZzsfwMattersDeduplicate::getQlName, key) + .last(BizConst.LIMIT_1) + .isNotNull(NdKqZzsfwMattersDeduplicate::getWebapplyurl)); + if (Objects.isNull(dup)) { + //查不到直接返回null + return null; + } + return dup; + }); // 初始化所有事项数据到缓存 return initMatterCache(); }