|
@@ -9,6 +9,7 @@ import cn.com.ctop.job.bytedance.utils.doris.sink.DorisMultiTableStreamLoadManag
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -530,6 +531,8 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
}
|
|
}
|
|
|
if (nextPage) {
|
|
if (nextPage) {
|
|
|
rebackadqCreativesVo(accountId, accessToken, startDate, endDate, page + 1, isDeleted, 1);
|
|
rebackadqCreativesVo(accountId, accessToken, startDate, endDate, page + 1, isDeleted, 1);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ log.info("账户({})获取动态创意完成", accountId);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -633,6 +636,56 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
private void getAppId(JSONObject object) {
|
|
private void getAppId(JSONObject object) {
|
|
|
JSONObject creativeComponents = object.getJSONObject("creative_components");
|
|
JSONObject creativeComponents = object.getJSONObject("creative_components");
|
|
|
if (!Check.isNull(creativeComponents)) {
|
|
if (!Check.isNull(creativeComponents)) {
|
|
|
|
|
+ List<String> imageIds = new ArrayList<>();
|
|
|
|
|
+ List<String> videoIds = new ArrayList<>();
|
|
|
|
|
+ JSONArray videoArr = creativeComponents.getJSONArray("video");
|
|
|
|
|
+ if(!Check.isNull(videoArr)) {
|
|
|
|
|
+ for (int i = 0; i < videoArr.size(); i++) {
|
|
|
|
|
+ JSONObject obj = videoArr.getJSONObject(i);
|
|
|
|
|
+ JSONObject value = obj.getJSONObject("value");
|
|
|
|
|
+ if (!Check.isNull(value)) {
|
|
|
|
|
+ String videoId = value.getString("video_id");
|
|
|
|
|
+ if (StringUtils.isNotBlank(videoId)) videoIds.add(videoId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONArray imageArr = creativeComponents.getJSONArray("image");
|
|
|
|
|
+ if(!Check.isNull(imageArr)) {
|
|
|
|
|
+ for (int i = 0; i < imageArr.size(); i++) {
|
|
|
|
|
+ JSONObject obj = imageArr.getJSONObject(i);
|
|
|
|
|
+ JSONObject value = obj.getJSONObject("value");
|
|
|
|
|
+ if (!Check.isNull(value)) {
|
|
|
|
|
+ String imageId = value.getString("image_id");
|
|
|
|
|
+ if (StringUtils.isNotBlank(imageId)) imageIds.add(imageId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONArray imageListArr = creativeComponents.getJSONArray("image_list");
|
|
|
|
|
+ if(!Check.isNull(imageListArr)) {
|
|
|
|
|
+ for (int i = 0; i < imageListArr.size(); i++) {
|
|
|
|
|
+ JSONObject obj = imageListArr.getJSONObject(i);
|
|
|
|
|
+ JSONObject value = obj.getJSONObject("value");
|
|
|
|
|
+ if (!Check.isNull(value)) {
|
|
|
|
|
+ JSONArray list = value.getJSONArray("list");
|
|
|
|
|
+ if (!Check.isNull(list)) {
|
|
|
|
|
+ for (int j = 0; j < list.size(); j++) {
|
|
|
|
|
+ JSONObject image = list.getJSONObject(j);
|
|
|
|
|
+ if (!Check.isNull(image)) {
|
|
|
|
|
+ String imageId = image.getString("image_id");
|
|
|
|
|
+ if (StringUtils.isNotBlank(imageId)) imageIds.add(imageId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Check.isNull(videoIds)){
|
|
|
|
|
+ object.put("video_list", StringUtils.join(videoIds, ","));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Check.isNull(imageIds)){
|
|
|
|
|
+ object.put("image_list", StringUtils.join(imageIds, ","));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
JSONArray textLink = creativeComponents.getJSONArray("text_link");
|
|
JSONArray textLink = creativeComponents.getJSONArray("text_link");
|
|
|
if (!Check.isNull(textLink)) {
|
|
if (!Check.isNull(textLink)) {
|
|
|
JSONObject value = textLink.getJSONObject(0).getJSONObject("value");
|
|
JSONObject value = textLink.getJSONObject(0).getJSONObject("value");
|