pudongliang 3 месяцев назад
Родитель
Сommit
06ea09db91

+ 4 - 0
src/main/java/com/moka/gdtauto/service/AdPlanAutoExecutor.java

@@ -37,6 +37,7 @@ public class AdPlanAutoExecutor {
 
     private final AdAutoExecuteLogService adAutoExecuteLogService;
     private final AdPlanConfService adPlanConfService;
+    private final AdPlanDailyReportService adPlanDailyReportService;
     private final AdPlanService adPlanService;
 
     /**
@@ -149,6 +150,9 @@ public class AdPlanAutoExecutor {
         List<Long> dailyBudgetLevel = JSON.parseArray(autoConf.getDailyBudgetLevel(), Long.class);
         // 同步日报
         try {
+            log.info("[AdAutoExecutor] 同步日报,confId={}", confId);
+            adPlanDailyReportService.syncReqDailyReport(confId, now, now);
+
             // 分页查询当前 conf 下的 AdPlan,进行规则检测
             long adCount = 0;
             List<AdPlan> plansToSuspend = new ArrayList<>();

+ 4 - 0
src/main/java/com/moka/gdtauto/service/AdPlanCreativeAutoExecutor.java

@@ -36,6 +36,7 @@ public class AdPlanCreativeAutoExecutor {
 
     private final AdAutoExecuteLogService adAutoExecuteLogService;
     private final AdPlanConfService adPlanConfService;
+    private final AdPlanCreativeDailyReportService adPlanCreativeDailyReportService;
     private final AdPlanCreativeService adPlanCreativeService;
 
     /**
@@ -145,6 +146,9 @@ public class AdPlanCreativeAutoExecutor {
         adAutoExecuteLogService.save(executeLog);
         // 同步日报
         try {
+            log.info("[AdPlanCreativeAutoExecutor] 同步日报,confId={}", confId);
+            adPlanCreativeDailyReportService.syncReqDailyReport(confId, now, now);
+
             // 分页查询当前 conf 下的 AdPlan,进行规则检测
             long adCount = 0;
             List<AdPlanCreative> creativesToSuspend = new ArrayList<>();

+ 7 - 7
src/main/java/com/moka/gdtauto/task/AdAutoTask.java

@@ -31,13 +31,13 @@ public class AdAutoTask {
     private final AdPlanConfService adPlanConfService;
     // private final ExecutorService executorService = Executors.newFixedThreadPool(10);
 
-    @Scheduled(cron = "0 0/10 * * * ?")
-    @SchedulerLock(name = "ad-plan-auto-task", lockAtMostFor = "9m", lockAtLeastFor = "2m")
-    public void adPlanAutoTask() {
-        log.info("AdPlanAutoTask execute");
-        List<AdAutoConf> confList = adAutoConfService.lambdaQuery().list();
-        confList.forEach(conf -> adPlanAutoExecutor.asyncExecute(conf));
-    }
+    // @Scheduled(cron = "0 0/10 * * * ?")
+    // @SchedulerLock(name = "ad-plan-auto-task", lockAtMostFor = "9m", lockAtLeastFor = "2m")
+    // public void adPlanAutoTask() {
+    //     log.info("AdPlanAutoTask execute");
+    //     List<AdAutoConf> confList = adAutoConfService.lambdaQuery().list();
+    //     confList.forEach(conf -> adPlanAutoExecutor.asyncExecute(conf));
+    // }
 
     @Scheduled(cron = "30 0/10 * * * ?")
     @SchedulerLock(name = "ad-creative-auto-task", lockAtMostFor = "9m", lockAtLeastFor = "2m")