From 4770b0d3e33f27f58ad0ccc1cfb70ab223018b25 Mon Sep 17 00:00:00 2001 From: hewenqiang <1527468660@qq.com> Date: 星期三, 16 三月 2022 16:53:17 +0800 Subject: [PATCH] fix 修复根据用户ID查询菜单信息SQL报错。`status`字段为char类型,应该传字符类型,此处存在隐式转换问题。(MySQL能自动转换,PostgreSQL转换报错)。 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/redis/QueueUtils.java | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/redis/QueueUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/redis/QueueUtils.java index c70acba..7850e01 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/redis/QueueUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/redis/QueueUtils.java @@ -52,14 +52,21 @@ public static <T> void addDelayedQueueObject(String queueName, T data, long time, TimeUnit timeUnit) { RBlockingQueue<T> queue = CLIENT.getBlockingQueue(queueName); RDelayedQueue<T> delayedQueue = CLIENT.getDelayedQueue(queue); - // 宸插瓨鍦ㄥ垯鏃犺 - if (delayedQueue.contains(data)) { - return; - } delayedQueue.offer(data, time, timeUnit); } /** + * 鑾峰彇涓�涓欢杩熼槦鍒楁暟鎹� 娌℃湁鏁版嵁杩斿洖 null + * + * @param queueName 闃熷垪鍚� + */ + public static <T> T getDelayedQueueObject(String queueName) { + RBlockingQueue<T> queue = CLIENT.getBlockingQueue(queueName); + RDelayedQueue<T> delayedQueue = CLIENT.getDelayedQueue(queue); + return delayedQueue.poll(); + } + + /** * 鍒犻櫎寤惰繜闃熷垪鏁版嵁 */ public static <T> boolean removeDelayedQueueObject(String queueName, T data) { -- Gitblit v1.9.3