From 2f071296b9e1d7a3aa6b6f3818196aaa40af3300 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 05 七月 2021 19:13:34 +0800 Subject: [PATCH] 礼金bug修复 --- service-lijin/src/main/java/com/ks/lijin/service/manager/LijinGoodsManager.java | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/service-lijin/src/main/java/com/ks/lijin/service/manager/LijinGoodsManager.java b/service-lijin/src/main/java/com/ks/lijin/service/manager/LijinGoodsManager.java index 16e0894..b9e81d2 100644 --- a/service-lijin/src/main/java/com/ks/lijin/service/manager/LijinGoodsManager.java +++ b/service-lijin/src/main/java/com/ks/lijin/service/manager/LijinGoodsManager.java @@ -1,5 +1,7 @@ package com.ks.lijin.service.manager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import org.yeshi.utils.TimeUtil; @@ -13,7 +15,9 @@ public class LijinGoodsManager { @Resource - private RedisTemplate redisTemplate; + private RedisTemplate<String, Object> redisTemplate; + + Logger logger = LoggerFactory.getLogger(LijinGoodsManager.class); /** @@ -38,7 +42,16 @@ public boolean todayCanCreate(Long auctionId) { String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMdd"); String key = String.format("lijingoodslimit-%s-%s", day, auctionId); - return !redisTemplate.hasKey(key); + logger.info("key鍊间负锛�" + key); + try { + Object object = redisTemplate.opsForValue().get(key); + if (object == null) { + return true; + } + } catch (Exception e) { + return true; + } + return false; } -- Gitblit v1.8.0