|
@@ -404,7 +404,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
if (code == 0) {
|
|
|
JSONObject successJson = new JSONObject();
|
|
|
Long unitId = (Long) returnUnitMap.get("unitId");
|
|
|
-
|
|
|
successJson.put("unitId", unitId);
|
|
|
successJson.put("unitName", unitName);
|
|
|
successJson.put("sceneId", scene_id);
|
|
@@ -418,8 +417,8 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- JSONObject appJson = requestJson.getJSONObject("appJson"); // 是否修改应用
|
|
|
- copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, appJson);
|
|
|
+ JSONObject otherJson = requestJson.getJSONObject("otherJson"); // 是否修改应用
|
|
|
+ copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, otherJson);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -654,7 +653,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
}
|
|
|
|
|
|
// 是否修改应用
|
|
|
- JSONObject appJson = requestJson.getJSONObject("appJson");
|
|
|
+ JSONObject otherJson = requestJson.getJSONObject("otherJson");
|
|
|
|
|
|
if (!Check.isNull(groupJson)) {
|
|
|
|
|
@@ -706,7 +705,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, appJson);
|
|
|
+ copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, otherJson);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -744,7 +743,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public JSONObject copyUnit(KuaiShouGroup group, Long copyToCampaignId, CtopOauthToken oauthToken) {
|
|
|
+ public JSONObject copyUnit(KuaiShouGroup group, Long copyToCampaignId, CtopOauthToken oauthToken, JSONObject otherJson) {
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
try {
|
|
|
JSONObject unitJson = new JSONObject();
|
|
@@ -985,7 +984,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- copyCreative(group.getAccountId(), copyUnitId, group.getUnitId(), null);
|
|
|
+ copyCreative(group.getAccountId(), copyUnitId, group.getUnitId(), otherJson);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -1021,7 +1020,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
* @param unitId
|
|
|
*/
|
|
|
@Override
|
|
|
- public void copyCreative(Long accountId, Long unitId, Long copyUnitId, JSONObject appJson) throws Exception {
|
|
|
+ public void copyCreative(Long accountId, Long unitId, Long copyUnitId, JSONObject otherJson) throws Exception {
|
|
|
// 查询当前复制组下的所有非程序化创意
|
|
|
|
|
|
QueryWrapper<KuaiShouCreative> queryWrapper = new QueryWrapper<>();
|
|
@@ -1041,33 +1040,12 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
creativeJson.put("advertiser_id", accountId);
|
|
|
creativeJson.put("unit_id", unitId);
|
|
|
|
|
|
-
|
|
|
- if (Check.isNull(creative.getCreativeMaterialType())) {
|
|
|
+ Integer creativeMaterialType = creative.getCreativeMaterialType();
|
|
|
+ if (Check.isNull(creativeMaterialType)) {
|
|
|
continue;
|
|
|
}
|
|
|
- creativeJson.put("creative_material_type", creative.getCreativeMaterialType());
|
|
|
+ creativeJson.put("creative_material_type", creativeMaterialType);
|
|
|
String click_track_url = creative.getClickTrackUrl();
|
|
|
- if (creative.getCreativeMaterialType() == 4) {
|
|
|
- creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
- creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
|
- // 第三方开始播放监测链接
|
|
|
- if (!Check.isNull(click_track_url)) {
|
|
|
- creativeJson.put("impression_url", click_track_url);
|
|
|
- }
|
|
|
-
|
|
|
- if (!Check.isNull(creative.getImpressionUrl())) {
|
|
|
- creativeJson.put("impression_url", creative.getImpressionUrl());
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- String photo_id = creative.getPhotoId();
|
|
|
- creativeJson.put("photo_id", photo_id);
|
|
|
- String image = creative.getImageToken();
|
|
|
- creativeJson.put("image_token", image);
|
|
|
- if (!Check.isNull(click_track_url)) {
|
|
|
- creativeJson.put("click_track_url", click_track_url);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
String action_bar_text = creative.getActionBarText();
|
|
@@ -1098,22 +1076,108 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
creativeJson.put("actionbar_click_url", creative.getActionbarClickUrl());
|
|
|
}
|
|
|
|
|
|
- // 是否修改应用
|
|
|
- if (!Check.isNull(appJson)) {
|
|
|
- Boolean isUpdate = appJson.getBoolean("isUpdate");
|
|
|
+
|
|
|
+ if (!Check.isNull(otherJson)) {
|
|
|
+ Boolean isUpdate = otherJson.getBoolean("isUpdate"); // 是否修改落地页
|
|
|
if (isUpdate) {
|
|
|
- if (!Check.isNull(appJson.getLong("siteId"))) {
|
|
|
- creativeJson.put("site_id", appJson.getLong("siteId"));
|
|
|
+ if (!Check.isNull(otherJson.getLong("siteId"))) {
|
|
|
+ creativeJson.put("site_id", otherJson.getLong("siteId"));
|
|
|
}
|
|
|
} else {
|
|
|
if (!Check.isNull(creative.getSiteId())) {
|
|
|
creativeJson.put("site_id", creative.getSiteId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ Boolean isUpdateTrackUrl = otherJson.getBoolean("isUpdateTrackUrl"); // 是否修改监测链接
|
|
|
+ if (isUpdateTrackUrl) {
|
|
|
+ String clickTrackUrl = otherJson.getString("clickTrackUrl");
|
|
|
+ if (!Check.isNull(clickTrackUrl)) {
|
|
|
+ if (creativeMaterialType == 4) {
|
|
|
+ creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
+ creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
|
+ // 第三方开始播放监测链接
|
|
|
+ creativeJson.put("impression_url", clickTrackUrl);
|
|
|
+ } else {
|
|
|
+ String photo_id = creative.getPhotoId();
|
|
|
+ creativeJson.put("photo_id", photo_id);
|
|
|
+ String image = creative.getImageToken();
|
|
|
+ creativeJson.put("image_token", image);
|
|
|
+ creativeJson.put("click_track_url", clickTrackUrl);
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (creativeMaterialType == 4) {
|
|
|
+ creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
+ creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
|
+ // 第三方开始播放监测链接
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("impression_url", click_track_url);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(creative.getImpressionUrl())) {
|
|
|
+ creativeJson.put("impression_url", creative.getImpressionUrl());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String photo_id = creative.getPhotoId();
|
|
|
+ creativeJson.put("photo_id", photo_id);
|
|
|
+ String image = creative.getImageToken();
|
|
|
+ creativeJson.put("image_token", image);
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("click_track_url", click_track_url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (creativeMaterialType == 4) {
|
|
|
+ creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
+ creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
|
+ // 第三方开始播放监测链接
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("impression_url", click_track_url);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(creative.getImpressionUrl())) {
|
|
|
+ creativeJson.put("impression_url", creative.getImpressionUrl());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String photo_id = creative.getPhotoId();
|
|
|
+ creativeJson.put("photo_id", photo_id);
|
|
|
+ String image = creative.getImageToken();
|
|
|
+ creativeJson.put("image_token", image);
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("click_track_url", click_track_url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
if (!Check.isNull(creative.getSiteId())) {
|
|
|
creativeJson.put("site_id", creative.getSiteId());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if (creativeMaterialType == 4) {
|
|
|
+ creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
+ creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
|
+ // 第三方开始播放监测链接
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("impression_url", click_track_url);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Check.isNull(creative.getImpressionUrl())) {
|
|
|
+ creativeJson.put("impression_url", creative.getImpressionUrl());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String photo_id = creative.getPhotoId();
|
|
|
+ creativeJson.put("photo_id", photo_id);
|
|
|
+ String image = creative.getImageToken();
|
|
|
+ creativeJson.put("image_token", image);
|
|
|
+ if (!Check.isNull(click_track_url)) {
|
|
|
+ creativeJson.put("click_track_url", click_track_url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
// 安卓下载中间页
|
|
|
Map<String, Object> returnCreativeMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
|