|
@@ -93,8 +93,8 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
|
|
|
promoterReportMapper.replacePromoterReportHour(hours);
|
|
promoterReportMapper.replacePromoterReportHour(hours);
|
|
|
try {
|
|
try {
|
|
|
promoterReportMapper.replacePromoterReportHourSD(hours);
|
|
promoterReportMapper.replacePromoterReportHourSD(hours);
|
|
|
- }catch (Exception e) {
|
|
|
|
|
- log.error("",e);
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("", e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (hours.size() >= 100) {
|
|
if (hours.size() >= 100) {
|
|
@@ -177,8 +177,8 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
|
|
|
promoterReportMapper.replacePromoterReportDailies(promoterReportDailies);
|
|
promoterReportMapper.replacePromoterReportDailies(promoterReportDailies);
|
|
|
try {
|
|
try {
|
|
|
promoterReportMapper.replacePromoterReportDailiesSD(promoterReportDailies);
|
|
promoterReportMapper.replacePromoterReportDailiesSD(promoterReportDailies);
|
|
|
- }catch (Exception e) {
|
|
|
|
|
- log.error("",e);
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("", e);
|
|
|
}
|
|
}
|
|
|
log.info("账户ID:{},广告日报(最细粒度)数据请求成功", advertiserId);
|
|
log.info("账户ID:{},广告日报(最细粒度)数据请求成功", advertiserId);
|
|
|
}
|
|
}
|
|
@@ -283,7 +283,7 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
|
|
|
promoterReportMapper.replacePromoterReportHour(hours);
|
|
promoterReportMapper.replacePromoterReportHour(hours);
|
|
|
try {
|
|
try {
|
|
|
promoterReportMapper.replacePromoterReportHourSD(hours);
|
|
promoterReportMapper.replacePromoterReportHourSD(hours);
|
|
|
- }catch (Exception e) {
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -320,7 +320,10 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Access-Token", accessToken);
|
|
headers.put("Access-Token", accessToken);
|
|
|
headers.put("Content-Type", "application/json");
|
|
headers.put("Content-Type", "application/json");
|
|
|
|
|
+ long urlStartTime = System.currentTimeMillis();
|
|
|
String s = HttpUtils.httpGet(url, paramsMap, headers);
|
|
String s = HttpUtils.httpGet(url, paramsMap, headers);
|
|
|
|
|
+ long urlEndTime = System.currentTimeMillis();
|
|
|
|
|
+ log.info("urlTime:{}", urlEndTime - urlStartTime);
|
|
|
JSONObject result = JSONObject.parseObject(s);
|
|
JSONObject result = JSONObject.parseObject(s);
|
|
|
if (Check.isNull(result)) {
|
|
if (Check.isNull(result)) {
|
|
|
log.info("账户id:{},广告日报(最细粒度)请求结果返回为空", advertiserId);
|
|
log.info("账户id:{},广告日报(最细粒度)请求结果返回为空", advertiserId);
|
|
@@ -371,25 +374,32 @@ public class BytedancePromoterReportServiceImpl implements IBytedancePromoterRep
|
|
|
errorInfo.setEndDate(endDate);
|
|
errorInfo.setEndDate(endDate);
|
|
|
errorInfo.setDataDimension("promoter");
|
|
errorInfo.setDataDimension("promoter");
|
|
|
errorInfo.setDataType("daily");
|
|
errorInfo.setDataType("daily");
|
|
|
|
|
+ errorInfo.setMsg(result.getString("message"));
|
|
|
promoterReportMapper.replaceErrorInfo(errorInfo);
|
|
promoterReportMapper.replaceErrorInfo(errorInfo);
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!Check.isNull(promoterReportDailies)) {
|
|
if (!Check.isNull(promoterReportDailies)) {
|
|
|
|
|
+ long tidbStartTime = System.currentTimeMillis();
|
|
|
promoterReportMapper.replacePromoterReportDailies(promoterReportDailies);
|
|
promoterReportMapper.replacePromoterReportDailies(promoterReportDailies);
|
|
|
|
|
+ long tidbEndTime = System.currentTimeMillis();
|
|
|
|
|
+ log.info("tidb入库时间:{}", tidbEndTime - tidbStartTime);
|
|
|
try {
|
|
try {
|
|
|
|
|
+ long selectDbStartTime = System.currentTimeMillis();
|
|
|
promoterReportMapper.replacePromoterReportDailiesSD(promoterReportDailies);
|
|
promoterReportMapper.replacePromoterReportDailiesSD(promoterReportDailies);
|
|
|
- }catch (Exception e) {
|
|
|
|
|
- log.error("",e);
|
|
|
|
|
|
|
+ long selectDbEnsTime = System.currentTimeMillis();
|
|
|
|
|
+ log.info("selectDb入库时间:{}", selectDbEnsTime - selectDbStartTime);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("", e);
|
|
|
}
|
|
}
|
|
|
log.info("账户ID:{},广告日报(最细粒度)数据请求成功", advertiserId);
|
|
log.info("账户ID:{},广告日报(最细粒度)数据请求成功", advertiserId);
|
|
|
}
|
|
}
|
|
|
if (promoterReportDailies.size() >= 100) {
|
|
if (promoterReportDailies.size() >= 100) {
|
|
|
- try {
|
|
|
|
|
|
|
+ /* try {
|
|
|
Thread.sleep(200L);
|
|
Thread.sleep(200L);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
getBytedancePromoterDaily(advertiserId, accessToken, startDate, endDate, page + 1, 1);
|
|
getBytedancePromoterDaily(advertiserId, accessToken, startDate, endDate, page + 1, 1);
|
|
|
} else {
|
|
} else {
|
|
|
log.info("账户ID:{},开始日期:{},结束日期:{},广告日报(最细粒度)数据请求成功", advertiserId, startDate, endDate);
|
|
log.info("账户ID:{},开始日期:{},结束日期:{},广告日报(最细粒度)数据请求成功", advertiserId, startDate, endDate);
|