|
@@ -32,7 +32,7 @@ public class BytedanceMaterialReportServiceImpl implements IBytedanceMaterialRep
|
|
|
private RedisTemplate redisTemplate_db2;
|
|
private RedisTemplate redisTemplate_db2;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void getBytedanceMaterialDailyReport(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Long errorId, Integer isLog, Integer isSend) {
|
|
|
|
|
|
|
+ public void getBytedanceMaterialDailyReport(Long advertiserId, String accessToken, String startDate, String endDate, Integer page, Long errorId, Integer isLog, Integer isSend, int retry) {
|
|
|
try {
|
|
try {
|
|
|
String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
|
|
String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/get/";
|
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
@@ -93,6 +93,14 @@ public class BytedanceMaterialReportServiceImpl implements IBytedanceMaterialRep
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if (retry <= 5) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Thread.sleep(800);
|
|
|
|
|
+ } catch (Exception ignored) {
|
|
|
|
|
+ }
|
|
|
|
|
+ getBytedanceMaterialDailyReport(advertiserId, accessToken, startDate, endDate, page, errorId, isLog, isSend, retry + 1);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
log.info("账户id:{},日期:{}素材日报请求结果失败,返回数据:{}", advertiserId, startDate, result);
|
|
log.info("账户id:{},日期:{}素材日报请求结果失败,返回数据:{}", advertiserId, startDate, result);
|
|
|
if (isLog == 1) {
|
|
if (isLog == 1) {
|
|
|
BytedanceErrorLog errorInfo = new BytedanceErrorLog();
|
|
BytedanceErrorLog errorInfo = new BytedanceErrorLog();
|
|
@@ -112,7 +120,7 @@ public class BytedanceMaterialReportServiceImpl implements IBytedanceMaterialRep
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (page < totalPage) {
|
|
if (page < totalPage) {
|
|
|
- getBytedanceMaterialDailyReport(advertiserId, accessToken, startDate, endDate, page + 1, errorId, isLog, isSend);
|
|
|
|
|
|
|
+ getBytedanceMaterialDailyReport(advertiserId, accessToken, startDate, endDate, page + 1, errorId, isLog, isSend, 1);
|
|
|
} else {
|
|
} else {
|
|
|
log.info("账户ID:{}, 开始日期:{}, 结束日期:{}, totalPage:{}, 素材日报数据请求成功", advertiserId, startDate, endDate, totalPage);
|
|
log.info("账户ID:{}, 开始日期:{}, 结束日期:{}, totalPage:{}, 素材日报数据请求成功", advertiserId, startDate, endDate, totalPage);
|
|
|
if (errorId != null) {
|
|
if (errorId != null) {
|