Ver código fonte

adq-线程调整

yumeng 1 ano atrás
pai
commit
2050f36f8f

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

@@ -47,40 +47,37 @@ public class AdqController {
 
     @GetMapping("/testCreativeHour")
     public JSONObject testRefreshToken(Long advertiserId, String accessToken, String date) {
-       // accountReportService.getAdqAccountHour(advertiserId, accessToken, "2025-03-28", date, 1, 1);
+        // accountReportService.getAdqAccountHour(advertiserId, accessToken, "2025-03-28", date, 1, 1);
         accountReportService.getAdqAccountDaily(advertiserId, accessToken, "2025-03-27", date, 1, 1);
-    //    adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-03-27", date, 1, 1);
+        //    adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-03-27", date, 1, 1);
         return null;
     }
 
 
     @GetMapping("/testCreativeDaily")
-    public JSONObject testCreativeDaily() {
-        List<JSONObject> accountList = adqReportService.getErrorLogs();
+    public void testCreativeDaily() {
+
+        List<JSONObject> accountList = adqReportService.getAccountList(null);
         if (!Check.isNull(accountList)) {
             for (int i = 0; i < accountList.size(); i++) {
                 JSONObject jsonObject = accountList.get(i);
-                Long id = jsonObject.getLong("id");
                 Long advertiserId = jsonObject.getLong("advertiserId");
-                String startDate = jsonObject.getString("startDate");
-                String endDate = jsonObject.getString("endDate");
-                String dataDimension = jsonObject.getString("dataDimension");
-                String dataType = jsonObject.getString("dataType");
-                String accessToken = jsonObject.getString("accessToken");
 
-                if ("creative".equals(dataDimension)) {
-                    if (dataType.equals("hour")) { // 广告时报
-                        retryReportService.getCreativeHourRetry(id, advertiserId, accessToken, startDate, endDate, 1, 2);
-                    }
-                    if (dataType.equals("daily")) { // 广告日报
-                        retryReportService.getCreativeDailyRetry(id, advertiserId, accessToken, startDate, endDate, 1, 2);
+                String accessToken = jsonObject.getString("accessToken");
+                dailyExecutorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        accountReportService.getAdqAccountDaily(advertiserId, accessToken, "2025-05-01", "2025-05-11", 1, 1);
+                        adqReportService.getAdqCreativeDaily(advertiserId, accessToken, "2025-05-01", "2025-05-11", 1, 1);
                     }
-                }
+                });
+
+
             }
         }
-        return null;
     }
 
+
     @GetMapping("/getList")
     public JSONObject getList() {
 
@@ -111,7 +108,7 @@ public class AdqController {
 
                     @Override
                     public void run() {
-                        if(!Check.isNull(advertiserAccount.getAccessToken())){
+                        if (!Check.isNull(advertiserAccount.getAccessToken())) {
                             adqFlowDetailsReportService.getAdqFlowDetailsDailyReport(advertiserAccount.getAdvertiserId(), advertiserAccount.getAccessToken(), startDateString, startDateString, 1, null);
                         }
                     }

+ 3 - 3
job-adq/src/main/java/cn/com/ctop/job/adq/handler/AdqAccountReportJob.java

@@ -28,9 +28,9 @@ public class AdqAccountReportJob {
     private IAdqAssetReportService adqAssetReportService;
     @Autowired
     private IAdqAccountReportService accountReportService;
-    private static ExecutorService nowDateHourExecutorService = Executors.newFixedThreadPool(3);
-    private static ExecutorService yesDateHourExecutorService = Executors.newFixedThreadPool(3);
-    private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(3);
+    private static ExecutorService nowDateHourExecutorService = Executors.newFixedThreadPool(5);
+    private static ExecutorService yesDateHourExecutorService = Executors.newFixedThreadPool(5);
+    private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(5);
 
     @XxlJob("nowDateAccountHour")
     public void nowDateAccountHour() throws Exception {

+ 2 - 2
job-adq/src/main/java/cn/com/ctop/job/adq/handler/AdqCreativeReportJob.java

@@ -22,8 +22,8 @@ import java.util.concurrent.Executors;
 @Slf4j
 @Component
 public class AdqCreativeReportJob {
-    private static ExecutorService hourExecutorService = Executors.newFixedThreadPool(3);
-    private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(3);
+    private static ExecutorService hourExecutorService = Executors.newFixedThreadPool(5);
+    private static ExecutorService dailyExecutorService = Executors.newFixedThreadPool(5);
     @Autowired
     private IAdqCreativeReportService adqReportService;