Pārlūkot izejas kodu

修改冗余代码

songyh 4 gadi atpakaļ
vecāks
revīzija
eea63054b8

+ 42 - 5
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -5,7 +5,9 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
+import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
 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.service.IKuaishouReportDailyImageService;
@@ -70,7 +72,7 @@ public class SampleTest {
     private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
     @Autowired
     private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
-    static ExecutorService executorService = null;
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
     static CountDownLatch countDownLatch = null;
     @Autowired
     private IBytedanceReportService bytedanceReportService;
@@ -230,9 +232,44 @@ public class SampleTest {
     }
 
     @Test
-    public void testfreshBytedanceUrl(){
-        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
-        etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
-        etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
+    public void loadBkData(){
+        Date startDate = DateUtils.addDay(new Date(),-60);
+        for(int i=0;i<=60;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
+        }
+    }
+
+    @Autowired
+    private IEtlKuaishouVideoInfoService etlKuaishouVideoInfo;
+    @Test
+    public void loadkuaishouVideoData(){
+        String startDate = "2021-05-07";
+        for(int i=0;i<=60;i++){
+            String getDate = DateUtils.formatDate(DateUtils.addDay(startDate,i));
+            etlKuaishouVideoInfo.etlKuaishouVideoInfo(getDate);
+        }
     }
+
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+    @Test
+    public void loadKuaishouMatData() throws InterruptedException {
+        String startDate = "2021-06-18";
+        String endDate = "2021-06-24";
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        countDownLatch = new CountDownLatch(tokens.size());
+        tokens.forEach(token -> executorService.submit(() -> {
+            try {
+                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "DAILY", 1);
+            }catch (Exception e){
+            }finally {
+                countDownLatch.countDown();
+            }
+        }));
+        countDownLatch.await();
+        System.out.println("数据获取完成");
+    }
+
 }

+ 0 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsVideoReportCtrl.java

@@ -59,17 +59,8 @@ public class KsVideoReportCtrl {
     public Result<PageInfo<JSONObject>> getListReport(@RequestBody JSONObject requestBody) {
         Result<PageInfo<JSONObject>> result = new Result<>();
         try {
-            if (Check.isNull(requestBody)) {
-                new Exception("入参不能为空");
-            }
             int pageSize = requestBody.getInteger("pageSize");
-            if (Check.isNull(pageSize)) {
-                throw new Exception("请输入查询每页条数");
-            }
             int pageNo = requestBody.getInteger("pageNo");
-            if (Check.isNull(pageNo)) {
-                throw new Exception("请输入查询页数");
-            }
             String startDate = requestBody.getString("startDate");
             if (Check.isNull(startDate)) {
                 throw new Exception("请输入查询开始时间");

+ 0 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/operation/util/GetChangeDateUtil.java

@@ -1,13 +1,10 @@
 package cn.com.ctop.toutiao.modules.operation.util;
 
 import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.toutiao.modules.operation.entity.BytedanceOperationLog;
-import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
 
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Method;
-import java.security.Timestamp;
 import java.util.*;
 
 public class GetChangeDateUtil {