|
@@ -2,7 +2,10 @@ package cn.com.ctop.job.bytedance.handler;
|
|
|
|
|
|
import cn.com.ctop.job.bytedance.data.constant.CtopAdConstant;
|
|
|
import cn.com.ctop.job.bytedance.data.entity.OauthToken;
|
|
|
-import cn.com.ctop.job.bytedance.data.service.*;
|
|
|
+import cn.com.ctop.job.bytedance.data.service.IBytedanceCampaignGetService;
|
|
|
+import cn.com.ctop.job.bytedance.data.service.IBytedanceCampaignReportDailyService;
|
|
|
+import cn.com.ctop.job.bytedance.data.service.IBytedanceCampaignReportHourlyService;
|
|
|
+import cn.com.ctop.job.bytedance.data.service.IOauthTokenService;
|
|
|
import cn.com.ctop.job.bytedance.data.utils.Check;
|
|
|
import cn.com.ctop.job.bytedance.data.utils.DateUtils;
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
@@ -35,6 +38,7 @@ public class BytedanceCampaignLoadJob {
|
|
|
IBytedanceCampaignReportDailyService campaignReportDailyService;
|
|
|
@Autowired
|
|
|
IBytedanceCampaignReportHourlyService campaignReportHourlyService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取广告计划列表信息
|
|
|
*
|
|
@@ -56,7 +60,7 @@ public class BytedanceCampaignLoadJob {
|
|
|
OauthToken oauthToken = new OauthToken();
|
|
|
oauthToken.setAccessToken(token);
|
|
|
oauthToken.setAccountId(Long.parseLong(param));
|
|
|
- campaignDataService.getCampaignData(oauthToken,1,1000);
|
|
|
+ campaignDataService.getCampaignData(oauthToken, 1, 1000);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -81,11 +85,13 @@ public class BytedanceCampaignLoadJob {
|
|
|
oauthToken.setAccountId(Long.parseLong(param));
|
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
String yesterda = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
+ String yesterda2 = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
|
|
|
dailyExecutorService.submit(
|
|
|
new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- campaignReportDailyService.getCampaignDailyReport(oauthToken, yesterda, yesterda, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY,1,1000);
|
|
|
+ campaignReportDailyService.getCampaignDailyReport(oauthToken, yesterda, yesterda, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY, 1, 1000);
|
|
|
+ campaignReportDailyService.getCampaignDailyReport(oauthToken, yesterda2, yesterda2, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY, 1, 1000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -122,9 +128,9 @@ public class BytedanceCampaignLoadJob {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if ("00".equals(hour)) {
|
|
|
- campaignReportHourlyService.getCampaignHourlyReport(oauthToken, yesterda, yesterda, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY,1,1000);
|
|
|
+ campaignReportHourlyService.getCampaignHourlyReport(oauthToken, yesterda, yesterda, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY, 1, 1000);
|
|
|
}
|
|
|
- campaignReportHourlyService.getCampaignHourlyReport(oauthToken, nowDate, nowDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY,1,1000);
|
|
|
+ campaignReportHourlyService.getCampaignHourlyReport(oauthToken, nowDate, nowDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY, 1, 1000);
|
|
|
}
|
|
|
});
|
|
|
}
|