|
|
@@ -149,7 +149,7 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void queryAccountDailyFlows(String accessToken, Long advertiserId, String startDate, String endDate, int page, Integer isLog, Long errId, Integer isSend) {
|
|
|
+ public void queryAccountDailyFlows(String accessToken, Long advertiserId, String startDate, String endDate, int page, Integer isLog, Long errId, Integer isSend, int retry) {
|
|
|
String url = "https://ad.e.kuaishou.com/rest/openapi/v1/advertiser/fund/daily_flows";
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Content-Type", "application/json");
|
|
|
@@ -177,9 +177,17 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
|
|
|
Integer code = resultJson.getInteger("code");
|
|
|
String message = resultJson.getString("message");
|
|
|
if (null == code || code != 0) {
|
|
|
- log.error("获取快手广告账户流水信息异常:{},accountId:{} {}~{}", message, advertiserId,startDate,endDate);
|
|
|
- if (isLog != null && isLog == 1 && (null == code || code != 400002)) {
|
|
|
- errorLogService.addError(advertiserId, startDate, endDate, "daily_flows", "daily", message, 2);
|
|
|
+ if (retry <= 3) {
|
|
|
+ try {
|
|
|
+ Thread.sleep(800);
|
|
|
+ } catch (InterruptedException ignored) {
|
|
|
+ }
|
|
|
+ queryAccountDailyFlows(accessToken, advertiserId, startDate, endDate, page,isLog, errId, isSend, retry + 1);
|
|
|
+ }else {
|
|
|
+ log.error("获取快手广告账户流水信息异常:{},accountId:{} {}~{}", message, advertiserId,startDate,endDate);
|
|
|
+ if (isLog != null && isLog == 1 && (null == code || code != 400002)) {
|
|
|
+ errorLogService.addError(advertiserId, startDate, endDate, "daily_flows", "daily", message, 2);
|
|
|
+ }
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
@@ -203,7 +211,7 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
|
|
|
// accountReportMapper.replaceKuaiShouDailyFlows(addList);
|
|
|
//}
|
|
|
if (page < totalPage) {
|
|
|
- queryAccountDailyFlows(accessToken, advertiserId, startDate, endDate, page + 1,isLog, errId, isSend);
|
|
|
+ queryAccountDailyFlows(accessToken, advertiserId, startDate, endDate, page + 1,isLog, errId, isSend, 1);
|
|
|
} else {
|
|
|
if (errId != null) {
|
|
|
errorLogService.deleteInfoByErrorId(errId);
|