|
@@ -6,8 +6,8 @@ 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.graphql.service.IKuaishouWebInterfaceService;
|
|
|
-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.IEtlKuaishouAccountMaterialReportDailyService;
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
|
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
@@ -76,19 +76,23 @@ public class SampleTest {
|
|
|
private IBytedanceReportService bytedanceReportService;
|
|
|
@Autowired
|
|
|
private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
|
+ @Autowired
|
|
|
+ private IEtlKuaishouAccountMaterialReportDailyService materialReportDailyService;
|
|
|
|
|
|
@Test
|
|
|
public void loadKuaishouCookie() throws ParseException {
|
|
|
- CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
|
|
|
- advertiserDataService.getMaterialList(tokenByAccountId);
|
|
|
|
|
|
- CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
|
|
|
- advertiserDataService.getMaterialList(tokenByAccountId1);
|
|
|
+ Date startDate = new Date();
|
|
|
+ for (int i = 1; i <= 2; i++) {
|
|
|
+ if (i == 1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ System.err.println(DateUtils.addDay(new Date(), -i));
|
|
|
+ materialReportDailyService.etlKuaishouAccountMaterialReportInfo(DateUtils.formatDate(DateUtils.addDay(new Date(), -i)));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Test
|
|
|
public void deleteKuaishouComment() {
|
|
|
Long start = System.currentTimeMillis();
|
|
@@ -123,7 +127,6 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Test
|
|
|
public void etlBytedanceVideoInfo() {
|
|
|
String startDate = "2021-02-01";
|
|
@@ -147,7 +150,6 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Test
|
|
|
public void formatVideoReportData() {
|
|
|
for (int i = 1; i < 45; i++) {
|
|
@@ -192,35 +194,35 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void checkCostData(){
|
|
|
+ public void checkCostData() {
|
|
|
String date = "2021-06-11";
|
|
|
- for (int i=0;i<7;i++){
|
|
|
- String getDate = DateUtils.addDay(date,i);
|
|
|
+ for (int i = 0; i < 7; i++) {
|
|
|
+ String getDate = DateUtils.addDay(date, i);
|
|
|
//1:初始化
|
|
|
checkReportTaskInfoService.initTask(getDate);
|
|
|
//2: checkCost
|
|
|
- List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,getDate,0);
|
|
|
- if(null!=taskInfos&&!taskInfos.isEmpty()){
|
|
|
- for (BytedanceCheckReportTaskInfo task:taskInfos) {
|
|
|
+ List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, getDate, 0);
|
|
|
+ if (null != taskInfos && !taskInfos.isEmpty()) {
|
|
|
+ for (BytedanceCheckReportTaskInfo task : taskInfos) {
|
|
|
checkReportTaskInfoService.checkCost(task);
|
|
|
}
|
|
|
- log.info("{}:数据获取完成",getDate);
|
|
|
+ log.info("{}:数据获取完成", getDate);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void refreshReportData()throws Exception{
|
|
|
+ public void refreshReportData() throws Exception {
|
|
|
//1:查询异常任务数据
|
|
|
- List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,null,50001);
|
|
|
- if(null!=taskInfos&&!taskInfos.isEmpty()){
|
|
|
+ List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, null, 50001);
|
|
|
+ if (null != taskInfos && !taskInfos.isEmpty()) {
|
|
|
countDownLatch = new CountDownLatch(taskInfos.size());
|
|
|
taskInfos.forEach(taskInfo -> {
|
|
|
try {
|
|
|
checkReportTaskInfoService.reloadData(taskInfo);
|
|
|
checkReportTaskInfoService.checkCost(taskInfo);
|
|
|
- }catch (Exception e){
|
|
|
- }finally {
|
|
|
+ } catch (Exception e) {
|
|
|
+ } finally {
|
|
|
countDownLatch.countDown();
|
|
|
}
|
|
|
});
|
|
@@ -230,7 +232,7 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void testfreshBytedanceUrl(){
|
|
|
+ public void testfreshBytedanceUrl() {
|
|
|
etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
|
|
|
etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
|
|
|
etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
|