yumeng 11 miesięcy temu
rodzic
commit
e95338ebb0

+ 8 - 8
job-adq/src/main/java/cn/com/ctop/job/adq/controller/AdqController.java

@@ -51,26 +51,26 @@ public class AdqController {
 
     @GetMapping("/getReport")
     public JSONObject getReport() {
-        List<JSONObject> dataJson = adqReportService.getAccountListByDate(20250425, 20250630);
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDateStr = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String startDateStr = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -4);
+        Integer startDate = Integer.valueOf(startDateStr.replace("-", ""));
+        Integer endDate = Integer.valueOf(endDateStr.replace("-", ""));
+        List<JSONObject> dataJson = adqReportService.getAccountListByDate(startDate, endDate);
         if (!Check.isNull(dataJson)) {
             for (int i = 0; i < dataJson.size(); i++) {
                 JSONObject jsonObject = dataJson.get(i);
-
                 Long advertiserId = jsonObject.getLong("advertiserId");
                 String accessToken = jsonObject.getString("accessToken");
                 dailyExecutorService.submit(new Runnable() {
                     @Override
                     public void run() {
-                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-04-25", "2025-06-30", 1, 1);
-                        accountReportService.getAdqAccountDaily(advertiserId, accessToken, "2025-04-25", "2025-06-30", 1, 1);
+                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, startDateStr, endDateStr, 1, 1);
+                        accountReportService.getAdqAccountDaily(advertiserId, accessToken, startDateStr, endDateStr, 1, 1);
                     }
                 });
-
-
             }
-
         }
-
         return null;
 
     }

+ 2 - 1
job-adq/src/main/java/cn/com/ctop/job/adq/data/mapper/xml/AdqErrorLogMapper.xml

@@ -41,7 +41,8 @@
                            on t1.advertiser_id = t2.advertiser_id
                  left join deepthink.adq_auth_list t3
                            on t2.admin_advertiser_id = t3.admin_advertiser_id
-        where t1.stat_time_day >= 20250425
+        where t1.stat_time_day >= #{startDate}
+          and t1.stat_time_day &lt;= #{endDate}
           and t1.cost > 0
         group by t1.advertiser_id
     </select>

+ 18 - 17
job-adq/src/main/java/cn/com/ctop/job/adq/handler/AdqRetryReportJob.java

@@ -3,6 +3,7 @@ package cn.com.ctop.job.adq.handler;
 
 import cn.com.ctop.job.adq.data.service.*;
 import cn.com.ctop.job.adq.data.utils.Check;
+import cn.com.ctop.job.adq.data.utils.DateUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -34,6 +35,7 @@ public class AdqRetryReportJob {
 
     private static ExecutorService flowExecutorService = Executors.newFixedThreadPool(2);
 
+    private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(5);
 
     @Autowired
     private IAdqCreativeReportService adqReportService;
@@ -45,6 +47,8 @@ public class AdqRetryReportJob {
     private IAdqAdIncomeService adqAdIncomeService;
     @Autowired
     private IAdqFlowDetailsReportService adqFlowDetailsReportService;
+    @Autowired
+    private IAdqAccountReportService accountReportService;
 
     @XxlJob("adqRetryReport")
     public void promoterReport() throws Exception {
@@ -178,43 +182,40 @@ public class AdqRetryReportJob {
 
 
     @XxlJob("updateAdqAccountStatus")
-    public void updateAdqAccountStatus()  {
+    public void updateAdqAccountStatus() {
         retryReportService.updateAdqAccountStatus();
     }
 
     @XxlJob("updateClAccountStatus")
-    public void updateClAccountStatus()  {
+    public void updateClAccountStatus() {
         retryReportService.updateClAccountStatus();
     }
 
 
-
-
-    /*@XxlJob("getLtv3Data")
-    public JSONObject getReport() {
-        List<JSONObject> dataJson = adqReportService.getAccountListByDate(20250425, 20250630);
+    @XxlJob("getLtv3Data")
+    public void getLtv3Data() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDateStr = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String startDateStr = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -4);
+        Integer startDate = Integer.valueOf(startDateStr.replace("-", ""));
+        Integer endDate = Integer.valueOf(endDateStr.replace("-", ""));
+        List<JSONObject> dataJson = adqReportService.getAccountListByDate(startDate, endDate);
         if (!Check.isNull(dataJson)) {
             for (int i = 0; i < dataJson.size(); i++) {
                 JSONObject jsonObject = dataJson.get(i);
-
                 Long advertiserId = jsonObject.getLong("advertiserId");
                 String accessToken = jsonObject.getString("accessToken");
-               //  dailyExecutorService.submit(new Runnable() {
+                dailyExecutorService.submit(new Runnable() {
                     @Override
                     public void run() {
-                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-04-25", "2025-06-30", 1, 1);
-                        accountReportService.getAdqAccountDaily(advertiserId, accessToken, "2025-04-25", "2025-06-30", 1, 1);
+                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, startDateStr, endDateStr, 1, 1);
+                        accountReportService.getAdqAccountDaily(advertiserId, accessToken, startDateStr, endDateStr, 1, 1);
                     }
                 });
-
-
             }
 
         }
-
-        return null;
-
-    }*/
+    }
 
 
 }