|
@@ -17,6 +17,7 @@ import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
|
import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
|
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
|
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -46,112 +47,11 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
|
|
|
@Slf4j
|
|
|
public class SampleTest {
|
|
|
@Autowired
|
|
|
- private ICtopOauthTokenService oauthTokenService;
|
|
|
- @Autowired
|
|
|
- private IReportService reportService;
|
|
|
- @Autowired
|
|
|
- private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
- @Autowired
|
|
|
private ICtopOauthTokenService tokenService;
|
|
|
@Autowired
|
|
|
- private IKuaiShouVideoGetService videoGetService;
|
|
|
- @Autowired
|
|
|
- private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
|
|
|
- @Autowired
|
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
|
@Autowired
|
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
|
- /* @Autowired
|
|
|
- private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
-
|
|
|
- */
|
|
|
- @Autowired
|
|
|
- private IKuaishouReportDailyGroupService reportDailyGroupService;
|
|
|
- @Autowired
|
|
|
- private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
|
|
|
- @Autowired
|
|
|
- private IKuaiShouGroupService kuaiShouGroupService;
|
|
|
- @Autowired
|
|
|
- private IKuaishouReportHourlyGroupService groupService;
|
|
|
- @Autowired
|
|
|
- private IKuaiShouReportDailyMaterialService reportDailyMaterialService;
|
|
|
- @Autowired
|
|
|
- private IKuaiShouActionBarTextService actionBarTextService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadBytedanceCreativeData() throws ParseException {
|
|
|
-
|
|
|
- actionBarTextService.getActionBarText();
|
|
|
-
|
|
|
- // groupService.getAdvertiserGroupReportHourly(9677284L, "b88c5f0d80c518fc80174a4dabbcd180", "2021-04-19", "2021-04-19");
|
|
|
- // reportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(9677284L, "b88c5f0d80c518fc80174a4dabbcd180", "2021-04-19", "2021-04-19", "DAILY", 1);
|
|
|
-
|
|
|
- /* Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
- Date getDate2 = DateUtils.addDay(new Date(), -2);
|
|
|
-
|
|
|
- CtopOauthToken token = new CtopOauthToken();
|
|
|
- token.setAccountId(9901975L);
|
|
|
- token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
|
|
|
-
|
|
|
- kuaiShouGroupService.getGroupListByPage("90f31a01c2137aa11c8686e86064b630",9845316L,null,1);*/
|
|
|
-
|
|
|
-// kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
|
|
|
-
|
|
|
- /* JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
|
|
|
- System.err.println(materialOverview);*/
|
|
|
-
|
|
|
- /* CtopOauthToken token = new CtopOauthToken();
|
|
|
- token.setAccountId(9901975L);
|
|
|
- token.setAccessToken("e609f9d3f56f3d6b4653f32c98a6d119");
|
|
|
- kuaiShouAccountMaterialOverviewService.cleanAccountMaterialOverview(9901975L, "2021-03-09");
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date parse = simpleDateFormat.parse("2021-03-09");
|
|
|
- reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse);*/
|
|
|
-
|
|
|
- // 1662234704806924
|
|
|
- /* CtopOauthToken token = new CtopOauthToken();
|
|
|
- token.setAccountId(9549277L);
|
|
|
- token.setAccessToken("bc5327c8f2bd8a67513e51148c9206c8");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date parse = simpleDateFormat.parse("2021-02-02");
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
|
|
|
-
|
|
|
- /* CtopOauthToken token = new CtopOauthToken();
|
|
|
- token.setAccountId(9767055L);
|
|
|
- token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
|
|
|
-
|
|
|
- kuaishouInterfaceService.getVideoList(token, null, null);
|
|
|
- kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9", 9767055L, "5208131540349742192");*/
|
|
|
-
|
|
|
- /* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
|
|
|
- advertiserDataService.getMaterialList(tokenByAccountId);*/
|
|
|
- /* getVideoByPage(token, "", 1);
|
|
|
- List<KuaiShouVideoGet> KuaiShouVideoGets = videoGetService.selectPhotoIdsByAccountId(9743746L);
|
|
|
- if (!Check.isNull(KuaiShouVideoGets)) {
|
|
|
- JSONArray dateList = new JSONArray();
|
|
|
- JSONArray photoIds = new JSONArray();
|
|
|
- Map<String, Object> statdateMap = new HashMap<>();
|
|
|
- int count = 0;
|
|
|
- for (KuaiShouVideoGet video : KuaiShouVideoGets) {
|
|
|
- count++;
|
|
|
- if (count < 10) {
|
|
|
- photoIds.add(video.getPhotoId());
|
|
|
- statdateMap.put(video.getPhotoId(), video.getStatDate());
|
|
|
- } else {
|
|
|
- photoIds.add(video.getPhotoId());
|
|
|
- statdateMap.put(video.getPhotoId(), video.getStatDate());
|
|
|
- dateList.add(photoIds);
|
|
|
- photoIds = new JSONArray();
|
|
|
- count = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- dateList.add(photoIds);
|
|
|
- kuaishouVideoRelateCreativesService.videoRelateCreatives(9743746L, dateList, statdateMap);
|
|
|
- }*/
|
|
|
- }
|
|
|
|
|
|
@Test
|
|
|
public void loadKuaishouCookie() {
|
|
@@ -167,15 +67,6 @@ public class SampleTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void loadKuaishouCamgaignData() {
|
|
|
- Date getDate = DateUtils.parseDate("2021-03-24", "yyyy-MM-dd");
|
|
|
- List<UserAllocation> list = allocationService.getByParams(50L, null, 0);
|
|
|
- list.forEach(userAllocation -> {
|
|
|
- CtopOauthToken token = tokenService.getOauthTokenByAccountId(userAllocation.getAccountId().toString());
|
|
|
- kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
static ExecutorService executorService = null;
|
|
|
static CountDownLatch countDownLatch = null;
|
|
@@ -205,150 +96,6 @@ public class SampleTest {
|
|
|
log.info("快手删评论所用时长:{}毫秒", end - start);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IUserAllocationService allocationService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void testLoadBytedanceData() {
|
|
|
- List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
|
- if (null != allocations && !allocations.isEmpty()) {
|
|
|
- for (UserAllocation allocation : allocations) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
- String startDate = "2020-11-10";
|
|
|
- String endDate = "2020-11-10";
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate, "yyyy-MM-dd"), DateUtils.parseDate(endDate, "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.println("任务结束");
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadKuaishouPlanData() {
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
- //1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate));
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IBytedanceFundDailyService bytedanceFundDailyService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadFoudData() {
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
- System.out.println(token.getAccountId() + "############################");
|
|
|
- for (int i = 20; i < 130; i++) {
|
|
|
- Date date = DateUtils.addDay(new Date(), -i);
|
|
|
- bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date), 1);
|
|
|
- System.out.println(i + "############################");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IKuaiShouHistoryReportTaskService reportTaskService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 测试获取快手图片消耗数据任务
|
|
|
- */
|
|
|
- @Test
|
|
|
- public void loadKuaishouImageTask() {
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- for (int i = 1; i < 130; i++) {
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
- String getDateStr = DateUtils.formatDate(getDate);
|
|
|
- tokens.forEach(token -> reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IKuaiShouDailyReportTaskService dailyReportTaskService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 测试获取快手图片消耗数据入库
|
|
|
- */
|
|
|
- @Test
|
|
|
- public void loadKuaishouImageTaskFile() {
|
|
|
- String nowDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- for (int i = 1; i < 15; i++) {
|
|
|
- String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
|
|
|
- tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
|
|
|
- }
|
|
|
- // 查询快手token
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void testLoadBytedanceImageData() {
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
- countDownLatch = new CountDownLatch(tokens.size());
|
|
|
- executorService = Executors.newFixedThreadPool(8);
|
|
|
- tokens.forEach(token -> executorService.submit(() -> {
|
|
|
- try {
|
|
|
- advertiserDataService.getMaterialList(token);
|
|
|
- } catch (Exception e) {
|
|
|
- } finally {
|
|
|
- countDownLatch.countDown();
|
|
|
- }
|
|
|
- }));
|
|
|
- try {
|
|
|
- countDownLatch.await();
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- System.out.println("素材数据获取完成");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void testData() {
|
|
|
- Date date = new Date();
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
- executorService = Executors.newFixedThreadPool(10);
|
|
|
- countDownLatch = new CountDownLatch(tokens.size());
|
|
|
- tokens.forEach(token -> executorService.submit(() -> {
|
|
|
- try {
|
|
|
- reportService.getAdvertiserPlanRuleData(token, date, date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- } finally {
|
|
|
- countDownLatch.countDown();
|
|
|
- }
|
|
|
- }));
|
|
|
- try {
|
|
|
- countDownLatch.await();
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadKuaishouAgentData() {
|
|
|
- kuaishouReportDailyAgentService.loginAgent();
|
|
|
- try {
|
|
|
- for (int i = 1; i < 30; i++) {
|
|
|
- kuaishouReportDailyAgentService.getAccount(i);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadKuaishouData() {
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
- //1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
- kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Autowired
|
|
|
private IBytedanceReportService bytedanceReportService;
|
|
|
|
|
@@ -362,50 +109,6 @@ public class SampleTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void loadKuaishouHourlyReportData() {
|
|
|
- Date getDate = new Date();
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
|
|
|
- String hour = simpleDateFormat.format(getDate);
|
|
|
- if ("00".equals(hour)) {
|
|
|
- getDate = DateUtils.addDay(getDate, -1);
|
|
|
- }
|
|
|
- //1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
- Date finalGetDate = getDate;
|
|
|
- tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate));
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadKuaishouGroupData() throws ParseException {
|
|
|
- Date endDate = new Date();
|
|
|
- String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
|
|
|
- SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date startDate = sim.parse(anotherDay);
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(7087890L);
|
|
|
- kuaishouInterfaceService.getGroupList(token, startDate, endDate);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadAccountData() {
|
|
|
-// List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
|
|
|
-// for (UserAllocation allocation:allocations) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
|
|
|
- for (int i = 92; i < 100; i++) {
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
-// }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IWechatCheckinDataService wechatCheckinDataService;
|
|
|
- @Autowired
|
|
|
- private IWechatUserListService wechatUserInfoService;
|
|
|
@Autowired
|
|
|
private IWechatNoListService wechatNoListService;
|
|
|
|
|
@@ -423,20 +126,12 @@ public class SampleTest {
|
|
|
wechatNoListService.getNoDateByNo("2021-03-01 00:00:00", "2021-03-31 23:59:59", "1");
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- private IKuaiShouCommentService kuaiShouCommentService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void kuaishouDeleteComment() {
|
|
|
- kuaiShouCommentService.shieldComment(8018853L);
|
|
|
- }
|
|
|
|
|
|
@Autowired
|
|
|
private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
|
|
|
|
@Test
|
|
|
- synchronized public void formatVideoReportData() {
|
|
|
-
|
|
|
+ public void formatVideoReportData() {
|
|
|
for (int i = 1; i < 45; i++) {
|
|
|
Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
String date = DateUtils.formatDate(getDate);
|
|
@@ -454,25 +149,6 @@ public class SampleTest {
|
|
|
IKuaishouReportDailyImageService kuaishouReportDailyImageService;
|
|
|
@Autowired
|
|
|
IRuleByteDanceAccountService ruleByteDanceAccountService;
|
|
|
- @Autowired
|
|
|
- private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
|
|
|
- @Autowired
|
|
|
- private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void execute() {
|
|
|
- List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
|
|
|
- for (UserAllocation allocation : allocations) {
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-10-01", "2020-10-31");
|
|
|
- reportTaskRecordService.save(reportTaskRecord1);
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-11-01", "2020-11-30");
|
|
|
- reportTaskRecordService.save(reportTaskRecord2);
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-12-01", "2020-12-31");
|
|
|
- reportTaskRecordService.save(reportTaskRecord3);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Test
|
|
|
public void loadBDAccoutData() {
|
|
|
Date startDate = DateUtils.addDay(new Date(), -2000);
|
|
@@ -481,82 +157,6 @@ public class SampleTest {
|
|
|
bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void etlKuaishouData() {
|
|
|
- String dateString = "2021-01-05";
|
|
|
- Date startDate = DateUtils.parseDate(dateString, "yyyy-MM-dd");
|
|
|
- for (int i = 0; i <= 10; i++) {
|
|
|
- Date getDate = DateUtils.addDay(startDate, i);
|
|
|
- kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
|
|
|
- bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadBytedanceVideo() {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(1673731601820686L);
|
|
|
- for (int i = 15; i < 60; i++) {
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.addDay(new Date(), -i), DateUtils.addDay(new Date(), -i), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void loadKuaishouVideo() {
|
|
|
- Date date = new Date();
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(9556344L);
|
|
|
-// kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, new Date(), new Date(), null, null);
|
|
|
- kuaishouInterfaceService.getVideoList(token, DateUtils.formatDate(DateUtils.addDay(date, -5)), DateUtils.formatDate(date));
|
|
|
- // 获取图片信息数据
|
|
|
-// kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Test
|
|
|
- public void testLoadBytedanceDataV2() {
|
|
|
- String accountIds = "1675440464386062";
|
|
|
- String[] accountArray = accountIds.split(",");
|
|
|
- for (int i = 0; i < accountArray.length; i++) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[i]));
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @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
|
|
|
- private IEtlKuaishouAccountMaterialReportDailyService dailyService;
|
|
|
-
|
|
|
- @Test
|
|
|
- public void etlKuaishouInfo() {
|
|
|
- Date startDate = DateUtils.parseDate("2020-05-03", "yyyy-MM-dd");
|
|
|
- for (int i = 0; i < 365; i++) {
|
|
|
- dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IEtlKuaishouVideoInfoService videoEtlInfoService;
|
|
|
@Resource
|
|
|
private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
|
|
|
|
|
@@ -564,6 +164,14 @@ public class SampleTest {
|
|
|
public void etlKuaishouVideoInfo() {
|
|
|
etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
|
|
|
}
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IByteDanceCampaignService campaignService;
|
|
|
+ @Test
|
|
|
+ public void testLoadBytedanceCampaign(){
|
|
|
+ List<CtopOauthToken>tokens = tokenService.selectToutiaoToken();
|
|
|
+ for(CtopOauthToken token :tokens){
|
|
|
+ campaignService.getAdvertiserCampaign(token, null, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|