|
@@ -9,11 +9,13 @@ import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
|
|
|
import cn.com.ctop.common.module.service.*;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
|
|
|
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -34,6 +36,8 @@ import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
+import static org.jeecg.common.util.DateUtils.getAnotherDay;
|
|
|
+
|
|
|
@RunWith(SpringRunner.class)
|
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
|
@ActiveProfiles("wps")
|
|
@@ -129,21 +133,73 @@ public class SampleTest {
|
|
|
public void testLoadBytedanceData() {
|
|
|
List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
|
for (UserAllocation allocation : allocations) {
|
|
|
-// for (int i = 2; i < 10; i++) {
|
|
|
+ System.out.println(allocation.getAccountId());
|
|
|
+ for (int i = 0; i < 1; i++) {
|
|
|
CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
- Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
// reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
-// }
|
|
|
+
|
|
|
+// reportService.getAdvertiserCampaignReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+// reportService.getAdvertiserCampaignReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
public void loadBytedancePlanData(){
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(1665934552997902L);
|
|
|
- advertiserDataService.getAdvertiserPlan(token, "", null, null);
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(100198696723L);
|
|
|
+// advertiserDataService.getAdvertiserPlan(token, "", null, null);
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBytedanceFundDailyService bytedanceFundDailyService;
|
|
|
+ @Test
|
|
|
+ public void loadFoudData() {
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
|
|
|
+ for (CtopOauthToken token : tokens) {
|
|
|
+ System.out.println(token.getAccountId()+"############################");
|
|
|
+ for(int i=20;i<130;i++){
|
|
|
+ Date date = DateUtils.addDay(new Date(),-i);
|
|
|
+ bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date),1);
|
|
|
+ System.out.println(i+"############################");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouHistoryReportTaskService reportTaskService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 测试获取快手图片消耗数据任务
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ public void loadKuaishouImageTask(){
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
+ for(int i=1;i<130;i++) {
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
+ String getDateStr = DateUtils.formatDate(getDate);
|
|
|
+ tokens.forEach(token -> reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouDailyReportTaskService dailyReportTaskService;
|
|
|
+ /**
|
|
|
+ * 测试获取快手图片消耗数据入库
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ public void loadKuaishouImageTaskFile(){
|
|
|
+ String nowDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
+ List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
|
|
|
+ for(int i=1;i<15;i++){
|
|
|
+ String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
|
|
|
+ tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
|
|
|
+ }
|
|
|
+ // 查询快手token
|
|
|
+ }
|
|
|
|
|
|
@Test
|
|
|
public void loadKuaishouAgentData() {
|
|
@@ -198,16 +254,19 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
|
public void loadBytedanceData(){
|
|
|
- List<UserAllocation>allocations = allocationService.getByParams(633L,null,0);
|
|
|
+ List<UserAllocation>allocations = allocationService.getByParams(289L,null,0);
|
|
|
for (int i=0;i<allocations.size();i++) {
|
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(allocations.get(i).getAccountId());
|
|
|
- for(int j=10;j<110;j++){
|
|
|
- Date getDate = DateUtils.addDay(new Date(), -j);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ for(int j=0;j<10;j++){
|
|
|
+ String getDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -j));
|
|
|
+ bytedanceReportService.bytedanceVideoMaterialReport(token, getDate, getDate);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IBytedanceReportService bytedanceReportService;
|
|
|
+
|
|
|
@Test
|
|
|
public void loaddata(){
|
|
|
for(int i=0;i<30;i++){
|
|
@@ -218,13 +277,10 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- private IBytedanceReportService bytedanceReportService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
|
@Test
|
|
|
public void loadMatData(){
|
|
|
- List<UserAllocation> allocations = allocationService.getByParams(320L,null,0);
|
|
|
+ List<UserAllocation> allocations = allocationService.getByParams(289L,null,0);
|
|
|
countDownLatch = new CountDownLatch(allocations.size());
|
|
|
executorService = Executors.newFixedThreadPool(2);
|
|
|
allocations.forEach(allocation -> {
|