|
@@ -15,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
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;
|
|
|
-
|
|
|
|
|
import java.time.Instant;
|
|
import java.time.Instant;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
@@ -195,14 +194,46 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
entity.put("advertiser_id", advertiserId);
|
|
entity.put("advertiser_id", advertiserId);
|
|
|
JSONObject promotionMaterials = entity.getJSONObject("promotion_materials");
|
|
JSONObject promotionMaterials = entity.getJSONObject("promotion_materials");
|
|
|
if (!Check.isNull(promotionMaterials)) {
|
|
if (!Check.isNull(promotionMaterials)) {
|
|
|
|
|
+ String playletSeriesUrlList = promotionMaterials.getString("playlet_series_url_list");
|
|
|
entity.put("external_url_material_list", promotionMaterials.getString("external_url_material_list"));
|
|
entity.put("external_url_material_list", promotionMaterials.getString("external_url_material_list"));
|
|
|
- entity.put("playlet_series_url_list", promotionMaterials.getString("playlet_series_url_list"));
|
|
|
|
|
|
|
+ entity.put("playlet_series_url_list", playletSeriesUrlList);
|
|
|
JSONObject miniProgramInfo = promotionMaterials.getJSONObject("mini_program_info");
|
|
JSONObject miniProgramInfo = promotionMaterials.getJSONObject("mini_program_info");
|
|
|
if (!Check.isNull(miniProgramInfo)) {
|
|
if (!Check.isNull(miniProgramInfo)) {
|
|
|
entity.put("params", miniProgramInfo.getString("params"));
|
|
entity.put("params", miniProgramInfo.getString("params"));
|
|
|
entity.put("app_id", miniProgramInfo.getString("app_id"));
|
|
entity.put("app_id", miniProgramInfo.getString("app_id"));
|
|
|
entity.put("url", miniProgramInfo.getString("url"));
|
|
entity.put("url", miniProgramInfo.getString("url"));
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!Check.isNull(playletSeriesUrlList)){
|
|
|
|
|
+ try {
|
|
|
|
|
+ JSONArray playletUrlArr = JSONObject.parseArray(playletSeriesUrlList);
|
|
|
|
|
+ String playletUrl = playletUrlArr.getString(0);
|
|
|
|
|
+ if (StringUtils.isNotBlank(playletUrl)) {
|
|
|
|
|
+ // 解析 playlet_id
|
|
|
|
|
+ String playletId = HttpUtils.extractQueryParam(playletUrl, "playlet_id");
|
|
|
|
|
+ if (StringUtils.isNotBlank(playletId)) {
|
|
|
|
|
+ entity.put("playlet_id", playletId);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 解析 advertise_param 并 base64 解码
|
|
|
|
|
+ String advertiseParam = HttpUtils.extractQueryParam(playletUrl, "advertise_param");
|
|
|
|
|
+ if (StringUtils.isNotBlank(advertiseParam)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String decodedParam = new String(Base64.getDecoder().decode(advertiseParam), "UTF-8");
|
|
|
|
|
+ JSONObject advertiseObj = JSONObject.parseObject(decodedParam);
|
|
|
|
|
+ if (!Check.isNull(advertiseObj)) {
|
|
|
|
|
+ Long mediaId = advertiseObj.getLong("media_id");
|
|
|
|
|
+ if (mediaId != null) {
|
|
|
|
|
+ entity.put("account_mid", mediaId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("广告({})advertise_param base64解码失败: {}", entity.getString("promotion_id"), advertiseParam);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ log.error("广告({})playlet_series_url_list字段解析失败", entity.getString("promotion_id"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
JSONObject nativeSetting = entity.getJSONObject("native_setting");
|
|
JSONObject nativeSetting = entity.getJSONObject("native_setting");
|
|
|
if (!Check.isNull(nativeSetting)) {
|
|
if (!Check.isNull(nativeSetting)) {
|
|
@@ -210,6 +241,8 @@ public class BytedanceCdpProjectServiceImpl implements IBytedanceCdpProjectServi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void getProjectList(Long advertiserId, JSONArray ids, String type, String date, Long errorId, Integer isLog) {
|
|
public void getProjectList(Long advertiserId, JSONArray ids, String type, String date, Long errorId, Integer isLog) {
|
|
|
this.getProjectListVo(advertiserId, ids, type, date, 1, 1, errorId, isLog);
|
|
this.getProjectListVo(advertiserId, ids, type, date, 1, 1, errorId, isLog);
|