|
@@ -104,13 +104,13 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -104,13 +104,13 @@ public class UnionServiceImpl implements IUnionService { |
104
|
//组装redis保存的key
|
104
|
//组装redis保存的key
|
105
|
String key;
|
105
|
String key;
|
106
|
if (StringUtils.isNotEmpty(request.getIdfa())) {
|
106
|
if (StringUtils.isNotEmpty(request.getIdfa())) {
|
107
|
- key = UNION_KEY + "_" + request.getIdfa() + "_" + request.getApp_key();
|
107
|
+ key = UNION_KEY + "_" + request.getIdfa() + "_" + request.getAppkey();
|
108
|
} else if (StringUtils.isNotEmpty(request.getImei())) {
|
108
|
} else if (StringUtils.isNotEmpty(request.getImei())) {
|
109
|
- key = UNION_KEY + "_" + request.getImei() + "_" + request.getApp_key();
|
109
|
+ key = UNION_KEY + "_" + request.getImei() + "_" + request.getAppkey();
|
110
|
} else {
|
110
|
} else {
|
111
|
key = UNION_KEY + "_" + request.getClientIp();
|
111
|
key = UNION_KEY + "_" + request.getClientIp();
|
112
|
if (StringUtils.isNotEmpty(request.getTd())) {
|
112
|
if (StringUtils.isNotEmpty(request.getTd())) {
|
113
|
- key += "_" + request.getTd() + "_" + request.getApp_key();
|
113
|
+ key += "_" + request.getTd() + "_" + request.getAppkey();
|
114
|
}
|
114
|
}
|
115
|
}
|
115
|
}
|
116
|
// String value = yhValueOperations.get(key);
|
116
|
// String value = yhValueOperations.get(key);
|
|
@@ -196,14 +196,14 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -196,14 +196,14 @@ public class UnionServiceImpl implements IUnionService { |
196
|
// 组装redis保存的key
|
196
|
// 组装redis保存的key
|
197
|
String key = "";
|
197
|
String key = "";
|
198
|
if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
198
|
if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
199
|
- key = UNION_KEY + "_" + request.getIdfa() + "_" + request.getApp_key();
|
199
|
+ key = UNION_KEY + "_" + request.getIdfa() + "_" + request.getAppkey();
|
200
|
} else if (ClientTypeEnum.ANDROID.getName().equals(request.getClient_type())) {
|
200
|
} else if (ClientTypeEnum.ANDROID.getName().equals(request.getClient_type())) {
|
201
|
- key = UNION_KEY + "_" + request.getImei() + "_" + request.getApp_key();
|
201
|
+ key = UNION_KEY + "_" + request.getImei() + "_" + request.getAppkey();
|
202
|
}
|
202
|
}
|
203
|
String value = yhValueOperations.get(key);
|
203
|
String value = yhValueOperations.get(key);
|
204
|
log.info("activateUnion with get redis first with key={}, value={}", key, value);
|
204
|
log.info("activateUnion with get redis first with key={}, value={}", key, value);
|
205
|
if (StringUtils.isEmpty(value)) {
|
205
|
if (StringUtils.isEmpty(value)) {
|
206
|
- key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getApp_key();
|
206
|
+ key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getAppkey();
|
207
|
value = yhValueOperations.get(key);
|
207
|
value = yhValueOperations.get(key);
|
208
|
log.info("activateUnion with get redis first with key={}, value={}", key, value);
|
208
|
log.info("activateUnion with get redis first with key={}, value={}", key, value);
|
209
|
}
|
209
|
}
|
|
@@ -211,13 +211,13 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -211,13 +211,13 @@ public class UnionServiceImpl implements IUnionService { |
211
|
String[] arr = request.getTd().split("_");
|
211
|
String[] arr = request.getTd().split("_");
|
212
|
if (arr.length > 3) {
|
212
|
if (arr.length > 3) {
|
213
|
request.setTd(arr[2] + "_" + arr[3]);
|
213
|
request.setTd(arr[2] + "_" + arr[3]);
|
214
|
- key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getApp_key();
|
214
|
+ key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getTd() + "_" + request.getAppkey();
|
215
|
value = yhValueOperations.get(key);
|
215
|
value = yhValueOperations.get(key);
|
216
|
log.info("activateUnion with get redis second with key={}, value={}", key, value);
|
216
|
log.info("activateUnion with get redis second with key={}, value={}", key, value);
|
217
|
}
|
217
|
}
|
218
|
|
218
|
|
219
|
if (StringUtils.isEmpty(value)) {
|
219
|
if (StringUtils.isEmpty(value)) {
|
220
|
- key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getApp_key();
|
220
|
+ key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getAppkey();
|
221
|
value = yhValueOperations.get(key);
|
221
|
value = yhValueOperations.get(key);
|
222
|
log.info("activateUnion with get redis thred with key={}, value={}", key, value);
|
222
|
log.info("activateUnion with get redis thred with key={}, value={}", key, value);
|
223
|
}
|
223
|
}
|
|
@@ -232,7 +232,7 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -232,7 +232,7 @@ public class UnionServiceImpl implements IUnionService { |
232
|
// 把存储的字符串变为对象
|
232
|
// 把存储的字符串变为对象
|
233
|
ClickUnionRequestBO click = JSON.parseObject(value, ClickUnionRequestBO.class);
|
233
|
ClickUnionRequestBO click = JSON.parseObject(value, ClickUnionRequestBO.class);
|
234
|
// 查询该td在90天内是否已经激活过
|
234
|
// 查询该td在90天内是否已经激活过
|
235
|
- UnionLogs union = unionLogsDAO.selectByClientType(request.getClient_type(), request.getIdfa(), request.getImei(), request.getApp_key());
|
235
|
+ UnionLogs union = unionLogsDAO.selectByClientType(request.getClient_type(), request.getIdfa(), request.getImei(), request.getAppkey());
|
236
|
log.info("activateUnion in selectByClientType result is {}", union);
|
236
|
log.info("activateUnion in selectByClientType result is {}", union);
|
237
|
// 没有点击记录,则退出
|
237
|
// 没有点击记录,则退出
|
238
|
// if (union == null) {
|
238
|
// if (union == null) {
|
|
@@ -250,8 +250,8 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -250,8 +250,8 @@ public class UnionServiceImpl implements IUnionService { |
250
|
//如果是ios系统,还要到大数据表里面判断这个用户是否90天内的活跃用户,如果是的话,这次激活就不成功
|
250
|
//如果是ios系统,还要到大数据表里面判断这个用户是否90天内的活跃用户,如果是的话,这次激活就不成功
|
251
|
String yesterday = DateUtil.dateAdd(DateUtil.getToday("yyyyMMdd"), "d", -1, "yyyyMMdd");
|
251
|
String yesterday = DateUtil.dateAdd(DateUtil.getToday("yyyyMMdd"), "d", -1, "yyyyMMdd");
|
252
|
if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
252
|
if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
253
|
- List<AppActivateIdfaList> _90DayIdfaList = appActivateIdfaListDAO.selectByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), request.getApp_key()));
|
|
|
254
|
- List<AppActivateIdfaList> _15DayIdfaList = appActivateIdfaListDAO.select15DaysByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), request.getApp_key()));
|
253
|
+ List<AppActivateIdfaList> _90DayIdfaList = appActivateIdfaListDAO.selectByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), request.getAppkey()));
|
|
|
254
|
+ List<AppActivateIdfaList> _15DayIdfaList = appActivateIdfaListDAO.select15DaysByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), request.getAppkey()));
|
255
|
//判断90天内是否在大数据有记录
|
255
|
//判断90天内是否在大数据有记录
|
256
|
if (CollectionUtils.isNotEmpty(_90DayIdfaList)) {
|
256
|
if (CollectionUtils.isNotEmpty(_90DayIdfaList)) {
|
257
|
log.warn("activateUnion error because 90 days has activate in bigdata database info with param is {}", request);
|
257
|
log.warn("activateUnion error because 90 days has activate in bigdata database info with param is {}", request);
|
|
@@ -272,7 +272,7 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -272,7 +272,7 @@ public class UnionServiceImpl implements IUnionService { |
272
|
j.put("source", u == null ? "" : u.getName());
|
272
|
j.put("source", u == null ? "" : u.getName());
|
273
|
j.put("ip", request.getClientIp());
|
273
|
j.put("ip", request.getClientIp());
|
274
|
j.put("collect_ip", "");
|
274
|
j.put("collect_ip", "");
|
275
|
- j.put("app_key", request.getApp_key());
|
275
|
+ j.put("app_key", request.getAppkey());
|
276
|
j.put("active_type", "15");
|
276
|
j.put("active_type", "15");
|
277
|
activeDingdang.info(j.toString());
|
277
|
activeDingdang.info(j.toString());
|
278
|
}
|
278
|
}
|
|
@@ -296,7 +296,7 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -296,7 +296,7 @@ public class UnionServiceImpl implements IUnionService { |
296
|
logs.setUnionType(Integer.valueOf(click.getUnion_type()));
|
296
|
logs.setUnionType(Integer.valueOf(click.getUnion_type()));
|
297
|
logs.setAddParams(value);
|
297
|
logs.setAddParams(value);
|
298
|
logs.setTd(request.getTd());
|
298
|
logs.setTd(request.getTd());
|
299
|
- logs.setAppKey(request.getApp_key());
|
299
|
+ logs.setAppKey(request.getAppkey());
|
300
|
unionLogsDAO.insert(logs);
|
300
|
unionLogsDAO.insert(logs);
|
301
|
log.info("activateUnion add db success with request is {}, and dbData={}", request, logs);
|
301
|
log.info("activateUnion add db success with request is {}, and dbData={}", request, logs);
|
302
|
|
302
|
|
|
@@ -315,7 +315,7 @@ public class UnionServiceImpl implements IUnionService { |
|
@@ -315,7 +315,7 @@ public class UnionServiceImpl implements IUnionService { |
315
|
j.put("source", u == null ? "" : u.getName());
|
315
|
j.put("source", u == null ? "" : u.getName());
|
316
|
j.put("ip", request.getClientIp());
|
316
|
j.put("ip", request.getClientIp());
|
317
|
j.put("collect_ip", "");
|
317
|
j.put("collect_ip", "");
|
318
|
- j.put("app_key", request.getApp_key());
|
318
|
+ j.put("app_key", request.getAppkey());
|
319
|
j.put("active_type", "90");
|
319
|
j.put("active_type", "90");
|
320
|
//打印90天的大数据日志
|
320
|
//打印90天的大数据日志
|
321
|
activeDingdang.info(j.toString());
|
321
|
activeDingdang.info(j.toString());
|