|
@@ -5,7 +5,9 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
+import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
|
|
|
import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAccountMaterialReportDaily;
|
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
@@ -70,7 +72,7 @@ public class SampleTest {
|
|
|
private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
|
|
|
@Autowired
|
|
|
private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
|
|
|
- static ExecutorService executorService = null;
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
|
static CountDownLatch countDownLatch = null;
|
|
|
@Autowired
|
|
|
private IBytedanceReportService bytedanceReportService;
|
|
@@ -230,9 +232,44 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void testfreshBytedanceUrl(){
|
|
|
- etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
|
|
|
- etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
|
|
|
- etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
|
|
|
+ public void loadBkData(){
|
|
|
+ Date startDate = DateUtils.addDay(new Date(),-60);
|
|
|
+ for(int i=0;i<=60;i++){
|
|
|
+ Date getDate = DateUtils.addDay(startDate,i);
|
|
|
+ bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IEtlKuaishouVideoInfoService etlKuaishouVideoInfo;
|
|
|
+ @Test
|
|
|
+ public void loadkuaishouVideoData(){
|
|
|
+ String startDate = "2021-05-07";
|
|
|
+ for(int i=0;i<=60;i++){
|
|
|
+ String getDate = DateUtils.formatDate(DateUtils.addDay(startDate,i));
|
|
|
+ etlKuaishouVideoInfo.etlKuaishouVideoInfo(getDate);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
|
|
|
+ @Test
|
|
|
+ public void loadKuaishouMatData() throws InterruptedException {
|
|
|
+ String startDate = "2021-06-18";
|
|
|
+ String endDate = "2021-06-24";
|
|
|
+ //1:查询当日数据
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
+ countDownLatch = new CountDownLatch(tokens.size());
|
|
|
+ tokens.forEach(token -> executorService.submit(() -> {
|
|
|
+ try {
|
|
|
+ kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "DAILY", 1);
|
|
|
+ }catch (Exception e){
|
|
|
+ }finally {
|
|
|
+ countDownLatch.countDown();
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ countDownLatch.await();
|
|
|
+ System.out.println("数据获取完成");
|
|
|
+ }
|
|
|
+
|
|
|
}
|