|
@@ -1,20 +1,16 @@
|
|
package cn.com.ctop.track.controller;
|
|
package cn.com.ctop.track.controller;
|
|
|
|
|
|
-import cn.com.ctop.track.entity.TrackRta;
|
|
|
|
import cn.com.ctop.track.service.ClickInfoService;
|
|
import cn.com.ctop.track.service.ClickInfoService;
|
|
import cn.com.ctop.track.service.ConvertInfoService;
|
|
import cn.com.ctop.track.service.ConvertInfoService;
|
|
import cn.com.ctop.track.service.TaobaoNoticeService;
|
|
import cn.com.ctop.track.service.TaobaoNoticeService;
|
|
import cn.com.ctop.track.utils.Check;
|
|
import cn.com.ctop.track.utils.Check;
|
|
import cn.com.ctop.track.utils.HttpUtils;
|
|
import cn.com.ctop.track.utils.HttpUtils;
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
-import org.springframework.data.mongodb.core.query.Criteria;
|
|
|
|
-import org.springframework.data.mongodb.core.query.Query;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
@@ -56,9 +52,12 @@ public class TrackController {
|
|
try {
|
|
try {
|
|
//test
|
|
//test
|
|
String action = "click"; // ⾏为类型 // 点击
|
|
String action = "click"; // ⾏为类型 // 点击
|
|
|
|
+ String accountid = request.getParameter("accountid"); //客户后台账户ID
|
|
|
|
+ String partnerId = request.getParameter("partnerId"); //partnerId
|
|
|
|
+ String pid = request.getParameter("pid"); //pid
|
|
|
|
+ String requestFrom = request.getParameter("requestFrom"); //requestFrom
|
|
String imei = request.getParameter("imei");
|
|
String imei = request.getParameter("imei");
|
|
String oaidmd5 = request.getParameter("oaidmd5");
|
|
String oaidmd5 = request.getParameter("oaidmd5");
|
|
- String accountid = request.getParameter("accountid"); //⼴告账户ID
|
|
|
|
String adid = request.getParameter("adid"); //⼴告计划ID
|
|
String adid = request.getParameter("adid"); //⼴告计划ID
|
|
String campaignid = request.getParameter("campaignid"); // ⼴告组ID
|
|
String campaignid = request.getParameter("campaignid"); // ⼴告组ID
|
|
String cid = request.getParameter("cid"); // ⼴告创意ID
|
|
String cid = request.getParameter("cid"); // ⼴告创意ID
|
|
@@ -66,9 +65,9 @@ public class TrackController {
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
TreeMap<String, Object> params = new TreeMap<>();
|
|
params.put("action", action);
|
|
params.put("action", action);
|
|
- params.put("requestFrom", "huichuang");
|
|
|
|
- params.put("pid", "2088821582878450");
|
|
|
|
- params.put("partnerId", "tab3huichuangapkhuichuang");
|
|
|
|
|
|
+ params.put("requestFrom", requestFrom);
|
|
|
|
+ params.put("pid", pid);
|
|
|
|
+ params.put("partnerId", partnerId);
|
|
if (!Check.isNull(imei)) {
|
|
if (!Check.isNull(imei)) {
|
|
params.put("imei", imei);
|
|
params.put("imei", imei);
|
|
}
|
|
}
|
|
@@ -135,7 +134,6 @@ public class TrackController {
|
|
logger.info("新沉流点击上报客户开始::" + request.getQueryString());
|
|
logger.info("新沉流点击上报客户开始::" + request.getQueryString());
|
|
JSONObject returnJson = new JSONObject();
|
|
JSONObject returnJson = new JSONObject();
|
|
try {
|
|
try {
|
|
- //test
|
|
|
|
String action = "click"; // ⾏为类型 // 点击
|
|
String action = "click"; // ⾏为类型 // 点击
|
|
String imei = request.getParameter("imei");
|
|
String imei = request.getParameter("imei");
|
|
String oaidmd5 = request.getParameter("oaidmd5");
|
|
String oaidmd5 = request.getParameter("oaidmd5");
|
|
@@ -166,8 +164,6 @@ public class TrackController {
|
|
if (!Check.isNull(imei)) {
|
|
if (!Check.isNull(imei)) {
|
|
params.put("imei", imei);
|
|
params.put("imei", imei);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
if (!Check.isNull(adid)) {
|
|
if (!Check.isNull(adid)) {
|
|
params.put("adid", adid);
|
|
params.put("adid", adid);
|
|
}
|
|
}
|
|
@@ -187,56 +183,12 @@ public class TrackController {
|
|
params.put("callback", callbackUrl);
|
|
params.put("callback", callbackUrl);
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
click2ExecutorService.submit(new Runnable() {
|
|
click2ExecutorService.submit(new Runnable() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
if (Check.isNull(oaidmd5) && Check.isNull(imei)) {
|
|
if (Check.isNull(oaidmd5) && Check.isNull(imei)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- /* JSONObject json = clickInfoService.getRtaInfo(oaidmd5, imei, "tab3xcl");
|
|
|
|
- if (!Check.isNull(json)) {
|
|
|
|
- Integer code = json.getInteger("code");
|
|
|
|
- if (code == 10000) {
|
|
|
|
- Boolean requiredFlow = json.getBoolean("requiredFlow");
|
|
|
|
- if (requiredFlow) {
|
|
|
|
- JSONArray rtaInfoList = json.getJSONArray("rtaInfoList");
|
|
|
|
- if (Check.isNull(rtaInfoList)) {
|
|
|
|
- logger.info("rta返回策略列表为空,跳过上传");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- Boolean isRtaAccount = false;
|
|
|
|
- for (int i = 0; i < rtaInfoList.size(); i++) {
|
|
|
|
- JSONObject jsonObject = rtaInfoList.getJSONObject(i);
|
|
|
|
- String accountId = jsonObject.getString("account_id");
|
|
|
|
- if ("tab3xcl".equals(accountId)) {
|
|
|
|
- isRtaAccount = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (isRtaAccount) {
|
|
|
|
- String s = HttpUtils.httpGetRequest(url, headers, params);
|
|
|
|
- logger.info("新沉流快手点击监测上报客户返回结果:" + s);
|
|
|
|
- JSONObject mongoVo = new JSONObject();
|
|
|
|
- if (!Check.isNull(oaidmd5)) {
|
|
|
|
- mongoVo.put("_id", oaidmd5);
|
|
|
|
- } else if (!Check.isNull(imei)) {
|
|
|
|
- mongoVo.put("_id", imei);
|
|
|
|
- }
|
|
|
|
- long timestamp = System.currentTimeMillis() / 1000;
|
|
|
|
- mongoVo.put("timestamp", timestamp);
|
|
|
|
- mongoTemplate.save(mongoVo, "trackRta");
|
|
|
|
- } else {
|
|
|
|
- logger.info("新沉流客户rta返回策略列表未命中:tab3xcl,停止上报数据,返回数据:" + json);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- logger.info("新沉流客户rta返回结果为false,停止上报数据");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- logger.info("新沉流调用rta返回结果错误:" + json);
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
String s = HttpUtils.httpGetRequest(url, headers, params);
|
|
String s = HttpUtils.httpGetRequest(url, headers, params);
|
|
logger.info("新沉流快手点击监测上报客户返回结果:" + s);
|
|
logger.info("新沉流快手点击监测上报客户返回结果:" + s);
|
|
|
|
|