|
@@ -46,23 +46,20 @@ public class SampleTest {
|
|
|
@Test
|
|
|
public void getBytedancePlanReport(){
|
|
|
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -4);
|
|
|
- //1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
- log.info("定时获取头条数据异常:为获取到可用的token");
|
|
|
- return;
|
|
|
- }
|
|
|
- tokens.forEach(token -> {
|
|
|
- //3:获取广告计划信息数据
|
|
|
- reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- });
|
|
|
-
|
|
|
- //清洗关于作业帮数据
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
//1:查询作业帮相关的用户数据
|
|
|
QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("project_id",215);
|
|
|
List<UserAllocation> allocations = userAllocationService.list(wrapper);
|
|
|
+ if(null!=allocations){
|
|
|
+ allocations.forEach(allocation->{
|
|
|
+ CtopOauthToken token = tokenService.getOauthTokenByAccountId(allocation.getAccountId()+"");
|
|
|
+ //3:获取广告计划信息数据
|
|
|
+ reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //清洗关于作业帮数据
|
|
|
if(null!=allocations&&allocations.size()>0){
|
|
|
allocations.forEach(allocation->{
|
|
|
//根据accountId和时间,查询相关的日报表信息
|
|
@@ -90,6 +87,8 @@ public class SampleTest {
|
|
|
report.setMaterialType("大字报");
|
|
|
}else if(tag.contains("文字动画")){
|
|
|
report.setMaterialType("文字动画");
|
|
|
+ }else if(tag.contains("采访形式")){
|
|
|
+ report.setMaterialType("采访形式");
|
|
|
}else{
|
|
|
report.setMaterialType("其他");
|
|
|
}
|
|
@@ -100,6 +99,22 @@ public class SampleTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getBytedancePlanHourReport(){
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -1);
|
|
|
+ //1:查询当日数据
|
|
|
+ List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
+ if (null == tokens || tokens.size() <= 0) {
|
|
|
+ log.info("定时获取头条数据异常:为获取到可用的token");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ tokens.forEach(token -> {
|
|
|
+ //3:获取广告计划信息数据
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void loadRegistOrderData(){
|
|
|
|