|
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
@@ -97,18 +99,30 @@ public class AdqController {
|
|
|
@GetMapping("/generateFlowDetailsReport")
|
|
@GetMapping("/generateFlowDetailsReport")
|
|
|
public void generateFlowDetailsReport(String startDate, String endDate) {
|
|
public void generateFlowDetailsReport(String startDate, String endDate) {
|
|
|
List<AdvertiserAccount> adAccount = adqFlowDetailsReportService.getAdAccount();
|
|
List<AdvertiserAccount> adAccount = adqFlowDetailsReportService.getAdAccount();
|
|
|
- adAccount.forEach(advertiserAccount -> {
|
|
|
|
|
- dailyExecutorService.submit(new Runnable() {
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- if(!Check.isNull(advertiserAccount.getAccessToken())){
|
|
|
|
|
- adqFlowDetailsReportService.getAdqFlowDetailsDailyReport(advertiserAccount.getAdvertiserId(), advertiserAccount.getAccessToken(), startDate, endDate, 1);
|
|
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
+ LocalDate start = LocalDate.parse(startDate, formatter);
|
|
|
|
|
+ LocalDate end = LocalDate.parse(endDate, formatter);
|
|
|
|
|
+ while (!start.isAfter(end)) {
|
|
|
|
|
+ String startDateString = start.format(formatter);
|
|
|
|
|
+ System.out.println("startDateString:" + startDateString);
|
|
|
|
|
+ adAccount.forEach(advertiserAccount -> {
|
|
|
|
|
+ dailyExecutorService.submit(new Runnable() {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ if(!Check.isNull(advertiserAccount.getAccessToken())){
|
|
|
|
|
+ adqFlowDetailsReportService.getAdqFlowDetailsDailyReport(advertiserAccount.getAdvertiserId(), advertiserAccount.getAccessToken(), startDateString, startDateString, 1);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
+ start = start.plusDays(1);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|