...
|
...
|
@@ -2,10 +2,12 @@ package com.yoho.unions.server.service.impl; |
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
import org.apache.http.HttpStatus;
|
...
|
...
|
@@ -25,7 +27,9 @@ import com.yoho.unions.common.enums.MsgEnum; |
|
|
import com.yoho.unions.common.enums.UnionTypeEnum;
|
|
|
import com.yoho.unions.common.utils.DateUtil;
|
|
|
import com.yoho.unions.common.utils.HttpUtils;
|
|
|
import com.yoho.unions.dal.IAppActivateIdfaListDAO;
|
|
|
import com.yoho.unions.dal.IUnionLogsDAO;
|
|
|
import com.yoho.unions.dal.model.AppActivateIdfaList;
|
|
|
import com.yoho.unions.dal.model.UnionLogs;
|
|
|
import com.yoho.unions.server.service.MainUnionService;
|
|
|
|
...
|
...
|
@@ -44,6 +48,9 @@ public class GDTServiceImpl implements MainUnionService { |
|
|
@Resource
|
|
|
IUnionLogsDAO unionLogsDAO;
|
|
|
|
|
|
@Resource
|
|
|
IAppActivateIdfaListDAO appActivateIdfaListDAO;
|
|
|
|
|
|
@Override
|
|
|
public JSONObject addUnion(Object obj) {
|
|
|
// TODO Auto-generated method stub
|
...
|
...
|
@@ -96,14 +103,25 @@ public class GDTServiceImpl implements MainUnionService { |
|
|
logs = unionLogsDAO.selectIOS(String.valueOf(request.getAppid()), request.getIdfa(), request.getClient_type(), 3);
|
|
|
if(null !=logs &&logs.getIsActivate()==1){
|
|
|
log.warn("GDT activeUnion exists with request={}", request);
|
|
|
return response;
|
|
|
return new UnionResponseBO(false, "activeUnion exists");
|
|
|
}
|
|
|
}else{
|
|
|
logs = unionLogsDAO.selectAndroid(String.valueOf(request.getAppid()), request.getImei(), request.getClient_type(), 3);
|
|
|
if(null !=logs && logs.getIsActivate()==1){
|
|
|
log.warn("GDT activeUnion exists with request={}", request);
|
|
|
return response;
|
|
|
return new UnionResponseBO(false, "activeUnion exists");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//如果是ios系统,还要到大数据表里面判断这个用户是否90天内的活跃用户,如果是的话,这次激活就不成功
|
|
|
if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
|
|
String yesterday = DateUtil.dateAdd(DateUtil.getToday("yyyyMMdd"), "d", -1, "yyyyMMdd");
|
|
|
List<AppActivateIdfaList> idfaList = appActivateIdfaListDAO.selectByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa()));
|
|
|
if (CollectionUtils.isNotEmpty(idfaList)) {
|
|
|
log.warn("activateUnion error because 90 days has activate in bigdata database info with param is {}", request);
|
|
|
return new UnionResponseBO(false, "have activite in 90 days");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 对url进行加密,拼接
|
...
|
...
|
|