yumeng 5 年 前
コミット
de832c0f55

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

@@ -290,51 +290,35 @@ public class TestController {
         oauthTokenQueryWrapper.eq("account_id", accountId);
         oauthTokenQueryWrapper.last("limit 1");
         CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
-        executorService.submit(new Runnable() {
-            @Override
-            public void run() {
-                try {
-
-                    kuaishouInterfaceService.getCampaignList(token, null, null);
-                    //1:获取全量广告组数据
-                    kuaishouInterfaceService.getGroupList(token, null, null);
-
-                    Thread.sleep(1 * 200);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
+        try {
+            System.err.println("获取计划,广告组:" + accountId);
+            kuaishouInterfaceService.getCampaignList(token, null, null);
+            //1:获取全量广告组数据
+            kuaishouInterfaceService.getGroupList(token, null, null);
+            System.err.println("获取计划,广告组:" + accountId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
 
     }
 
 
-    @GetMapping(value = "/gerCreativeByAccount")
+    @GetMapping(value = "/getCreativeByAccount")
     public void gerCreative(Long accountId) {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
         oauthTokenQueryWrapper.eq("media_id", 2);
         oauthTokenQueryWrapper.eq("account_id", accountId);
         oauthTokenQueryWrapper.last("limit 1");
         CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
-        executorService.submit(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    System.err.println("获取创意,accountId:" + token.getAccountId());
-                    // 1.计划数据
-                    kuaishouInterfaceService.getCampaignList(token, null, null);
-                    // 2:广告组数据
-                    kuaishouInterfaceService.getGroupList(token, null, null);
-                    // 3:创意数据
-                    kuaishouInterfaceService.getCreativeList(token, null, null);
 
-                    Thread.sleep(1 * 200);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
+        try {
+            System.err.println("获取创意,accountId:" + token.getAccountId());
+            kuaishouInterfaceService.getCreativeList(token, null, null);
+            System.err.println("获取创意结束,accountId:" + token.getAccountId());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
 
     }
@@ -357,8 +341,6 @@ public class TestController {
                 CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
                 System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
                 kuaishouInterfaceService.getAdvertiserCreativeReportDaily(ctopOauthToken, startDate, endDate);
-
-
             }
         };
         thread.start();