...
|
...
|
@@ -205,31 +205,17 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
//保存到缓存中,根据不同的厂商,设置不同的有效期,3:
|
|
|
// log.info("clickUnion set redis with key={}, value={}", key, JSON.toJSONString(request));
|
|
|
clickUnion.info("clickUnion set redis with key={}, value={}", key, JSON.toJSONString(request));
|
|
|
yhValueOperations.set(key, JSON.toJSONString(request));
|
|
|
|
|
|
String invalidTime = "activeTime"+"_"+request.getUnion_type();
|
|
|
// 有效时间改成5天
|
|
|
DynamicIntProperty activeTime = DynamicPropertyFactory.getInstance().getIntProperty(invalidTime, 5 * 24);
|
|
|
yHRedisTemplate.longExpire(key, activeTime.get(), TimeUnit.HOURS);
|
|
|
|
|
|
|
|
|
yhValueOperations.set(key, JSON.toJSONString(request), activeTime.get(), TimeUnit.HOURS);
|
|
|
|
|
|
//把IP作为key,也保存到redis
|
|
|
key = UNION_KEY + "_" + request.getClientIp() + "_" + request.getAppkey();
|
|
|
yhValueOperations.set(key, JSON.toJSONString(request));
|
|
|
yHRedisTemplate.longExpire(key, activeTime.get(), TimeUnit.HOURS);
|
|
|
yhValueOperations.set(key, JSON.toJSONString(request), activeTime.get(), TimeUnit.HOURS);
|
|
|
clickUnion.info("clickUnion set redis second success. with key={}, value={}", key, JSON.toJSONString(request));
|
|
|
|
|
|
// UnionActivityTrans unionActivityTrans = new UnionActivityTrans();
|
|
|
// List<UnionActivityTrans> list = new ArrayList<>();
|
|
|
// for(int i=0;i<3;i++){
|
|
|
// UnionActivityTrans unionActivityTrans = new UnionActivityTrans();
|
|
|
// unionActivityTrans.setOrdercode("123");
|
|
|
// unionActivityTrans.setUdid("234");
|
|
|
// unionActivityTrans.setOrderAmount(new BigDecimal(12));
|
|
|
// unionActivityTrans.setUid("12");
|
|
|
// list.add(unionActivityTrans);
|
|
|
// }
|
|
|
// redisListCache.rightPushAll("UNION:KEY:123",list,activeTime.get(),TimeUnit.HOURS);
|
|
|
|
|
|
return new UnionResponse();
|
|
|
} catch (Exception e) {
|
|
|
log.error("clickUnion error with request={}", request, e);
|
...
|
...
|
@@ -417,10 +403,10 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
app_key = "yohomars_ios";
|
|
|
}
|
|
|
List<AppActivateIdfaList> _90DayIdfaList = appActivateIdfaListDAO.selectByUdidAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getUdid(), app_key));
|
|
|
activeUnion.info("check ios active info in 90 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (_90DayIdfaList.isEmpty())? "null": _90DayIdfaList.get(0));
|
|
|
activeUnion.info("check ios active info in 90 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (_90DayIdfaList.isEmpty() || _90DayIdfaList.size() == 0)? "null": _90DayIdfaList.get(0));
|
|
|
|
|
|
List<AppActivateIdfaList> _15DayIdfaList = appActivateIdfaListDAO.select15DaysByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), app_key, null));
|
|
|
activeUnion.info("check ios active info in 15 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (_90DayIdfaList.isEmpty())? "null": _15DayIdfaList.get(0));
|
|
|
activeUnion.info("check ios active info in 15 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (_15DayIdfaList.isEmpty() || _15DayIdfaList.size() == 0)? "null": _15DayIdfaList.get(0));
|
|
|
|
|
|
//判断90天内是否在大数据有记录
|
|
|
if (CollectionUtils.isNotEmpty(_90DayIdfaList)) {
|
...
|
...
|
@@ -471,8 +457,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
try{
|
|
|
DynamicIntProperty activeTime = DynamicPropertyFactory.getInstance().getIntProperty("activeTime_pay_channel", 90);
|
|
|
String payChannelKey = UNION_PAY_CHANNEL_KEY_PRE + request.getUdid();
|
|
|
yhValueOperations.set(payChannelKey, request.getClient_type());
|
|
|
yHRedisTemplate.longExpire(key, activeTime.get(), TimeUnit.DAYS);
|
|
|
yhValueOperations.set(payChannelKey, request.getClient_type(), activeTime.get(), TimeUnit.DAYS);
|
|
|
}catch (Exception e){
|
|
|
log.warn("set redis cache error, udid is {}, client_type is {}", request.getUdid(), request.getClient_type());
|
|
|
}
|
...
|
...
|
@@ -638,7 +623,11 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
//(1).查询出各渠道激活的设备id数
|
|
|
List<ActivateDeviceIdRspBO> activateDeviceIdRspList = unionLogsDAO.selectListByParam(activateDeviceIdReqBO);
|
|
|
|
|
|
|
|
|
// if(null != activateDeviceIdRspList && activateDeviceIdRspList.size() > 0){
|
|
|
// for(ActivateDeviceIdRspBO rspBO: activateDeviceIdRspList){
|
|
|
// rspBO.setTotalCount(rspBO.getIdfaCount() + rspBO.getImeiCount());
|
|
|
// }
|
|
|
// }
|
|
|
// int total = unionLogsDAO.selectListCountByParam(activateDeviceIdReqBO);
|
|
|
// if(total>0){
|
|
|
// activateDeviceIdRspList = unionLogsDAO.selectListByParam(activateDeviceIdReqBO);
|
...
|
...
|
|