|
|
package com.yoho.unions.server.service.impl;
|
|
|
|
|
|
import com.yoho.unions.common.utils.HttpUtils;
|
|
|
import com.yoho.unions.server.service.IOrderPushService;
|
|
|
import com.yoho.unions.vo.OrderInfo;
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by mingdan.ge on 2019/11/25.
|
|
|
*/
|
|
|
@Service
|
|
|
public class ChineseANS2SImpl implements IOrderPushService {
|
|
|
|
|
|
static Logger logger = LoggerFactory.getLogger(ChineseANS2SImpl.class);
|
|
|
static final String preUrl = "https://www.chinesean.com/affiliate/tracking3.do?pId=19865";
|
|
|
|
|
|
@Override
|
|
|
public void pushOrder(List<OrderInfo> orderInfos){
|
|
|
orderInfos.forEach(o->{
|
|
|
//https://www.chinesean.com/affiliate/tracking3.do?pId=PROGRAMID&tracking=REFID&cpa=&cpl=&cps=AMOUNT,TIERID&txId=TXID
|
|
|
String url=preUrl+"&tracking="+o.getOrderCode()+"cpa=&cpl=&cps="+o.getOrderAmount()+",TIERID"+"&txId="+o.getUnionData();
|
|
|
Pair<Integer, String> pair = HttpUtils.httpGet(url);
|
|
|
if (pair.getLeft() != 200) {
|
|
|
logger.error("ChineseANS2SImpl.pushOrder error,url is ,result is {}.",url,pair);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
} |
...
|
...
|
|