|
|
@@ -53,7 +53,6 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
paramsMap.put("group_by", group_by);
|
|
|
JSONArray fieldsList = FieldsConfig.getCreativeHourFieldsList();
|
|
|
paramsMap.put("fields", fieldsList);
|
|
|
- Integer totalNumber = 0;
|
|
|
List<AdqCreativeReportHour> hourList = new ArrayList<>();
|
|
|
String s = HttpUtils.httpGet("https://api.e.qq.com/v3.0/hourly_reports/get", paramsMap, null);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
@@ -62,10 +61,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
if (code == 0) {
|
|
|
JSONObject data = jsonObject.getJSONObject("data");
|
|
|
if (!Check.isNull(data)) {
|
|
|
- JSONObject pageInfo = data.getJSONObject("page_info");
|
|
|
- if (!Check.isNull(pageInfo)) {
|
|
|
- totalNumber = pageInfo.getInteger("total_number");
|
|
|
- }
|
|
|
+
|
|
|
JSONArray list = data.getJSONArray("list");
|
|
|
if (!Check.isNull(list)) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
@@ -85,7 +81,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
if (!Check.isNull(hourList)) {
|
|
|
adqReportMapper.addsHourList(hourList);
|
|
|
}
|
|
|
- if (totalNumber >= 1000) {
|
|
|
+ if (hourList.size() >= 1000) {
|
|
|
getCreativeHourRetry(errorId, advertiserId, accessToken, startDate, endDate, page + 1, isSend);
|
|
|
} else {
|
|
|
log.error("请求创意时报完成,account_id:{},日期:{}", advertiserId, startDate);
|
|
|
@@ -120,7 +116,6 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
paramsMap.put("group_by", group_by);
|
|
|
JSONArray fieldsList = FieldsConfig.getCreativeDailyFieldsList();
|
|
|
paramsMap.put("fields", fieldsList);
|
|
|
- Integer totalNumber = 0;
|
|
|
List<AdqCreativeReportDaily> dailies = new ArrayList<>();
|
|
|
String s = HttpUtils.httpGet("https://api.e.qq.com/v3.0/daily_reports/get", paramsMap, null);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
@@ -129,10 +124,6 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
if (code == 0) {
|
|
|
JSONObject data = jsonObject.getJSONObject("data");
|
|
|
if (!Check.isNull(data)) {
|
|
|
- JSONObject pageInfo = data.getJSONObject("page_info");
|
|
|
- if (!Check.isNull(pageInfo)) {
|
|
|
- totalNumber = pageInfo.getInteger("total_number");
|
|
|
- }
|
|
|
JSONArray list = data.getJSONArray("list");
|
|
|
if (!Check.isNull(list)) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
@@ -152,7 +143,7 @@ public class AdqRetryReportServiceImpl implements IAdqRetryReportService {
|
|
|
if (!Check.isNull(dailies)) {
|
|
|
adqReportMapper.addsDaily(dailies);
|
|
|
}
|
|
|
- if (totalNumber >= 1000) {
|
|
|
+ if (dailies.size() >= 1000) {
|
|
|
getCreativeDailyRetry(errorId, advertiserId, accessToken, startDate, endDate, page + 1, isSend);
|
|
|
} else {
|
|
|
log.error("请求创意日报完成,account_id:{},日期:{}", advertiserId, startDate);
|