Authored by zhengwen.ge

代码兼容处理

@@ -8,6 +8,7 @@ import com.yoho.unions.dal.IUserOrdersDAO; @@ -8,6 +8,7 @@ import com.yoho.unions.dal.IUserOrdersDAO;
8 import com.yoho.unions.dal.model.UserOrders; 8 import com.yoho.unions.dal.model.UserOrders;
9 import com.yoho.unions.message.CommonMessageConsumer; 9 import com.yoho.unions.message.CommonMessageConsumer;
10 import com.yoho.unions.server.service.IOrderPushService; 10 import com.yoho.unions.server.service.IOrderPushService;
  11 +import org.apache.commons.lang.StringUtils;
11 import org.slf4j.Logger; 12 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
@@ -62,6 +63,8 @@ public class OrderPushConsumer implements CommonMessageConsumer { @@ -62,6 +63,8 @@ public class OrderPushConsumer implements CommonMessageConsumer {
62 UserOrders userOrders = new UserOrders(); 63 UserOrders userOrders = new UserOrders();
63 //联盟id 64 //联盟id
64 userOrders.setUid(jsonObject.getString("clientId")); 65 userOrders.setUid(jsonObject.getString("clientId"));
  66 +
  67 + String clientId = jsonObject.getString("clientId");
65 //订单号 68 //订单号
66 userOrders.setOrderCode(jsonObject.getString("orderCode")); 69 userOrders.setOrderCode(jsonObject.getString("orderCode"));
67 //订单金额 70 //订单金额
@@ -77,6 +80,12 @@ public class OrderPushConsumer implements CommonMessageConsumer { @@ -77,6 +80,12 @@ public class OrderPushConsumer implements CommonMessageConsumer {
77 //使用有货币、券,渠道 80 //使用有货币、券,渠道
78 //第三方tracking_code 81 //第三方tracking_code
79 userOrders.setTrackingCode(unionCookie.getString("channel_code")); 82 userOrders.setTrackingCode(unionCookie.getString("channel_code"));
  83 + //亿起发的wi对应的其实就是其他人的channel_code
  84 + if (StringUtils.isNotEmpty(clientId)){
  85 + if(clientId.equals("1001")||clientId.equals("2995")||clientId.equals("3415")||clientId.equals("3417")){
  86 + userOrders.setTrackingCode(unionCookie.getString("wi"));
  87 + }
  88 + }
80 //第三方用户id 89 //第三方用户id
81 userOrders.setUserId(unionCookie.getString("fl_uid")); 90 userOrders.setUserId(unionCookie.getString("fl_uid"));
82 //创建时间 91 //创建时间
@@ -76,6 +76,12 @@ public class ClickUnionRest { @@ -76,6 +76,12 @@ public class ClickUnionRest {
76 clientIp = IPS[0]; 76 clientIp = IPS[0];
77 } 77 }
78 request.setClientIp(clientIp); 78 request.setClientIp(clientIp);
  79 + //针对td做一下特殊处理,如果是0_0_ios_10.2 这种情况,则把0.0给截取掉
  80 + String td = request.getTd();
  81 + if (td.startsWith("0_0")){
  82 + String[] td1 = td.split("0_0_");
  83 + request.setTd(td1[1]);
  84 + }
79 clickUnion.info("addUnion with param is {}", request); 85 clickUnion.info("addUnion with param is {}", request);
80 UnionResponse response = unionService.clickUnion(request); 86 UnionResponse response = unionService.clickUnion(request);
81 log.info("addUnion with result is {}, and request is {}", response, request); 87 log.info("addUnion with result is {}, and request is {}", response, request);