|
@@ -9,13 +9,14 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
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;
|
|
-import cn.com.ctop.oa.modules.service.IAppchatCreateService;
|
|
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
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.material.service.IByteDanceCampaignService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
|
|
|
|
+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.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;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
@@ -41,19 +42,45 @@ import java.util.concurrent.Executors;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class SampleTest {
|
|
public class SampleTest {
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IBytedanceVideoReportService bytedanceVideoReportService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IETLReportBytedanceVideoService ietlReportBytedanceVideoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IKuaishouReportDailyImageService kuaishouReportDailyImageService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IRuleByteDanceAccountService ruleByteDanceAccountService;
|
|
|
|
+ @Autowired
|
|
private ICtopOauthTokenService tokenService;
|
|
private ICtopOauthTokenService tokenService;
|
|
@Autowired
|
|
@Autowired
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IKuaishouInterfaceService kuaishouInterfaceService;
|
|
|
|
|
|
+ private IWechatUserListService wechatUserInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
- private RedisUtil redisUtil;
|
|
|
|
|
|
+ private IByteDanceAdvertiserDataService advertiserDataService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IAppchatCreateService appchatCreateService;
|
|
|
|
|
|
+ private IWechatNoListService wechatNoListService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IWechatUserListService wechatUserInfoService;
|
|
|
|
|
|
+ private IETLReportBytedanceVideoService bytedanceVideoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
|
|
+ @Resource
|
|
|
|
+ private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IByteDanceCampaignService campaignService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IReportService reportService;
|
|
|
|
+ @Resource
|
|
|
|
+ private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
|
|
|
|
+ // @Autowired
|
|
|
|
+ // private IAppchatCreateService appchatCreateService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
@@ -72,6 +99,7 @@ public class SampleTest {
|
|
|
|
|
|
// appchatCreateService.createAppChat(null, null, null);
|
|
// appchatCreateService.createAppChat(null, null, null);
|
|
// appchatCreateService.getChatInfo(null);
|
|
// appchatCreateService.getChatInfo(null);
|
|
|
|
+// appchatCreateService.getChatInfo(null);
|
|
/* redisUtil.set("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1","hahahaha",5);
|
|
/* redisUtil.set("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1","hahahaha",5);
|
|
Object o = redisUtil.get("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1");
|
|
Object o = redisUtil.get("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1");
|
|
System.err.println(o);*/
|
|
System.err.println(o);*/
|
|
@@ -112,11 +140,11 @@ public class SampleTest {
|
|
Date parse = dateFormat.parse("2021-04-02");
|
|
Date parse = dateFormat.parse("2021-04-02");
|
|
kuaishouInterfaceService.getAdvertiserReportDaily(tokenByAccountId, parse, parse, null);*/
|
|
kuaishouInterfaceService.getAdvertiserReportDaily(tokenByAccountId, parse, parse, null);*/
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
static ExecutorService executorService = null;
|
|
static ExecutorService executorService = null;
|
|
static CountDownLatch countDownLatch = null;
|
|
static CountDownLatch countDownLatch = null;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void deleteKuaishouComment() {
|
|
public void deleteKuaishouComment() {
|
|
Long start = System.currentTimeMillis();
|
|
Long start = System.currentTimeMillis();
|
|
@@ -143,11 +171,6 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IBytedanceReportService bytedanceReportService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBytedanceVideoReportData() {
|
|
public void loadBytedanceVideoReportData() {
|
|
@@ -155,10 +178,7 @@ public class SampleTest {
|
|
advertiserDataService.getMaterialList(token);
|
|
advertiserDataService.getMaterialList(token);
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IWechatNoListService wechatNoListService;
|
|
|
|
- @Autowired
|
|
|
|
- private IETLReportBytedanceVideoService bytedanceVideoService;
|
|
|
|
|
|
+
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void etlBytedanceVideoInfo() {
|
|
public void etlBytedanceVideoInfo() {
|
|
@@ -183,8 +203,6 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void formatVideoReportData() {
|
|
public void formatVideoReportData() {
|
|
@@ -195,17 +213,6 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
|
|
|
|
- @Autowired
|
|
|
|
- IBytedanceVideoReportService bytedanceVideoReportService;
|
|
|
|
- @Autowired
|
|
|
|
- IETLReportBytedanceVideoService ietlReportBytedanceVideoService;
|
|
|
|
- @Autowired
|
|
|
|
- IKuaishouReportDailyImageService kuaishouReportDailyImageService;
|
|
|
|
- @Autowired
|
|
|
|
- IRuleByteDanceAccountService ruleByteDanceAccountService;
|
|
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBDAccoutData() {
|
|
public void loadBDAccoutData() {
|
|
Date startDate = DateUtils.addDay(new Date(), -2000);
|
|
Date startDate = DateUtils.addDay(new Date(), -2000);
|
|
@@ -215,8 +222,6 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Resource
|
|
|
|
- private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void etlKuaishouVideoInfo() {
|
|
public void etlKuaishouVideoInfo() {
|
|
@@ -224,27 +229,20 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IByteDanceCampaignService campaignService;
|
|
|
|
|
|
+ private IBytedanceReportService bytedanceReportService;
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testLoadBytedanceCampaign() {
|
|
public void testLoadBytedanceCampaign() {
|
|
- List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
|
- campaignService.getAdvertiserCampaign(token, null, null);
|
|
|
|
- }
|
|
|
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(1681669009084429L);
|
|
|
|
+ bytedanceReportService.bytedanceMaterialReport(token, "2021-05-01", "2021-05-06");
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void etlBytedanceVideoReportInfo() throws Exception {
|
|
public void etlBytedanceVideoReportInfo() throws Exception {
|
|
etlBytedanceReportVideoDailyService.etlBytedanceVideo();
|
|
etlBytedanceReportVideoDailyService.etlBytedanceVideo();
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IReportService reportService;
|
|
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
public void loadBytedanceAccountReport() {
|
|
public void loadBytedanceAccountReport() {
|
|
/**
|
|
/**
|
|
@@ -253,20 +251,56 @@ public class SampleTest {
|
|
* 1696734332089352
|
|
* 1696734332089352
|
|
* 1696734333251598
|
|
* 1696734333251598
|
|
*/
|
|
*/
|
|
- CtopOauthToken token1 = tokenService.getTokenByAccountId(1692555408132110L);
|
|
|
|
- reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
- CtopOauthToken token2 = tokenService.getTokenByAccountId(1692555631713287L);
|
|
|
|
- reportService.getAdvertiserReport(token2, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
- CtopOauthToken token3 = tokenService.getTokenByAccountId(1696734332089352L);
|
|
|
|
- reportService.getAdvertiserReport(token3, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
- CtopOauthToken token4 = tokenService.getTokenByAccountId(1696734333251598L);
|
|
|
|
- reportService.getAdvertiserReport(token4, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
-
|
|
|
|
- CtopOauthToken token5 = tokenService.getTokenByAccountId(10129666L);
|
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token5, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
|
|
|
|
- CtopOauthToken token6 = tokenService.getTokenByAccountId(10097961L);
|
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token6, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
|
|
|
|
- CtopOauthToken token7 = tokenService.getTokenByAccountId(10098039L);
|
|
|
|
- kuaishouInterfaceService.getAdvertiserReportDaily(token7, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
|
|
|
|
|
|
+ CtopOauthToken token1 = tokenService.getTokenByAccountId(1693648201498637L);
|
|
|
|
+ reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-04-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-04-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void checkCostData(){
|
|
|
|
+ String date = "2021-06-01";
|
|
|
|
+ for (int i=0;i<14;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) {
|
|
|
|
+ checkReportTaskInfoService.checkCost(task);
|
|
|
|
+ }
|
|
|
|
+ log.info("{}:数据获取完成",getDate);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// 3:重复异常数据
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void refreshReportData()throws Exception{
|
|
|
|
+ //1:查询异常任务数据
|
|
|
|
+ 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 {
|
|
|
|
+ countDownLatch.countDown();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ countDownLatch.await();
|
|
|
|
+ XxlJobHelper.log("{}数据更新完成");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testfreshBytedanceUrl(){
|
|
|
|
+ etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
|
|
|
|
+ etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
|
|
|
|
+ etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
|
|
}
|
|
}
|