|
@@ -13,12 +13,13 @@ import cn.com.ctop.common.module.service.IUReportExportService;
|
|
import cn.com.ctop.common.module.service.IUReportService;
|
|
import cn.com.ctop.common.module.service.IUReportService;
|
|
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.batch.service.IKuaiShouDailyReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
|
|
-import cn.com.ctop.shiwan.modules.service.IShiwanFileUploadService;
|
|
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
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.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.IBytedanceReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -40,6 +41,8 @@ import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
+import static org.jeecg.common.util.DateUtils.getAnotherDay;
|
|
|
|
+
|
|
@RunWith(SpringRunner.class)
|
|
@RunWith(SpringRunner.class)
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
@ActiveProfiles("wps")
|
|
@ActiveProfiles("wps")
|
|
@@ -135,13 +138,72 @@ public class SampleTest {
|
|
public void testLoadBytedanceData() {
|
|
public void testLoadBytedanceData() {
|
|
List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
|
|
for (UserAllocation allocation : allocations) {
|
|
for (UserAllocation allocation : allocations) {
|
|
-// for (int i = 2; i < 10; i++) {
|
|
|
|
- CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
|
- Date getDate = DateUtils.addDay(new Date(), 0);
|
|
|
|
|
|
+ System.out.println(allocation.getAccountId());
|
|
|
|
+ for (int i = 0; i < 1; i++) {
|
|
|
|
+ CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
|
|
|
|
+ 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_DAILY);
|
|
- reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
|
|
|
|
-// }
|
|
|
|
|
|
+ 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(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
|
|
@Test
|
|
@@ -180,11 +242,11 @@ public class SampleTest {
|
|
public void loadAccountData() {
|
|
public void loadAccountData() {
|
|
// List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
|
|
// List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
|
|
// for (UserAllocation allocation:allocations) {
|
|
// 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);
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
@@ -196,20 +258,23 @@ public class SampleTest {
|
|
IUReportService uReportService;
|
|
IUReportService uReportService;
|
|
|
|
|
|
@Test
|
|
@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(289L,null,0);
|
|
|
|
+ for (int i=0;i<allocations.size();i++) {
|
|
CtopOauthToken token = tokenService.getTokenByAccountId(allocations.get(i).getAccountId());
|
|
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
|
|
@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);
|
|
Date getDate = DateUtils.addDay(new Date(), -i);
|
|
String date = DateUtils.formatDate(getDate);
|
|
String date = DateUtils.formatDate(getDate);
|
|
videoReportDailyService.videoInfoList(date, date);
|
|
videoReportDailyService.videoInfoList(date, date);
|
|
@@ -217,14 +282,10 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IBytedanceReportService bytedanceReportService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
private IByteDanceVideoReportDailyService videoReportDailyService;
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
- public void loadMatData() {
|
|
|
|
- List<UserAllocation> allocations = allocationService.getByParams(320L, null, 0);
|
|
|
|
|
|
+ public void loadMatData(){
|
|
|
|
+ List<UserAllocation> allocations = allocationService.getByParams(289L,null,0);
|
|
countDownLatch = new CountDownLatch(allocations.size());
|
|
countDownLatch = new CountDownLatch(allocations.size());
|
|
executorService = Executors.newFixedThreadPool(2);
|
|
executorService = Executors.newFixedThreadPool(2);
|
|
allocations.forEach(allocation -> {
|
|
allocations.forEach(allocation -> {
|
|
@@ -250,14 +311,4 @@ public class SampleTest {
|
|
}
|
|
}
|
|
XxlJobLogger.log("物料数据同步完成");
|
|
XxlJobLogger.log("物料数据同步完成");
|
|
}
|
|
}
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IShiwanFileUploadService shiwanFileUploadService;
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void fileUpload() throws IOException {
|
|
|
|
- shiwanFileUploadService.createNewZipFile(null, "6",null,null,null,null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|