yujian
2019-03-25 f67743e47f57dafc7031af44e2037c03e680a60c
fanli/src/main/java/com/yeshi/fanli/aspect/ActiveUserAspect.java
@@ -5,14 +5,12 @@
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
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;
/**
@@ -38,7 +36,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 +61,16 @@
               return;
            }
            
            // 缓存uid的Key
            String key = "activeUid_" + uuid;
            // 缓存中是否存在uid
            String cacheValue = redisManager.getCommonString(key);
            if (cacheValue != null && cacheValue.trim().length() > 0) {
               return;
            if (Constant.IS_OUTNET) {
               String key = "activeUid_" + uuid;
               // 缓存中是否存在uid
               String cacheValue = redisManager.getCommonString(key);
               if (cacheValue != null && cacheValue.trim().length() > 0) {
                  return;
               }
               // 加入缓存 20分钟
               redisManager.cacheCommonString("activeUid_" + uuid, uuid.toString(), 60 * 20);
            }
            // 加入缓存 20分钟
            redisManager.cacheCommonString("activeUid_" + uuid, uuid.toString(), 60 * 20);
            
            // 接收券
            try {
@@ -85,8 +81,7 @@
         }
      });
      
      Object[] args = joinPoint.getArgs();
      return joinPoint.proceed(args);
      return joinPoint.proceed(joinPoint.getArgs());
   }
}