|
@@ -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(); |
|
|
} |
|
|
} |
|
|