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

流水日报详情重试成功之后删除错误日志

lining 1 год назад
Родитель
Сommit
04c89ecbb7

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

@@ -98,7 +98,7 @@ public class BytedanceController {
     @GetMapping("/flowDetailsReport")
     public void flowDetailsReport(@RequestParam(required = false) Long advertiserId, String accessToken, String startDate, String endDate) {
 
-        byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1);
+        byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1, null);
 
     }
 
@@ -111,7 +111,7 @@ public class BytedanceController {
                 @Override
                 public void run() {
                     if(!Check.isNull(advertiserAccount.getAccessToken())){
-                        byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserAccount.getAdvertiserId(), advertiserAccount.getAccessToken(), AccountTypeEnum.AD.getValue(), startDate, endDate, 1);
+                        byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserAccount.getAdvertiserId(), advertiserAccount.getAccessToken(), AccountTypeEnum.AD.getValue(), startDate, endDate, 1, null);
                     }
                 }
             });

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

@@ -13,5 +13,5 @@ import java.util.List;
  */
 public interface IByteDanceFlowDetailsReportService {
     List<AdvertiserAccount> getAdAccount();
-    void getBytedanceFlowDetailsDailyReport(Long advertiserId, String accessToken, String transactionType, String startDate, String endDate, Integer page);
+    void getBytedanceFlowDetailsDailyReport(Long advertiserId, String accessToken, String transactionType, String startDate, String endDate, Integer page, Long errorId);
 }

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

@@ -45,7 +45,7 @@ public class ByteDanceFlowDetailsReportServiceImpl implements IByteDanceFlowDeta
     }
 
     @Override
-    public void getBytedanceFlowDetailsDailyReport(Long advertiserId, String accessToken, String accountType, String startDate, String endDate, Integer page) {
+    public void getBytedanceFlowDetailsDailyReport(Long advertiserId, String accessToken, String accountType, String startDate, String endDate, Integer page, Long errorId) {
         String url = "https://ad.oceanengine.com/open_api/2/advertiser/fund/daily_stat/";
         Map<String, Object> paramsMap = new HashMap<>();
         paramsMap.put("advertiser_id", advertiserId);
@@ -136,9 +136,13 @@ public class ByteDanceFlowDetailsReportServiceImpl implements IByteDanceFlowDeta
             } catch (InterruptedException e) {
                 throw new RuntimeException(e);
             }
-            getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, accountType, startDate, endDate, page + 1);
+            getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, accountType, startDate, endDate, page + 1, errorId);
         }else{
             log.info("账户ID:{},日期:{},流水日报详情数据日报请求成功", advertiserId, startDate);
+
+            if(errorId != null){
+                promoterReportMapper.deleteInfoByErrorId(errorId);
+            }
             //send message to feishu
 //            AlertUtils.sendMessage(advertiserId, startDate, endDate, 1, "flow_details_daily", 1,null);
         }

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceFlowDetailsReportJob.java

@@ -47,7 +47,7 @@ public class ByteDanceFlowDetailsReportJob {
             @Override
             public void run() {
                 if (!Check.isNull(accessToken)) {
-                    byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), data, data, 1);
+                    byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), data, data, 1, null);
                 }
             }
         });

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceReportRetryJob.java

@@ -123,7 +123,7 @@ public class BytedanceReportRetryJob {
 
                         @Override
                         public void run() {
-                            byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1);
+                            byteDanceFlowDetailsReportService.getBytedanceFlowDetailsDailyReport(advertiserId, accessToken, AccountTypeEnum.AD.getValue(), startDate, endDate, 1, id);
                         }
                     });
                 }