From 70bf1a48d037f993021ddf4ee2ee6da3bbce351e Mon Sep 17 00:00:00 2001 From: 司猫子 <songshuang@qq.com> Date: 星期日, 04 二月 2024 09:51:52 +0800 Subject: [PATCH] !481 单元格合并可以基于注解选择哪些其他字段需要同时相等方可进行该单元格合并 * 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