|
@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
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.service.IProjectService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
|
|
@@ -23,6 +24,7 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
@@ -65,6 +67,10 @@ public class SampleTest {
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IProjectService projectService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserAllocationService allocationService;
|
|
/* @Autowired
|
|
/* @Autowired
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
private IByteDanceAdvertiserDataService advertiserDataService;
|
|
|
|
|
|
@@ -80,16 +86,27 @@ public class SampleTest {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
Date parse = simpleDateFormat.parse("2021-02-02");
|
|
Date parse = simpleDateFormat.parse("2021-02-02");
|
|
kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
|
|
kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
|
|
|
|
|
|
- CtopOauthToken token = new CtopOauthToken();
|
|
|
|
|
|
+ QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("project_id", 900886);
|
|
|
|
+ List<UserAllocation> list = allocationService.list(queryWrapper);
|
|
|
|
+ for (UserAllocation allocation : list) {
|
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
|
+ kuaishouInterfaceService.getVideoList(token, null, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /* CtopOauthToken token = new CtopOauthToken();
|
|
token.setAccountId(9767055L);
|
|
token.setAccountId(9767055L);
|
|
token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
|
|
token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
|
|
|
|
|
|
kuaishouInterfaceService.getVideoList(token, null, null);
|
|
kuaishouInterfaceService.getVideoList(token, null, null);
|
|
- kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9",9767055L,"5208131540349742192");
|
|
|
|
|
|
+ kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9", 9767055L, "5208131540349742192");*/
|
|
|
|
|
|
/* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
|
|
/* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
|
|
advertiserDataService.getMaterialList(tokenByAccountId);*/
|
|
advertiserDataService.getMaterialList(tokenByAccountId);*/
|
|
@@ -161,8 +178,7 @@ public class SampleTest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IUserAllocationService allocationService;
|
|
|
|
|
|
+
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testLoadBytedanceData() {
|
|
public void testLoadBytedanceData() {
|
|
@@ -538,8 +554,8 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- public void testLoadBytedanceDataV2(){
|
|
|
|
- String accountIds=
|
|
|
|
|
|
+ public void testLoadBytedanceDataV2() {
|
|
|
|
+ String accountIds =
|
|
"1675440464386062," +
|
|
"1675440464386062," +
|
|
"1688606248211533," +
|
|
"1688606248211533," +
|
|
"1669181787105294," +
|
|
"1669181787105294," +
|
|
@@ -592,22 +608,23 @@ public class SampleTest {
|
|
"1674634579279885," +
|
|
"1674634579279885," +
|
|
"1650263841162253," +
|
|
"1650263841162253," +
|
|
"1672178052130888";
|
|
"1672178052130888";
|
|
- String [] accountArray = accountIds.split(",");
|
|
|
|
- for (int i=0;i<accountArray.length;i++){
|
|
|
|
|
|
+ String[] accountArray = accountIds.split(",");
|
|
|
|
+ for (int i = 0; i < accountArray.length; i++) {
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[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);
|
|
|
|
|
|
+ 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
|
|
@Test
|
|
- public void checkBytedanceReport(){
|
|
|
|
|
|
+ public void checkBytedanceReport() {
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1678959391271949L);
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1678959391271949L);
|
|
String startDate = "2021-01-01 00:00:00";
|
|
String startDate = "2021-01-01 00:00:00";
|
|
String endDate = "2021-01-31 00:00:00";
|
|
String endDate = "2021-01-31 00:00:00";
|
|
- bytedanceReportService.checkoutData(token,startDate,endDate);
|
|
|
|
|
|
+ bytedanceReportService.checkoutData(token, startDate, endDate);
|
|
}
|
|
}
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void etlKuaishouProjectData() {
|
|
public void etlKuaishouProjectData() {
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1660666858777607L);
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(1660666858777607L);
|
|
@@ -653,8 +670,8 @@ public class SampleTest {
|
|
@Test
|
|
@Test
|
|
public void etlBytedanceVideoReportClean() {
|
|
public void etlBytedanceVideoReportClean() {
|
|
//for (int i = 1; i <= 1; i++) {
|
|
//for (int i = 1; i <= 1; i++) {
|
|
- // String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
|
|
|
|
- ietlReportBytedanceVideoService.cleanETL("2020-12-31");
|
|
|
|
|
|
+ // String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
|
|
|
|
+ ietlReportBytedanceVideoService.cleanETL("2020-12-31");
|
|
//}
|
|
//}
|
|
}
|
|
}
|
|
|
|
|