|
@@ -4,8 +4,12 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouOperationRecord;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouOperationRecordMapper;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.impl.KuaishouInterfaceServiceImpl2;
|
|
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.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
@@ -14,6 +18,8 @@ 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.IByteDanceAdvertiserDataService;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceCheckReportTaskInfo;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceCheckReportTaskInfo;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -27,9 +33,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -244,31 +248,6 @@ public class SampleTest {
|
|
bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(DateUtils.parseDate(getDate, "yyyy-MM-dd"));
|
|
bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(DateUtils.parseDate(getDate, "yyyy-MM-dd"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- @Test
|
|
|
|
- public void loadKuaiShouMatHourlyData() throws InterruptedException{
|
|
|
|
-// kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(7411077l, tokenService.getOauthTokenByAccountId("7411077").getAccessToken(), "2021-07-02", "2021-07-02", "HOURLY", 1);
|
|
|
|
-
|
|
|
|
- String startDate = "2021-07-19";
|
|
|
|
- String endDate = "2021-07-19";
|
|
|
|
- System.out.println(DateUtils.now());
|
|
|
|
- List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
|
- System.out.println(tokens.size());
|
|
|
|
- countDownLatch = new CountDownLatch(tokens.size());
|
|
|
|
- tokens.forEach(token -> executorService.submit(() -> {
|
|
|
|
- try {
|
|
|
|
- kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "HOURLY", 1);
|
|
|
|
- }catch (Exception e){
|
|
|
|
- }finally {
|
|
|
|
- countDownLatch.countDown();
|
|
|
|
- }
|
|
|
|
- }));
|
|
|
|
- countDownLatch.await();
|
|
|
|
- System.out.println("数据获取完成");
|
|
|
|
- System.out.println(DateUtils.now());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- IKuaishouInterfaceService2 kuaishouInterfaceService2;
|
|
|
|
@Resource
|
|
@Resource
|
|
private KuaishouOperationRecordMapper kuaishouOperationRecordMapper;
|
|
private KuaishouOperationRecordMapper kuaishouOperationRecordMapper;
|
|
|
|
|
|
@@ -323,7 +302,6 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
}finally {
|
|
}finally {
|
|
-
|
|
|
|
countDownLatch.countDown();
|
|
countDownLatch.countDown();
|
|
}}));
|
|
}}));
|
|
countDownLatch.await();
|
|
countDownLatch.await();
|