From be6fd5dfd09dafbed6053601911b4b37c447d35e Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 1 Mar 2022 14:46:40 +0800 Subject: [PATCH] =?UTF-8?q?/=E3=80=82=20mall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxMallServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java index fcbdac1bb..a75cab103 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java @@ -370,6 +370,9 @@ public class WxMallServiceImpl implements WxMallService { @Override public String mallValid(Long loginUserId,WxMall mall) { + if(mall.getSaleType() == null || mall.getValidEnd() == null){ + return null; + } Map map = new HashMap<>(); Date today = DateUtils.getDateZero(new Date()); map.put("mallName",mall.getName()); @@ -380,11 +383,11 @@ public class WxMallServiceImpl implements WxMallService { map.put("surplusDay",days); //是否展示(6小时登陆展示) String key = Constant.LOGIN_A_USER_VALID + mall.getTenantId() + ":" + loginUserId; - if(redisTemplate.hasKey(key)){ - map.put("isShow",false); - }else{ + if(days <= 30 && !redisTemplate.hasKey(key)){ RedisCacheUtils.cache(redisTemplate,key,true,3600*6); map.put("isShow",true); + }else{ + map.put("isShow",false); } return JSON.toJSONString(map); }