|
@@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -38,19 +40,44 @@ public class BytedanceController {
|
|
|
private IBytedancePromoterReportService promoterReportService;
|
|
private IBytedancePromoterReportService promoterReportService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IChannelService channelService;
|
|
private IChannelService channelService;
|
|
|
|
|
+ private static ExecutorService dailyRetrExecutorService = Executors.newFixedThreadPool(5);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@GetMapping("/testRefreshToken")
|
|
@GetMapping("/testRefreshToken")
|
|
|
public void testRefreshToken() {
|
|
public void testRefreshToken() {
|
|
|
|
|
+ List<JSONObject> dataList = promoterReportService.getAllList();
|
|
|
|
|
+ List<String> days = DateUtils.getDays("2025-02-15", "2025-03-13");
|
|
|
|
|
+ System.err.println(days);
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < days.size(); i++) {
|
|
|
|
|
+ String s = days.get(i);
|
|
|
|
|
+ System.err.println(s);
|
|
|
|
|
+ for (int j = 0; j < dataList.size(); j++) {
|
|
|
|
|
+ JSONObject jsonObject = dataList.get(j);
|
|
|
|
|
+ Long advertiserId = jsonObject.getLong("advertiserId");
|
|
|
|
|
+ String accessToken = jsonObject.getString("accessToken");
|
|
|
|
|
+ dailyRetrExecutorService.submit(new Runnable() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ if (!Check.isNull(accessToken)) {
|
|
|
|
|
+ promoterReportService.getBytedancePromoterHour(advertiserId, accessToken, s, s, 1, 1);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
String yesDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
String yesDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
- List<JSONObject> dataList = promoterReportService.getListBydate(20250312);
|
|
|
|
|
|
|
+
|
|
|
for (int i = 0; i < dataList.size(); i++) {
|
|
for (int i = 0; i < dataList.size(); i++) {
|
|
|
JSONObject jsonObject = dataList.get(i);
|
|
JSONObject jsonObject = dataList.get(i);
|
|
|
Long advertiserId = jsonObject.getLong("advertiserId");
|
|
Long advertiserId = jsonObject.getLong("advertiserId");
|
|
|
String accessToken = jsonObject.getString("accessToken");
|
|
String accessToken = jsonObject.getString("accessToken");
|
|
|
- promoterReportService.getBytedancePromoterDaily(advertiserId, accessToken, yesDate, yesDate, 1, 1);
|
|
|
|
|
|
|
+ // promoterReportService.getBytedancePromoterDaily(advertiserId, accessToken, yesDate, yesDate, 1, 1);
|
|
|
promoterReportService.getBytedancePromoterHour(advertiserId, accessToken, yesDate, yesDate, 1, 1);
|
|
promoterReportService.getBytedancePromoterHour(advertiserId, accessToken, yesDate, yesDate, 1, 1);
|
|
|
|
|
|
|
|
|
|
|