|
|
@@ -435,14 +435,14 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void getAdqCreatives(Long advertiserId, String date) {
|
|
|
+ public void getAdqCreatives(Long advertiserId, String startDate,String endDate) {
|
|
|
try {
|
|
|
String accessToken = tokenMapper.onlyGetADQToken(advertiserId);
|
|
|
if (Check.isNull(accessToken)) {
|
|
|
log.error("账户({})accessToken is null", advertiserId);
|
|
|
return;
|
|
|
}
|
|
|
- this.rebackadqCreativesVo(advertiserId, accessToken, date, 1, true, 1);
|
|
|
+ this.rebackadqCreativesVo(advertiserId, accessToken, startDate, endDate, 1, true, 1);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
log.error("账户({})获取动态创意异常", e.getMessage());
|
|
|
@@ -450,7 +450,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void rebackadqCreativesVo(Long accountId, String accessToken, String date, Integer page, Boolean isDeleted, int count) throws Exception {
|
|
|
+ private void rebackadqCreativesVo(Long accountId, String accessToken, String startDate, String endDate, Integer page, Boolean isDeleted, int count) throws Exception {
|
|
|
boolean nextPage = false;
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
@@ -461,13 +461,13 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
param.put("account_id", accountId);
|
|
|
param.put("page", page);
|
|
|
param.put("page_size", 100);
|
|
|
- if (!Check.isNull(date)) {
|
|
|
+ if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
|
|
|
JSONArray filtering = new JSONArray();
|
|
|
JSONObject greObj = new JSONObject();
|
|
|
greObj.put("field", "last_modified_time");
|
|
|
greObj.put("operator", "GREATER_EQUALS");
|
|
|
JSONArray startDateVls = new JSONArray();
|
|
|
- startDateVls.add(String.valueOf(DateUtils.dt2milli(date + " 00:00:00")));
|
|
|
+ startDateVls.add(String.valueOf(DateUtils.dt2milli(startDate + " 00:00:00")));
|
|
|
// startDateVls.add(String.valueOf(DateUtils.dt2milli( "2025-02-15 00:00:00")));
|
|
|
greObj.put("values", startDateVls);
|
|
|
filtering.add(greObj);
|
|
|
@@ -475,7 +475,7 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
lesObj.put("field", "last_modified_time");
|
|
|
lesObj.put("operator", "LESS_EQUALS");
|
|
|
JSONArray endDateVls = new JSONArray();
|
|
|
- endDateVls.add(String.valueOf(DateUtils.dt2milli(date + " 23:59:59")));
|
|
|
+ endDateVls.add(String.valueOf(DateUtils.dt2milli(endDate + " 23:59:59")));
|
|
|
// endDateVls.add(String.valueOf(DateUtils.dt2milli("2025-07-09 23:59:59")));
|
|
|
lesObj.put("values", endDateVls);
|
|
|
filtering.add(lesObj);
|
|
|
@@ -517,14 +517,14 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
} else {
|
|
|
if (count <= 4) {
|
|
|
Thread.sleep(500);
|
|
|
- rebackadqCreativesVo(accountId, accessToken, date, page, isDeleted, count + 1);
|
|
|
+ rebackadqCreativesVo(accountId, accessToken, startDate, endDate, page, isDeleted, count + 1);
|
|
|
} else {
|
|
|
log.error("账户({})获取动态创意失败,入参:{}\n,结果:{}", accountId, JSONObject.toJSONString(param), obj);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (nextPage) {
|
|
|
- rebackadqCreativesVo(accountId, accessToken, date, page + 1, isDeleted, 1);
|
|
|
+ rebackadqCreativesVo(accountId, accessToken, startDate ,endDate, page + 1, isDeleted, 1);
|
|
|
}
|
|
|
}
|
|
|
|