|
@@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
/**
|
|
|
* 获取广告组分天报表
|
|
@@ -25,6 +27,7 @@ public class KuaishouDailyGroupReportLoadJob implements Job {
|
|
|
private ICtopOauthTokenService tokenService;
|
|
|
@Autowired
|
|
|
private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
+ static ExecutorService executorService = null;
|
|
|
|
|
|
@Override
|
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
@@ -37,17 +40,20 @@ public class KuaishouDailyGroupReportLoadJob implements Job {
|
|
|
//1:查询当日数据
|
|
|
List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
|
|
|
if (null == tokens || tokens.size() <= 0) {
|
|
|
- log.info("定时获取头条数据异常:为获取到可用的token");
|
|
|
+ log.info("定时获取快手数据异常:未获取到可用的token");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- log.info("快手物料数据同步完成");
|
|
|
-
|
|
|
+ log.info("快手广告租报表同步完成");
|
|
|
+ executorService = Executors.newFixedThreadPool(3);
|
|
|
tokens.forEach(token -> {
|
|
|
-
|
|
|
- //获取广告组信息数据
|
|
|
- kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
|
|
|
-
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //获取广告组信息数据
|
|
|
+ kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|