...
|
...
|
@@ -127,17 +127,25 @@ public class RedirectServiceImpl implements IRedirectService { |
|
|
|
|
|
private String builderCommonUrl(UnionReqVO uionReqVO){
|
|
|
String channelId = uionReqVO.getChannel_id();
|
|
|
UnionType unionType = unionTypeDAO.selectByUnionType(Integer.parseInt(channelId.trim()));
|
|
|
logger.info("builderCommonUrl find the UnionType = {} by channelId={}",unionType,channelId);
|
|
|
if(null == unionType || StringUtils.isBlank(unionType.getGoUrl()) || StringUtils.isBlank(unionType.getName()))
|
|
|
String url = null;
|
|
|
//百度比较特殊,百度移动端的go_url记在数据库,另一种方式的在这边强制赋值
|
|
|
if(Integer.parseInt(channelId.trim())==2891&&!uionReqVO.getTracking_code().equals("mbdcpc2")){
|
|
|
url = "http://m.yohobuy.com/";
|
|
|
}else{
|
|
|
UnionType unionType = unionTypeDAO.selectByUnionType(Integer.parseInt(channelId.trim()));
|
|
|
url = unionType.getGoUrl();
|
|
|
}
|
|
|
|
|
|
logger.info("builderCommonUrl find the channelId={}",channelId);
|
|
|
if( StringUtils.isBlank(url))
|
|
|
return "";
|
|
|
|
|
|
StringBuilder targetUrl = new StringBuilder("http://union.yohobuy.com/go?client_id=");
|
|
|
targetUrl.append(channelId.trim());
|
|
|
targetUrl.append("&channel_code=");
|
|
|
targetUrl.append(unionType.getName());
|
|
|
targetUrl.append(uionReqVO.getTracking_code());
|
|
|
targetUrl.append("&append=&go_url=");
|
|
|
targetUrl.append(unionType.getGoUrl());
|
|
|
targetUrl.append(url);
|
|
|
|
|
|
if (targetUrl.toString().contains("?")) {
|
|
|
targetUrl.append("&utm_source=").append(uionReqVO.getUtm_source()).append("&utm_medium=").append(uionReqVO.getUtm_medium()).append("&utm_campaign=").append(uionReqVO.getUtm_campaign());
|
...
|
...
|
|