From b6c37e4bc38db88a360d0f2c6099183f9bb75bdc Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 22 四月 2019 14:31:59 +0800 Subject: [PATCH] 券推送插入 --- fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java | 32 +++++++++++++++----------------- 1 files changed, 15 insertions(+), 17 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java b/fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java index ca1eaef..71ecd98 100644 --- a/fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java +++ b/fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java @@ -13,6 +13,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import com.yeshi.fanli.service.inter.user.UserSystemCouponService; +import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.RedisManager; /** @@ -21,9 +22,9 @@ * @author Administrator * */ -//@Component -//@Aspect -//@Order(6) +@Component +@Aspect +@Order(6) public class ActiveUserAspect { @Resource(name = "taskExecutor") @@ -38,7 +39,7 @@ public static final String EDP = "execution(* com.yeshi.fanli.controller.client.*.*(..))"; -// @Around(EDP) + @Around(EDP) public Object activeAround(ProceedingJoinPoint joinPoint) throws Throwable { Long uid = null; @@ -63,18 +64,16 @@ return; } - // 缂撳瓨uid鐨凨ey - String key = "activeUid_" + uuid; - - // 缂撳瓨涓槸鍚﹀瓨鍦╱id - String cacheValue = redisManager.getCommonString(key); - if (cacheValue != null && cacheValue.trim().length() > 0) { - return; + if (Constant.IS_OUTNET) { + String key = "activeUid_" + uuid; + // 缂撳瓨涓槸鍚﹀瓨鍦╱id + String cacheValue = redisManager.getCommonString(key); + if (cacheValue != null && cacheValue.trim().length() > 0) { + return; + } + // 鍔犲叆缂撳瓨 20鍒嗛挓 + redisManager.cacheCommonString(key, uuid.toString(), 60 * 20); } - - // 鍔犲叆缂撳瓨 20鍒嗛挓 - redisManager.cacheCommonString("activeUid_" + uuid, uuid.toString(), 60 * 20); - // 鎺ユ敹鍒� try { @@ -85,8 +84,7 @@ } }); - Object[] args = joinPoint.getArgs(); - return joinPoint.proceed(args); + return joinPoint.proceed(joinPoint.getArgs()); } } -- Gitblit v1.8.0