|
@@ -13,6 +13,7 @@ import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IRuleKuaiShouPlanService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IRuleKuaiShouPlanService;
|
|
import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
|
|
import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
|
|
@@ -23,6 +24,7 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
@@ -620,10 +622,10 @@ public class SampleTest {
|
|
@Test
|
|
@Test
|
|
public void etlBytedanceVideoReport() {
|
|
public void etlBytedanceVideoReport() {
|
|
|
|
|
|
-// for (int i = 1; i <= 62; i++) {
|
|
|
|
-// etlBytedanceVideo(DateUtils.formatDate(DateUtils.addDay(new Date(), -i)));
|
|
|
|
-// }
|
|
|
|
- etlBytedanceVideo("2021-02-03");
|
|
|
|
|
|
+ for (int i = 27; i <= 35; i++) {
|
|
|
|
+ etlBytedanceVideo(DateUtils.formatDate(DateUtils.addDay(new Date(), -i)));
|
|
|
|
+ }
|
|
|
|
+ //etlBytedanceVideo("2021-02-03");
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -633,7 +635,9 @@ public class SampleTest {
|
|
countDownLatch = new CountDownLatch(tokens.size());
|
|
countDownLatch = new CountDownLatch(tokens.size());
|
|
tokens.forEach(token -> executorService.submit(() -> {
|
|
tokens.forEach(token -> executorService.submit(() -> {
|
|
try {
|
|
try {
|
|
- bytedanceVideoReportService.pullVideoReport(token, statDate, statDate, 1);
|
|
|
|
|
|
+ Long[] materials={6904990807503634445L,6904990807503634445L};
|
|
|
|
+ bytedanceVideoReportService.pullVideoReportByMaterialId(token, statDate, statDate, materials,1);
|
|
|
|
+ //bytedanceVideoReportService.pullVideoReport(token, statDate, statDate, 1);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
|
} finally {
|
|
} finally {
|
|
@@ -660,11 +664,48 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void etlBytedanceVideoReportClean1() {
|
|
public void etlBytedanceVideoReportClean1() {
|
|
- //executorService = Executors.newFixedThreadPool(31);
|
|
|
|
- //countDownLatch = new CountDownLatch(31);
|
|
|
|
|
|
+
|
|
for (int i = 3; i <= 31; i++) {
|
|
for (int i = 3; i <= 31; i++) {
|
|
String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
|
|
String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
|
|
ietlReportBytedanceVideoService.cleanETL(statDate);
|
|
ietlReportBytedanceVideoService.cleanETL(statDate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ IKuaishouReportDailyImageService kuaishouReportDailyImageService;
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void loadKuaiShouImage() {
|
|
|
|
+ List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
|
|
|
|
+ executorService = Executors.newFixedThreadPool(22);
|
|
|
|
+ countDownLatch = new CountDownLatch(tokens.size());
|
|
|
|
+ tokens.forEach(token -> executorService.submit(() -> {
|
|
|
|
+ try {
|
|
|
|
+ kuaishouReportDailyImageService.getMaterialImageReport(token.getAccountId(),token.getAccessToken(), "2021-01-17", "2021-01-31", 1);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+
|
|
|
|
+ } finally {
|
|
|
|
+ countDownLatch.countDown();
|
|
|
|
+ }
|
|
|
|
+ }));
|
|
|
|
+ try {
|
|
|
|
+ countDownLatch.await();
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ IBytedanceMaterialReportAsync bytedanceMaterialReportAsync;
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testAsyncMaterialReport() {
|
|
|
|
+ List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
|
|
|
|
+ tokens.forEach(it->{
|
|
|
|
+ JSONObject createResult = bytedanceMaterialReportAsync.asyncTaskCreate(it, "2021-02-23", "2021-02-23");
|
|
|
|
+ System.out.println(createResult.toJSONString());
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|