Ver código fonte

promotion project增加字段重试

hpk 1 ano atrás
pai
commit
51a70793d6

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

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