From 55ce0e34c9183aebe802b91dba88cd54c6eaa48b Mon Sep 17 00:00:00 2001 From: 司猫子 <songshuang@qq.com> Date: 星期日, 04 二月 2024 09:52:19 +0800 Subject: [PATCH] !480 优化单元格合并后多余内容的清除 * excel插件 优化合并策略 在合适的生命周期完成合并 去除被合并单元格的非首行内容 --- ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/manager/CaffeineCacheDecorator.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/manager/CaffeineCacheDecorator.java b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/manager/CaffeineCacheDecorator.java index 1d02efd..7d3ab42 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/manager/CaffeineCacheDecorator.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/manager/CaffeineCacheDecorator.java @@ -32,17 +32,19 @@ return cache.getNativeCache(); } + public String getUniqueKey(Object key) { + return cache.getName() + ":" + key; + } + @Override public ValueWrapper get(Object key) { - Object o = CAFFEINE.get(key, k -> cache.get(key)); - Console.log("redisson caffeine -> key: " + key + ",value:" + o); + Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key)); return (ValueWrapper) o; } @SuppressWarnings("unchecked") public <T> T get(Object key, Class<T> type) { - Object o = CAFFEINE.get(key, k -> cache.get(key, type)); - Console.log("redisson caffeine -> key: " + key + ",value:" + o); + Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key, type)); return (T) o; } @@ -63,7 +65,7 @@ public boolean evictIfPresent(Object key) { boolean b = cache.evictIfPresent(key); if (b) { - CAFFEINE.invalidate(key); + CAFFEINE.invalidate(getUniqueKey(key)); } return b; } @@ -80,8 +82,7 @@ @SuppressWarnings("unchecked") @Override public <T> T get(Object key, Callable<T> valueLoader) { - Object o = CAFFEINE.get(key, k -> cache.get(key, valueLoader)); - Console.log("redisson caffeine -> key: " + key + ",value:" + o); + Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key, valueLoader)); return (T) o; } -- Gitblit v1.9.3