|
@@ -17,8 +17,6 @@ import cn.com.ctop.oa.modules.service.IWechatNoListService;
|
|
|
import cn.com.ctop.oa.modules.service.IWechatUserListService;
|
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
|
-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.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -29,7 +27,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
@@ -425,45 +422,20 @@ public class SampleTest {
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- private IRuleKuaiShouPlanService ruleKuaiShouPlanService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
|
|
|
|
|
|
- @Test
|
|
|
- public void execute() {
|
|
|
- List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
|
|
|
- for (UserAllocation allocation : allocations) {
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-10-01", "2020-10-31");
|
|
|
- reportTaskRecordService.save(reportTaskRecord1);
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-11-01", "2020-11-30");
|
|
|
- reportTaskRecordService.save(reportTaskRecord2);
|
|
|
- BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-12-01", "2020-12-31");
|
|
|
- reportTaskRecordService.save(reportTaskRecord3);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
@Test
|
|
|
public void loadBDAccoutData() {
|
|
|
- CtopOauthToken token2 = tokenService.getTokenByAccountId(1674206482908163L);
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token2, "2020-10-14", "2020-10-14");
|
|
|
+ Date startDate = DateUtils.addDay(new Date(),-2000);
|
|
|
+ for(int i=0;i<=2000;i++){
|
|
|
+ Date getDate = DateUtils.addDay(startDate,i);
|
|
|
+ bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- @Resource
|
|
|
- private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
|
|
|
|
|
|
- private void load12AccountData(CtopOauthToken token) {
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-10-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-10-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-11-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-11-30", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-12-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
- }
|
|
|
|
|
|
- private void load12Data(CtopOauthToken token) {
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-13");
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token, "2020-10-14", "2020-10-16");
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token, "2020-10-17", "2020-10-19");
|
|
|
- bytedanceReportService.bytedanceMaterialReport(token, "2020-10-20", "2020-10-21");
|
|
|
- }
|
|
|
|
|
|
@Autowired
|
|
|
private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
|
|
@@ -474,7 +446,6 @@ public class SampleTest {
|
|
|
Date startDate = DateUtils.parseDate(dateString, "yyyy-MM-dd");
|
|
|
for (int i = 0; i <= 10; i++) {
|
|
|
Date getDate = DateUtils.addDay(startDate, i);
|
|
|
- kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
|
|
|
bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
|
|
|
}
|
|
|
}
|
|
@@ -508,59 +479,7 @@ public class SampleTest {
|
|
|
|
|
|
@Test
|
|
|
public void testLoadBytedanceDataV2() {
|
|
|
- String accountIds =
|
|
|
- "1675440464386062," +
|
|
|
- "1688606248211533," +
|
|
|
- "1669181787105294," +
|
|
|
- "1687571097467912," +
|
|
|
- "1650079154438157," +
|
|
|
- "1680697900744711," +
|
|
|
- "1678156679964680," +
|
|
|
- "1670727177043982," +
|
|
|
- "1676160388944910," +
|
|
|
- "1687559760306190," +
|
|
|
- "1687382871519240," +
|
|
|
- "1680312075164686," +
|
|
|
- "1675440465991688," +
|
|
|
- "1664657972166663," +
|
|
|
- "1688193173408782," +
|
|
|
- "1675616147056647," +
|
|
|
- "1687308848716814," +
|
|
|
- "1686394621234247," +
|
|
|
- "1683594409340935," +
|
|
|
- "1683676478859341," +
|
|
|
- "1686384860112904," +
|
|
|
- "1668290872519693," +
|
|
|
- "1674063202781191," +
|
|
|
- "1685024266033160," +
|
|
|
- "1669714891201544," +
|
|
|
- "1687758256277512," +
|
|
|
- "1675434231118856," +
|
|
|
- "1686394621807687," +
|
|
|
- "1678411706704903," +
|
|
|
- "1686223489547271," +
|
|
|
- "1660120711467022," +
|
|
|
- "1686833795211278," +
|
|
|
- "1680697899143175," +
|
|
|
- "1661313994984462," +
|
|
|
- "1661313995480077," +
|
|
|
- "1636295780727820," +
|
|
|
- "1676540490482759," +
|
|
|
- "1675342904713223," +
|
|
|
- "1686771461984327," +
|
|
|
- "1685841129360391," +
|
|
|
- "1683676477736973," +
|
|
|
- "1661313994470413," +
|
|
|
- "1663465141771272," +
|
|
|
- "1687758256732174," +
|
|
|
- "1686223482927117," +
|
|
|
- "1686835166313479," +
|
|
|
- "1642648003678215," +
|
|
|
- "1639753233213454," +
|
|
|
- "1675239584963662," +
|
|
|
- "1674634579279885," +
|
|
|
- "1650263841162253," +
|
|
|
- "1672178052130888";
|
|
|
+ String accountIds = "1675440464386062";
|
|
|
String[] accountArray = accountIds.split(",");
|
|
|
for (int i = 0; i < accountArray.length; i++) {
|
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[i]));
|