|
@@ -4,6 +4,7 @@ import cn.com.ctop.track.entity.ConvertInfo;
|
|
|
import cn.com.ctop.track.service.ClickInfoService;
|
|
|
import cn.com.ctop.track.service.ConvertInfoService;
|
|
|
import cn.com.ctop.track.service.TaobaoNoticeService;
|
|
|
+import cn.com.ctop.track.utils.Check;
|
|
|
import cn.com.ctop.track.utils.HttpUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -14,6 +15,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.TreeMap;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/convert")
|
|
@@ -25,6 +29,7 @@ public class TrackController {
|
|
|
private TaobaoNoticeService taobaoNoticeService;
|
|
|
@Autowired
|
|
|
private ConvertInfoService convertInfoService;
|
|
|
+ private static String url = "https://ugapi.alipay.com/monitor";
|
|
|
|
|
|
@RequestMapping(value = "/click")
|
|
|
public String convert3(HttpServletRequest request,
|
|
@@ -36,13 +41,62 @@ public class TrackController {
|
|
|
//test
|
|
|
String aciton = "click"; // ⾏为类型 // 点击
|
|
|
String imei = request.getParameter("imei");
|
|
|
+ String oaidmd5 = request.getParameter("oaidmd5");
|
|
|
String accountid = request.getParameter("accountid"); //⼴告账户ID
|
|
|
String adid = request.getParameter("adid"); //⼴告计划ID
|
|
|
String campaignid = request.getParameter("campaignid"); // ⼴告组ID
|
|
|
- String oaidmd5 = request.getParameter("oaidmd5"); // ⼴告创意ID
|
|
|
- String cid = request.getParameter("cid");
|
|
|
+ String cid = request.getParameter("cid"); // ⼴告创意ID
|
|
|
+ String callback = request.getParameter("callback"); // ⼴告创意ID
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
+ TreeMap<String, Object> params = new TreeMap<>();
|
|
|
+ params.put("aciton", aciton);
|
|
|
+ params.put("requestFrom", "huichuang");
|
|
|
+ params.put("pid", "2088821582878450");
|
|
|
+ params.put("partnerId", "tab3huichuangapkhuichuang");
|
|
|
+ if (!Check.isNotNull(imei)) {
|
|
|
+ params.put("imei", imei);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(oaidmd5)) {
|
|
|
+ params.put("oaidmd5", oaidmd5);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(accountid)) {
|
|
|
+ params.put("accountid", accountid);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(adid)) {
|
|
|
+ params.put("adid", adid);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(campaignid)) {
|
|
|
+ params.put("campaignid", campaignid);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(cid)) {
|
|
|
+ params.put("cid", cid);
|
|
|
+ }
|
|
|
+ if (!Check.isNotNull(callback)) {
|
|
|
+ String callbackUrl = "https://track.tjyourong.com.cn/convert/back?kuaishouCallback=" + callback;
|
|
|
+ params.put("callback", callbackUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ String s = HttpUtils.httpGetRequest(url, headers, params);
|
|
|
+ System.err.println("---------------返回结果------------------");
|
|
|
+ System.err.println(s);
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return "{\"code\":200,\"result\":\"success\"}";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping(value = "/back")
|
|
|
+ public String back(HttpServletRequest request,
|
|
|
+ HttpServletResponse response) {
|
|
|
+
|
|
|
+ logger.info("支付宝回传: " + request.getQueryString());
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
|
|
|
- String channel = request.getParameter("channel"); // 渠道
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|