Authored by zhengwen.ge

update

... ... @@ -76,6 +76,14 @@ public class UnionRest {
return response;
}
@RequestMapping(value ="/addBigData")
@ResponseBody
public UnionResponseBO addBigData(int beginTime,int endTime) {
log.info("enter addBigData,beginTimeis {},endTime is {}",beginTime,endTime);
UnionResponseBO response = dingdangService.addBigData(beginTime,endTime);
return response;
}
/**
* 资讯下载,上报yas
* @param request
... ...
... ... @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.netflix.config.DynamicIntProperty;
import com.netflix.config.DynamicPropertyFactory;
import com.yoho.core.cache.CacheClient;
import com.yoho.core.common.utils.MD5;
import com.yoho.service.model.union.request.ActiveUnionRequestBO;
import com.yoho.service.model.union.request.AddUnionRequestBO;
import com.yoho.service.model.union.request.ClickUnionRequestBO;
... ... @@ -256,12 +257,20 @@ public class DingdangServiceImpl implements DingdangService {
String idfa = unionActivityLogs.getIdfa();
String imei = unionActivityLogs.getImei();
int createTime = unionActivityLogs.getCreateTime();
int saveTime = createTime - 3*60*60;
int saveTime = createTime - 2*60*60;
UnionClickLogs unionClickLogs = null;
if(StringUtils.isNotEmpty(idfa)){
unionClickLogs = unionClickLogsDAO.selectByIdfa(idfa,saveTime,createTime);
if(null==unionClickLogs){
String MD5Idfa = MD5.md5(idfa);
unionClickLogs = unionClickLogsDAO.selectByIdfa(MD5Idfa,saveTime,createTime);
}
}else{
unionClickLogs = unionClickLogsDAO.selectByImei(imei,saveTime,createTime);
if(null == unionClickLogs){
String MD5Imei = MD5.md5(imei);
unionClickLogs = unionClickLogsDAO.selectByIdfa(MD5Imei,saveTime,createTime);
}
}
//如果依然为空,则用td+IP的形式去匹配
String td = unionActivityLogs.getTd();
... ...
... ... @@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
... ... @@ -215,7 +216,7 @@ public class PinYouServiceImpl implements IPinYouService {
public UnionResponse sendUrl(String url) {
log.info("pinyou sendUrl url is {}", url);
try {
url = URLDecoder.decode(url, "UTF-8");
url = URLEncoder.encode(url, "UTF-8");
Pair<Integer, String> pair = HttpUtils.httpGet(url);
log.info("pinyou sendUrl union success url={}, and result={}", url, pair);
if (pair.getLeft() != 200) {
... ...