|
@@ -48,7 +48,7 @@ public class AdqAdIncomeServiceImpl implements IAdqAdIncomeService {
|
|
|
log.error("微小广告细分数据拉取获取token为空 [{}] {}~{} {}", appId, startDt, endDt, appletId);
|
|
log.error("微小广告细分数据拉取获取token为空 [{}] {}~{} {}", appId, startDt, endDt, appletId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- int pageSize = 1000;
|
|
|
|
|
|
|
+ int pageSize = 90;
|
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
Map<String, Object> paramsMap = new HashMap<>();
|
|
|
paramsMap.put("access_token", tokenObj.toString());
|
|
paramsMap.put("access_token", tokenObj.toString());
|
|
|
paramsMap.put("action", "publisher_adunit_general");
|
|
paramsMap.put("action", "publisher_adunit_general");
|
|
@@ -59,7 +59,7 @@ public class AdqAdIncomeServiceImpl implements IAdqAdIncomeService {
|
|
|
String s = HttpUtils.httpGet(url, paramsMap, null);
|
|
String s = HttpUtils.httpGet(url, paramsMap, null);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(s);
|
|
JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
List<AdqPublisherAdunitGeneral> reports = new ArrayList<>();
|
|
List<AdqPublisherAdunitGeneral> reports = new ArrayList<>();
|
|
|
- boolean hasMore = false;
|
|
|
|
|
|
|
+ int totalPage = 1;
|
|
|
if (!Check.isNull(jsonObject)) {
|
|
if (!Check.isNull(jsonObject)) {
|
|
|
Integer code = jsonObject.getInteger("ret");
|
|
Integer code = jsonObject.getInteger("ret");
|
|
|
if (code == 2009) {
|
|
if (code == 2009) {
|
|
@@ -67,8 +67,9 @@ public class AdqAdIncomeServiceImpl implements IAdqAdIncomeService {
|
|
|
}
|
|
}
|
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
|
JSONArray list = jsonObject.getJSONArray("list");
|
|
JSONArray list = jsonObject.getJSONArray("list");
|
|
|
|
|
+ Integer totalNum = jsonObject.getInteger("total_num");
|
|
|
|
|
+ totalPage = (int) Math.ceil(totalNum * 1.0 / page);
|
|
|
if (!Check.isNull(list)) {
|
|
if (!Check.isNull(list)) {
|
|
|
- hasMore = list.size() == pageSize;
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
JSONObject dataJson = list.getJSONObject(i);
|
|
JSONObject dataJson = list.getJSONObject(i);
|
|
|
JSONObject statItem = dataJson.getJSONObject("stat_item");
|
|
JSONObject statItem = dataJson.getJSONObject("stat_item");
|
|
@@ -96,7 +97,7 @@ public class AdqAdIncomeServiceImpl implements IAdqAdIncomeService {
|
|
|
adqAdIncomeMapper.insertAdqAdIncome(reports);
|
|
adqAdIncomeMapper.insertAdqAdIncome(reports);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (hasMore) {
|
|
|
|
|
|
|
+ if (totalPage > page) {
|
|
|
getAdqAdIncome(startDt, endDt, appId, appletId, page + 1, isLog, errId, isSend);
|
|
getAdqAdIncome(startDt, endDt, appId, appletId, page + 1, isLog, errId, isSend);
|
|
|
} else {
|
|
} else {
|
|
|
log.info("微小广告细分数据拉取完成,app_id:{} {}~{}。", appId, startDt, endDt);
|
|
log.info("微小广告细分数据拉取完成,app_id:{} {}~{}。", appId, startDt, endDt);
|