...
|
...
|
@@ -53,10 +53,13 @@ public class UnionServiceImpl implements IUnionService { |
|
|
static Logger activeUnion = LoggerFactory.getLogger("activeUnion");
|
|
|
|
|
|
static Logger clickUnion = LoggerFactory.getLogger("clickUnion");
|
|
|
|
|
|
|
|
|
static Logger ipMatch = LoggerFactory.getLogger("ipMatch");
|
|
|
|
|
|
private static final String UNION_KEY = "UNION:KEY:";
|
|
|
|
|
|
static Logger log = LoggerFactory.getLogger(UnionServiceImpl.class);
|
|
|
|
|
|
|
|
|
@Resource(name="yhRedisTemplate")
|
|
|
YHRedisTemplate<String, String> yHRedisTemplate;
|
...
|
...
|
@@ -284,7 +287,7 @@ public class UnionServiceImpl implements IUnionService { |
|
|
}
|
|
|
|
|
|
log.info("activateUnion with get redis first with key={}, value={}", key, value);
|
|
|
clickUnion.info("activateUnion with get redis first with key={}, value={}", key, value);
|
|
|
activeUnion.info("activateUnion with get redis first with key={}, value={}", key, value);
|
|
|
if (StringUtils.isNotEmpty(request.getTd())) {
|
|
|
if (StringUtils.isEmpty(value)) {
|
|
|
key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getAppkey();
|
...
|
...
|
@@ -298,14 +301,14 @@ public class UnionServiceImpl implements IUnionService { |
|
|
key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getAppkey();
|
|
|
value = yhValueOperations.get(key);
|
|
|
log.info("activateUnion with get redis second with key={}, value={}", key, value);
|
|
|
clickUnion.info("activateUnion with get redis second with key={}, value={}", key, value);
|
|
|
activeUnion.info("activateUnion with get redis second with key={}, value={}", key, value);
|
|
|
}
|
|
|
if(arr.length==3){
|
|
|
request.setTd(arr[1]+"_"+arr[2]);
|
|
|
key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getAppkey();
|
|
|
value = yhValueOperations.get(key);
|
|
|
log.info("activateUnion with get redis third with key={}, value={}", key, value);
|
|
|
clickUnion.info("activateUnion with get redis third with key={}, value={}", key, value);
|
|
|
activeUnion.info("activateUnion with get redis third with key={}, value={}", key, value);
|
|
|
}
|
|
|
|
|
|
if(arr.length==3){
|
...
|
...
|
@@ -323,10 +326,15 @@ public class UnionServiceImpl implements IUnionService { |
|
|
}else{
|
|
|
key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getAppkey();
|
|
|
value = yhValueOperations.get(key);
|
|
|
if(StringUtils.isNotEmpty(value)){
|
|
|
ipMatch.info("activateUnion with IP params td is {},imei is {},idfa is {},IP is {}",request.getTd(),request.getImei(),request.getIdfa(),request.getClientIp());
|
|
|
return new UnionResponse(204, "user not click");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
log.info("activateUnion with get redis forth with key={}, value={}", key, value);
|
|
|
clickUnion.info("activateUnion with get redis forth with key={}, value={}", key, value);
|
|
|
activeUnion.info("activateUnion with get redis forth with key={}, value={}", key, value);
|
|
|
}
|
|
|
|
|
|
// 如果redis中不存在存在该用户点击信息,则退出
|
...
|
...
|
@@ -395,6 +403,7 @@ public class UnionServiceImpl implements IUnionService { |
|
|
//15天内有记录,退出
|
|
|
log.warn("activateUnion error because 15 days has activate in bigdata database info with param is {}", request);
|
|
|
} else {
|
|
|
//根据mkt_markering
|
|
|
//15天内没有记录,则记录大数据日志,退出
|
|
|
JSONObject j = new JSONObject();
|
|
|
j.put("apptype", request.getClient_type());
|
...
|
...
|
|