Jelajahi Sumber

Merge #67 into master from pingkang

promotion project增加字段重试

* pingkang: (1 commits)
  promotion project增加字段重试

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/67
huangpingkang 1 tahun lalu
induk
melakukan
77b4df6106

+ 10 - 9
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -31,7 +31,8 @@ public class BytedanceController {
     @Autowired
     private IBytedanceProductReportService productReportService;
 
-    private static final ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(10);
+    private static final ExecutorService executor10Service1 = Executors.newFixedThreadPool(10);
+    private static final ExecutorService executor10Service2 = Executors.newFixedThreadPool(10);
 
     @Autowired
     private IAdminAdvertiserListService adminAdvertiserListService;
@@ -65,7 +66,7 @@ public class BytedanceController {
             Long advertiserId = adminAdvertiserJson.getLong("advertiserId");
             List<Long> ids = new ArrayList<>();
             ids.add(advertiserId);
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -94,7 +95,7 @@ public class BytedanceController {
             Long advertiserId = jsonObject.getLong("advertiserId");
             String accessToken = jsonObject.getString("accessToken");
 
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -122,7 +123,7 @@ public class BytedanceController {
             Long adverId = jsonObject.getLong("advertiserId");
             String accessToken = jsonObject.getString("accessToken");
 
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
                 @Override
                 public void run() {
                     if (!Check.isNull(accessToken)) {
@@ -167,7 +168,7 @@ public class BytedanceController {
     public void generateFlowDetailsReport(String startDate, String endDate) {
         List<AdvertiserAccount> adAccount = byteDanceFlowDetailsReportService.getAdAccount();
         adAccount.forEach(advertiserAccount -> {
-            dailyRetrExecutorService.submit(new Runnable() {
+            executor10Service1.submit(new Runnable() {
 
                 @Override
                 public void run() {
@@ -187,7 +188,7 @@ public class BytedanceController {
     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(() -> {
+            executor10Service1.submit(() -> {
                 Long adverId = jsonObject.getLong("advertiserId");
                 cdpProjectService.getProjectList(adverId, null, null, null,null,1);
                 cdpProjectService.getProjectList(adverId, null, "del", null,null,1);
@@ -199,7 +200,7 @@ public class BytedanceController {
     public void costPromotion(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
         List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
         for (JSONObject jsonObject : costAccount) {
-            dailyRetrExecutorService.submit(() -> {
+            executor10Service2.submit(() -> {
                 Long adverId = jsonObject.getLong("advertiserId");
                 cdpProjectService.getPromotionList(adverId,null,null,null,1);
             });
@@ -275,7 +276,7 @@ public class BytedanceController {
             for (JSONObject iid : iids) {
                 Long pageId = iid.getLong("page_id");
                 Long advertiserId = iid.getLong("advertiser_id");
-                dailyRetrExecutorService.submit(() -> cdpProjectService.getAdqWechatPages(advertiserId, pageId));
+                executor10Service1.submit(() -> cdpProjectService.getAdqWechatPages(advertiserId, pageId));
             }
         }
     }
@@ -290,7 +291,7 @@ public class BytedanceController {
     public void materialDaily(@RequestParam(required = false) Long advertiserId, String startDate, String endDate) {
         List<JSONObject> costAccount = productReportService.getCostAccount(advertiserId, startDate, endDate);
         for (JSONObject jsonObject : costAccount) {
-            dailyRetrExecutorService.submit(() -> {
+            executor10Service1.submit(() -> {
                 Long adverId = jsonObject.getLong("advertiserId");
                 String accessToken = jsonObject.getString("accessToken");
                 bytedanceMaterialReportService.getBytedanceMaterialDailyReport(adverId, accessToken, startDate, endDate, 1, null, 1, 0);