Explorar o código

历史数据修改

yumeng %!s(int64=5) %!d(string=hai) anos
pai
achega
70b8862f36

+ 39 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -6,12 +6,14 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.SneakyThrows;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -100,6 +102,7 @@ public class TestController {
     }
 
     static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
     @GetMapping(value = "/getVideoAndImage")
     public String getVideoAndImage() {
         QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
@@ -111,7 +114,7 @@ public class TestController {
                 public void run() {
                     kuaishouInterfaceService.getVideoList2(token, null, null, 1);
                     kuaishouInterfaceService.getImageList2(token, null, null, 1);
-                 //   kuaishouInterfaceService.getCreativeList2(token, null, null, 1);
+                    //   kuaishouInterfaceService.getCreativeList2(token, null, null, 1);
                 }
             });
 
@@ -133,12 +136,12 @@ public class TestController {
                 @Override
                 public void run() {
                     try {
-                          kuaishouInterfaceService.getCreativeList(token, null, null);
-                      //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
+                        kuaishouInterfaceService.getCreativeList(token, null, null);
+                        //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
                         //3: 获取图片信息数据
-                       // kuaishouInterfaceService.getImageList2(token, null, null,1);
+                        // kuaishouInterfaceService.getImageList2(token, null, null,1);
                         Thread.sleep(1 * 200);
-                      //  kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
+                        //  kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
@@ -147,4 +150,35 @@ public class TestController {
         }
 
     }
+
+
+    @GetMapping(value = "/gerCreativeReport")
+    public void gerCreativeReport() {
+        Thread thread = new Thread() {
+            @SneakyThrows
+            @Override
+            public void run() {
+                SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+                Date startDate = sim.parse("2020-02-01");
+                Date endDate = sim.parse("2020-02-09");
+                //1:查询当日数据
+                //executorService = Executors.newFixedThreadPool(3);
+                QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+                oauthTokenQueryWrapper.eq("media_id", 2);
+                List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
+                for (CtopOauthToken token : ctopOauthTokens) {
+                    executorService.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            System.err.println("accountId:" + token.getAccountId());
+                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, startDate, endDate);
+                        }
+                    });
+
+
+                }
+            }
+        };
+        thread.start();
+    }
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCreativeLoadJob.java

@@ -42,7 +42,7 @@ public class KuaishouCreativeLoadJob implements Job {
                 Date endDate = new Date();
                 //1:查询当日数据
                 List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
-                executorService = Executors.newFixedThreadPool(3);
+                executorService = Executors.newFixedThreadPool(4);
                 tokens.forEach(token -> {
                     executorService.submit(new Runnable() {
                         @Override