浏览代码

测试登录

yumeng 4 年之前
父节点
当前提交
c685179623
共有 1 个文件被更改,包括 24 次插入22 次删除
  1. 24 22
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

+ 24 - 22
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -6,8 +6,8 @@ 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.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 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.entity.EtlKuaishouAccountMaterialReportDaily;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAccountMaterialReportDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
@@ -76,19 +76,23 @@ public class SampleTest {
     private IBytedanceReportService bytedanceReportService;
     private IBytedanceReportService bytedanceReportService;
     @Autowired
     @Autowired
     private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
     private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+    @Autowired
+    private IEtlKuaishouAccountMaterialReportDailyService materialReportDailyService;
 
 
     @Test
     @Test
     public void loadKuaishouCookie() throws ParseException {
     public void loadKuaishouCookie() throws ParseException {
-        CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
-        advertiserDataService.getMaterialList(tokenByAccountId);
 
 
-        CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
-        advertiserDataService.getMaterialList(tokenByAccountId1);
+        Date startDate = new Date();
+        for (int i = 1; i <= 2; i++) {
+            if (i == 1) {
+                continue;
+            }
+            System.err.println(DateUtils.addDay(new Date(), -i));
+            materialReportDailyService.etlKuaishouAccountMaterialReportInfo(DateUtils.formatDate(DateUtils.addDay(new Date(), -i)));
+        }
     }
     }
 
 
 
 
-
-
     @Test
     @Test
     public void deleteKuaishouComment() {
     public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
         Long start = System.currentTimeMillis();
@@ -123,7 +127,6 @@ public class SampleTest {
     }
     }
 
 
 
 
-
     @Test
     @Test
     public void etlBytedanceVideoInfo() {
     public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
         String startDate = "2021-02-01";
@@ -147,7 +150,6 @@ public class SampleTest {
     }
     }
 
 
 
 
-
     @Test
     @Test
     public void formatVideoReportData() {
     public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
         for (int i = 1; i < 45; i++) {
@@ -192,35 +194,35 @@ public class SampleTest {
     }
     }
 
 
     @Test
     @Test
-    public void checkCostData(){
+    public void checkCostData() {
         String date = "2021-06-11";
         String date = "2021-06-11";
-        for (int i=0;i<7;i++){
-            String getDate = DateUtils.addDay(date,i);
+        for (int i = 0; i < 7; i++) {
+            String getDate = DateUtils.addDay(date, i);
             //1:初始化
             //1:初始化
             checkReportTaskInfoService.initTask(getDate);
             checkReportTaskInfoService.initTask(getDate);
             //2: checkCost
             //2: checkCost
-            List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,getDate,0);
-            if(null!=taskInfos&&!taskInfos.isEmpty()){
-                for (BytedanceCheckReportTaskInfo task:taskInfos) {
+            List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, getDate, 0);
+            if (null != taskInfos && !taskInfos.isEmpty()) {
+                for (BytedanceCheckReportTaskInfo task : taskInfos) {
                     checkReportTaskInfoService.checkCost(task);
                     checkReportTaskInfoService.checkCost(task);
                 }
                 }
-                log.info("{}:数据获取完成",getDate);
+                log.info("{}:数据获取完成", getDate);
             }
             }
         }
         }
     }
     }
 
 
     @Test
     @Test
-    public void refreshReportData()throws Exception{
+    public void refreshReportData() throws Exception {
         //1:查询异常任务数据
         //1:查询异常任务数据
-        List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,null,50001);
-        if(null!=taskInfos&&!taskInfos.isEmpty()){
+        List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, null, 50001);
+        if (null != taskInfos && !taskInfos.isEmpty()) {
             countDownLatch = new CountDownLatch(taskInfos.size());
             countDownLatch = new CountDownLatch(taskInfos.size());
             taskInfos.forEach(taskInfo -> {
             taskInfos.forEach(taskInfo -> {
                 try {
                 try {
                     checkReportTaskInfoService.reloadData(taskInfo);
                     checkReportTaskInfoService.reloadData(taskInfo);
                     checkReportTaskInfoService.checkCost(taskInfo);
                     checkReportTaskInfoService.checkCost(taskInfo);
-                }catch (Exception e){
-                }finally {
+                } catch (Exception e) {
+                } finally {
                     countDownLatch.countDown();
                     countDownLatch.countDown();
                 }
                 }
             });
             });
@@ -230,7 +232,7 @@ public class SampleTest {
     }
     }
 
 
     @Test
     @Test
-    public void testfreshBytedanceUrl(){
+    public void testfreshBytedanceUrl() {
         etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
         etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();