Browse Source

修改时间

master
PoffyZhang 11 months ago
parent
commit
4d9c3a8985
1 changed files with 28 additions and 0 deletions
  1. +28
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java

+ 28
- 0
kqapi/src/main/java/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.java View File

@@ -114,6 +114,34 @@ public abstract class AbstractMatterCacheHelper implements InitializingBean {
} }


public Boolean init() { 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(); return initMatterCache();
} }


Loading…
Cancel
Save