|
|
@@ -8,7 +8,6 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
|
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.CorpWexinUtils;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
@@ -17,7 +16,6 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
|
|
|
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;
|
|
|
import com.xxl.job.core.log.XxlJobLogger;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
@@ -53,10 +51,13 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
|
private ICtopOauthTokenService tokenService;
|
|
|
+ @Autowired
|
|
|
+ private IRefreshTokenService refreshTokenService;
|
|
|
+
|
|
|
|
|
|
@Test
|
|
|
public void loadBytedanceCreativeData() {
|
|
|
- CorpWexinUtils.sendMessageByWeChatId("ZhaoWang","测试企业微信发送消息");
|
|
|
+ refreshTokenService.getKuaiShouRefresh();
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@@ -125,10 +126,10 @@ public class SampleTest {
|
|
|
List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
|
for (UserAllocation allocation : allocations) {
|
|
|
// for (int i = 2; i < 10; i++) {
|
|
|
- CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
- Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
+ CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
// reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
@@ -169,11 +170,11 @@ public class SampleTest {
|
|
|
public void loadAccountData() {
|
|
|
// List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
|
|
|
// for (UserAllocation allocation:allocations) {
|
|
|
- CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
|
|
|
- for(int i=92;i<100;i++){
|
|
|
- Date getDate = DateUtils.addDay(new Date(),-i);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
|
|
|
+ for (int i = 92; i < 100; i++) {
|
|
|
+ Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
@@ -185,20 +186,20 @@ public class SampleTest {
|
|
|
IUReportService uReportService;
|
|
|
|
|
|
@Test
|
|
|
- public void loadBytedanceData(){
|
|
|
- List<UserAllocation>allocations = allocationService.getByParams(633L,null,0);
|
|
|
- for (int i=0;i<allocations.size();i++) {
|
|
|
+ public void loadBytedanceData() {
|
|
|
+ List<UserAllocation> allocations = allocationService.getByParams(633L, 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++){
|
|
|
+ for (int j = 10; j < 110; j++) {
|
|
|
Date getDate = DateUtils.addDay(new Date(), -j);
|
|
|
- reportService.getAdvertiserReport(token, getDate, getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
+ reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void loaddata(){
|
|
|
- for(int i=0;i<30;i++){
|
|
|
+ public void loaddata() {
|
|
|
+ for (int i = 0; i < 30; i++) {
|
|
|
Date getDate = DateUtils.addDay(new Date(), -i);
|
|
|
String date = DateUtils.formatDate(getDate);
|
|
|
videoReportDailyService.videoInfoList(date, date);
|
|
|
@@ -210,9 +211,10 @@ public class SampleTest {
|
|
|
|
|
|
@Autowired
|
|
|
private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
|
+
|
|
|
@Test
|
|
|
- public void loadMatData(){
|
|
|
- List<UserAllocation> allocations = allocationService.getByParams(320L,null,0);
|
|
|
+ public void loadMatData() {
|
|
|
+ List<UserAllocation> allocations = allocationService.getByParams(320L, null, 0);
|
|
|
countDownLatch = new CountDownLatch(allocations.size());
|
|
|
executorService = Executors.newFixedThreadPool(2);
|
|
|
allocations.forEach(allocation -> {
|