Authored by zhengwen.ge

优化

package com.yoho.unions.server.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.netflix.config.DynamicBooleanProperty;
import com.netflix.config.DynamicPropertyFactory;
import com.netflix.config.DynamicStringProperty;
import com.yoho.unions.common.utils.HttpUtils;
import com.yoho.unions.dal.IUnionOrderPushDAO;
import com.yoho.unions.dal.model.UnionOrderPush;
... ... @@ -46,7 +43,7 @@ public class OrderPushServiceImpl implements IOrderPushService{
param.put("orderPay",orderInfo.getPayment());
//订单金额
param.put("orderAmount",orderInfo.getOrderAmount());
//订单状态,大于700,订单取消,否则订单已付款
//订单状态
param.put("orderStatus",orderInfo.getOrderStatus());
//运费
param.put("orderShipCost",orderInfo.getShippingCost());
... ...
... ... @@ -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());
... ...