|
@@ -14,12 +14,14 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.*;
|
|
import java.util.concurrent.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
+
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListService {
|
|
public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AdminAdvertiserListMapper adminAdvertiserListMapper;
|
|
private AdminAdvertiserListMapper adminAdvertiserListMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public JSONObject bytedanceAdvertiserThreadPool(Integer totalPage, Integer pageSize, Long adminAdvertiserId, Long ccAccountId, String accessToken) {
|
|
public JSONObject bytedanceAdvertiserThreadPool(Integer totalPage, Integer pageSize, Long adminAdvertiserId, Long ccAccountId, String accessToken) {
|
|
|
ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
@@ -136,7 +138,7 @@ public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListServi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private List<String> getBytedanceAccountList(Long adminAdvertiserId, Long ccAccountId, String accessToken, Integer page, Integer pageSize, Integer requestCount) {
|
|
|
|
|
|
|
+ private List<String> getBytedanceAccountList(Long adminAdvertiserId, Long ccAccountId, String accessToken, Integer page, Integer pageSize, Integer requestCount) throws InterruptedException {
|
|
|
try {
|
|
try {
|
|
|
Thread.sleep(100);
|
|
Thread.sleep(100);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
@@ -176,6 +178,7 @@ public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListServi
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
log.error("请求字节账户列表失败,进入重试任务,当前请求次数:{}", requestCount);
|
|
log.error("请求字节账户列表失败,进入重试任务,当前请求次数:{}", requestCount);
|
|
|
|
|
+ Thread.sleep(1000);
|
|
|
getBytedanceAccountList(adminAdvertiserId, ccAccountId, accessToken, page, pageSize, requestCount + 1);
|
|
getBytedanceAccountList(adminAdvertiserId, ccAccountId, accessToken, page, pageSize, requestCount + 1);
|
|
|
}
|
|
}
|
|
|
if (!Check.isNull(advertiserLists)) {
|
|
if (!Check.isNull(advertiserLists)) {
|