|
@@ -1,6 +1,8 @@
|
|
package cn.com.ctop.job.bytedance.handler;
|
|
package cn.com.ctop.job.bytedance.handler;
|
|
|
|
|
|
|
|
+import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
|
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoEtlInfoService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoEtlInfoService;
|
|
@@ -13,10 +15,15 @@ import org.springframework.stereotype.Component;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
@Component
|
|
@Component
|
|
public class BytedanceEtlVideoJob {
|
|
public class BytedanceEtlVideoJob {
|
|
|
|
|
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
|
+
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
|
|
private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
|
|
|
|
|
|
@@ -26,6 +33,9 @@ public class BytedanceEtlVideoJob {
|
|
@Autowired
|
|
@Autowired
|
|
private IUserAllocationService userAllocationService;
|
|
private IUserAllocationService userAllocationService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICtopOauthTokenService tokenService;
|
|
|
|
+
|
|
|
|
|
|
@XxlJob("bytedanceEtlVideoJob")
|
|
@XxlJob("bytedanceEtlVideoJob")
|
|
public void execute() throws Exception {
|
|
public void execute() throws Exception {
|
|
@@ -97,6 +107,10 @@ public class BytedanceEtlVideoJob {
|
|
*/
|
|
*/
|
|
@XxlJob("formatBytedance")
|
|
@XxlJob("formatBytedance")
|
|
public void etlBytedanceVideoJob() throws Exception {
|
|
public void etlBytedanceVideoJob() throws Exception {
|
|
- etlBytedanceReportVideoDailyService.etlBytedanceVideo();
|
|
|
|
|
|
+ //查询所有账户-头条
|
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
|
+ tokens.forEach(token -> executorService.submit(() -> {
|
|
|
|
+ etlBytedanceReportVideoDailyService.etlBytedanceVideo(token.getAccountId());
|
|
|
|
+ }));
|
|
}
|
|
}
|
|
}
|
|
}
|