Commit 9673bc91 by carrieyzzhang

add channel name

parent dfae8f9a
...@@ -341,34 +341,36 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{ ...@@ -341,34 +341,36 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
Map<String, String> campaignMap = new HashMap<>(); Map<String, String> campaignMap = new HashMap<>();
Map<String, String> channelMap = new HashMap<>(); Map<String, String> channelMap = new HashMap<>();
/*//group by _cid or group by _campaignid //group by _cid or group by _campaignid
if (groupArray.toString().contains(FIELD_CID) || groupArray.toString().contains(FIELD_CAMPAIGN_ID)) { if (groupArray.toString().contains(FIELD_CID) || groupArray.toString().contains(FIELD_CAMPAIGN_ID)) {
Account account = accountRepository.findOne(accountId); Account account = accountRepository.findOne(accountId);
App app = appRepository.findOne(appId); App app = appRepository.findOne(appId);
String url = Constant.trackingUrl + "/api/"+ app.getId() +"/channel/findchannelcamp4io?appkey=" + app.getAppkey() + "&email=" + account.getEmail(); try {
String response = HttpClientUtil.doHttpGetRequest(url, "io"); String url = Constant.trackingUrl + "/api/"+ app.getId() +"/channel/findchannelcamp4io?appkey=" + app.getAppkey() + "&email=" + account.getEmail();
if (!StringUtil.isEmpty(response)) { String response = HttpClientUtil.doHttpGetRequest(url, "io");
try { if (!StringUtil.isEmpty(response)) {
JSONObject ob = JSONObject.fromObject(response);
JSONObject content = ob.getJSONObject("content"); JSONObject ob = JSONObject.fromObject(response);
if (groupArray.toString().contains(FIELD_CID)) { JSONObject content = ob.getJSONObject("content");
JSONObject channelObject = content.getJSONObject("channel"); if (groupArray.toString().contains(FIELD_CID)) {
ObjectMapper mapper = new ObjectMapper(); JSONObject channelObject = content.getJSONObject("channel");
channelMap = mapper.readValue(channelObject.toString(), Map.class); ObjectMapper mapper = new ObjectMapper();
} channelMap = mapper.readValue(channelObject.toString(), Map.class);
if (groupArray.toString().contains(FIELD_CAMPAIGN_ID)) { }
JSONObject campObject = content.getJSONObject("campaign"); if (groupArray.toString().contains(FIELD_CAMPAIGN_ID)) {
ObjectMapper mapper = new ObjectMapper(); JSONObject campObject = content.getJSONObject("campaign");
campaignMap = mapper.readValue(campObject.toString(), Map.class); ObjectMapper mapper = new ObjectMapper();
} campaignMap = mapper.readValue(campObject.toString(), Map.class);
}
} catch (Exception e) {
logger.error("fail to get channel or campaign name");
}
}
} catch (Exception e) {
logger.error("fail to get channel or campaign name");
} }
}*/ }
//翻译处理 //翻译处理
for (Object valElement : responseValueArray) { for (Object valElement : responseValueArray) {
...@@ -1035,7 +1037,7 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{ ...@@ -1035,7 +1037,7 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
//val //val
if (!CollectionUtils.isEmpty(responseValueArray)) { if (!CollectionUtils.isEmpty(responseValueArray)) {
/*System.out.println("start to get channel name from tracking"); System.out.println("start to get channel name from tracking");
//cid,campaignid数据转换 //cid,campaignid数据转换
Map<String, String> campaignMap = new HashMap<>(); Map<String, String> campaignMap = new HashMap<>();
...@@ -1070,7 +1072,7 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{ ...@@ -1070,7 +1072,7 @@ public class ComplicatedEventsServiceImpl implements ComplicateEventsService{
} }
} }
System.out.println("end to get channel name from tracking");*/ System.out.println("end to get channel name from tracking");
//1,处理日期合并(给每个日期的第一行加标注,firstDateRow标示第一行,rowNum标示相同日期行数) //1,处理日期合并(给每个日期的第一行加标注,firstDateRow标示第一行,rowNum标示相同日期行数)
String firstValueDate = ""; String firstValueDate = "";
......
...@@ -24,9 +24,9 @@ public class HttpClientUtil { ...@@ -24,9 +24,9 @@ public class HttpClientUtil {
private static final Log log = LogFactory.getLog(HttpClientUtil.class); private static final Log log = LogFactory.getLog(HttpClientUtil.class);
// 读取超时 // 读取超时
private final static int SOCKET_TIMEOUT = 10000; private final static int SOCKET_TIMEOUT = 6000;
// 连接超时 // 连接超时
private final static int CONNECTION_TIMEOUT = 60000; private final static int CONNECTION_TIMEOUT = 6000;
// 每个HOST的最大连接数量 // 每个HOST的最大连接数量
private final static int MAX_CONN_PRE_HOST = 20; private final static int MAX_CONN_PRE_HOST = 20;
// 连接池的最大连接数 // 连接池的最大连接数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment