Просмотр исходного кода

Merge #63 into master from pingkang

bytedance cdp 增加字段

* pingkang: (2 commits)
  bytedance cdp 增加字段
  bytedance cdp 增加字段

Signed-off-by: 黄平康 <accounts_6361eaad7b63b44dd7833e63@mail.teambition.com>
Merged-by: 黄平康 <accounts_6361eaad7b63b44dd7833e63@mail.teambition.com>

CR-link: https://codeup.aliyun.com/60c06368dbbed34fe0f0c263/job/hr_job-bytedance/change/63
huangpingkang 1 год назад
Родитель
Сommit
051abaf19b

+ 16 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -32,7 +32,7 @@ public class BytedanceController {
     @Autowired
     @Autowired
     private IBytedanceProductReportService productReportService;
     private IBytedanceProductReportService productReportService;
 
 
-    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(3);
+    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(10);
 
 
     @Autowired
     @Autowired
     private IAdminAdvertiserListService adminAdvertiserListService;
     private IAdminAdvertiserListService adminAdvertiserListService;
@@ -182,6 +182,21 @@ public class BytedanceController {
     }
     }
 
 
     /**
     /**
+     * 补全有消耗字节项目数据
+     */
+    @GetMapping("/costProject")
+    public void costProject(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
+        List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
+        for (JSONObject jsonObject : costAccount) {
+            dailyRetrExecutorService.submit(() -> {
+                Long adverId = jsonObject.getLong("advertiserId");
+                cdpProjectService.getProjectList(adverId, null, null, null);
+                cdpProjectService.getProjectList(adverId, null, "del", null);
+            });
+        }
+    }
+
+    /**
      * 回调补全字节项目数据
      * 回调补全字节项目数据
      */
      */
     @RequestMapping("/rebackProjectInfo")
     @RequestMapping("/rebackProjectInfo")

+ 2 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceCdpProjectServiceImpl.java

@@ -133,6 +133,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                     } else {
                     } else {
                         log.error("获取广告列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                         log.error("获取广告列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     }
+                    return;
                 }
                 }
             }
             }
             if (nextPage) {
             if (nextPage) {
@@ -225,6 +226,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
                     } else {
                     } else {
                         log.error("获取项目列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                         log.error("获取项目列表失败(url:{}),入参:{}\n结果:{}", url, JSONObject.toJSONString(params), obj);
                     }
                     }
+                    return;
                 }
                 }
             }
             }
             if (nextPage) {
             if (nextPage) {