Sfoglia il codice sorgente

头条-账户报表

yumeng 1 anno fa
parent
commit
0701c3d7fe

+ 23 - 5
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -3,6 +3,7 @@ package cn.com.ctop.job.bytedance.controller;
 import cn.com.ctop.job.bytedance.data.service.IAdminAdvertiserListService;
 import cn.com.ctop.job.bytedance.data.service.IBytedanceAccountReportService;
 import cn.com.ctop.job.bytedance.data.service.IBytedanceProductReportService;
+import cn.com.ctop.job.bytedance.data.service.IBytedancePromoterReportService;
 import cn.com.ctop.job.bytedance.data.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
@@ -39,14 +40,31 @@ public class BytedanceController {
     @Autowired
     private IBytedanceAccountReportService accountReportService;
 
+    @Autowired
+    private IBytedancePromoterReportService promoterReportService;
+
 
     @GetMapping("/accountReport")
     public void getChannel(String param) {
-        String[] s = param.split("_");
-        Long advertiserId = Long.valueOf(s[0]);
-        String accessToken = s[1];
-        accountReportService.getBytedanceAccountDaily(advertiserId, accessToken, "2025-03-27", "2025-03-27", 1, 1);
-        accountReportService.getBytedanceAccountHour(advertiserId, accessToken, "2025-03-27", "2025-03-27", 1, 1);
+        List<JSONObject> allList = promoterReportService.getAllList();
+        for (int i = 0; i < allList.size(); i++) {
+            JSONObject jsonObject = allList.get(i);
+            Long advertiserId = jsonObject.getLong("advertiserId");
+            String accessToken = jsonObject.getString("accessToken");
+
+            dailyRetrExecutorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    if (!Check.isNull(accessToken)) {
+                        accountReportService.getBytedanceAccountDaily(advertiserId, accessToken, "2025-02-15", "2025-03-25", 1, 1);
+                  //      accountReportService.getBytedanceAccountHour(advertiserId, accessToken, "2025-02-15", "2025-03-25", 1, 1);
+                    }
+                }
+            });
+
+        }
+
+
     }
 
     @GetMapping("/productData")

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceAccountReportServiceImpl.java

@@ -71,7 +71,7 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
                     }
                 }
             } else {
-                log.info("账户id:{},日期:{}广告时报(账户粒度)请求结果为空", advertiserId, startDate);
+                log.info("账户id:{},日期:{}广告时报(账户粒度)请求结果为空,result:{}", advertiserId, startDate,result.getString("message"));
                 return;
 
             }