|
@@ -24,6 +24,8 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
+import static java.lang.Integer.valueOf;
|
|
|
|
+
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
public class BatchServiceImpl implements IBatchService {
|
|
public class BatchServiceImpl implements IBatchService {
|
|
@@ -174,10 +176,11 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(scene_id)) {
|
|
if (!Check.isNull(scene_id)) {
|
|
unitJson.put("scene_id", scene_id);
|
|
unitJson.put("scene_id", scene_id);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ Integer sceneId = valueOf(scene_id.get(0).toString());
|
|
// 资源创作方式
|
|
// 资源创作方式
|
|
- if (!Check.isNull(requestJson.getInteger("unitType"))) {
|
|
|
|
- unitJson.put("unit_type", requestJson.getInteger("unitType"));
|
|
|
|
|
|
+ Integer unitType = requestJson.getInteger("unitType");
|
|
|
|
+ if (!Check.isNull(unitType)) {
|
|
|
|
+ unitJson.put("unit_type", unitType);
|
|
}
|
|
}
|
|
|
|
|
|
// 转化目标id
|
|
// 转化目标id
|
|
@@ -282,25 +285,28 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
}
|
|
}
|
|
- //设备价格
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
- targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
- }
|
|
|
|
- //商业兴趣类型
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
- targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
- }
|
|
|
|
- // 商业兴趣
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
- targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
- }
|
|
|
|
- //网红粉丝
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
- targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
- }
|
|
|
|
- //兴趣视频用户
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
- targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
|
|
+
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+ //设备价格
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
+ targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
+ }
|
|
|
|
+ //商业兴趣类型
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
+ targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
+ }
|
|
|
|
+ // 商业兴趣
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
+ targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
+ }
|
|
|
|
+ //网红粉丝
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
+ targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
+ }
|
|
|
|
+ //兴趣视频用户
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
+ targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// APP行为-按分类
|
|
// APP行为-按分类
|
|
if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
@@ -319,26 +325,28 @@ public class BatchServiceImpl implements IBatchService {
|
|
targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
|
|
targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
|
|
}
|
|
}
|
|
|
|
|
|
- JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+ JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
- // 开启智能扩量
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
- intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
- }
|
|
|
|
- //不可突破年龄
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
- }
|
|
|
|
- //不可突破性别
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
- }
|
|
|
|
- // 不可突破地域
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
- }
|
|
|
|
- if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
- targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
|
|
+ // 开启智能扩量
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
+ intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破年龄
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破性别
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
+ }
|
|
|
|
+ // 不可突破地域
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
+ targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
unitJson.put("target", targetJson);
|
|
unitJson.put("target", targetJson);
|
|
@@ -400,6 +408,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
successJson.put("unitName", unitName);
|
|
successJson.put("unitName", unitName);
|
|
successJson.put("sceneId", scene_id);
|
|
successJson.put("sceneId", scene_id);
|
|
successJson.put("ocpxActionType", ocpx_action_type);
|
|
successJson.put("ocpxActionType", ocpx_action_type);
|
|
|
|
+ successJson.put("unitType", unitType);
|
|
successArr.add(successJson);
|
|
successArr.add(successJson);
|
|
|
|
|
|
if (!Check.isNull(type) && "copy".equals(type)) {
|
|
if (!Check.isNull(type) && "copy".equals(type)) {
|
|
@@ -471,6 +480,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(scene_id)) {
|
|
if (!Check.isNull(scene_id)) {
|
|
unitJson.put("scene_id", scene_id);
|
|
unitJson.put("scene_id", scene_id);
|
|
}
|
|
}
|
|
|
|
+ Integer sceneId = valueOf(scene_id.get(0).toString());
|
|
|
|
|
|
// 资源创作方式
|
|
// 资源创作方式
|
|
if (!Check.isNull(requestJson.getInteger("unitType"))) {
|
|
if (!Check.isNull(requestJson.getInteger("unitType"))) {
|
|
@@ -575,29 +585,34 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(requestJson.getInteger("network"))) {
|
|
if (!Check.isNull(requestJson.getInteger("network"))) {
|
|
targetJson.put("network", requestJson.getInteger("network"));
|
|
targetJson.put("network", requestJson.getInteger("network"));
|
|
}
|
|
}
|
|
|
|
+
|
|
//设备品牌
|
|
//设备品牌
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
}
|
|
}
|
|
- //设备价格
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
- targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
- }
|
|
|
|
- //商业兴趣类型
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
- targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
- }
|
|
|
|
- // 商业兴趣
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
- targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
- }
|
|
|
|
- //网红粉丝
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
- targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
- }
|
|
|
|
- //兴趣视频用户
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
- targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //设备价格
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
+ targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
+ }
|
|
|
|
+ //商业兴趣类型
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
+ targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
+ }
|
|
|
|
+ // 商业兴趣
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
+ targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
+ }
|
|
|
|
+ //网红粉丝
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
+ targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
+ }
|
|
|
|
+ //兴趣视频用户
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
+ targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// APP行为-按分类
|
|
// APP行为-按分类
|
|
if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
@@ -618,26 +633,27 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
|
|
|
JSONObject intelliExtendJson = new JSONObject();
|
|
JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
- // 开启智能扩量
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
- intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
- }
|
|
|
|
- //不可突破年龄
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
- }
|
|
|
|
- //不可突破性别
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
- }
|
|
|
|
- // 不可突破地域
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
- }
|
|
|
|
- if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
- targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+ // 开启智能扩量
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
+ intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破年龄
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破性别
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
+ }
|
|
|
|
+ // 不可突破地域
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
+ targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
unitJson.put("target", targetJson);
|
|
unitJson.put("target", targetJson);
|
|
JSONObject groupJson = requestJson.getJSONObject("groupArr");
|
|
JSONObject groupJson = requestJson.getJSONObject("groupArr");
|
|
if (Check.isNull(groupJson)) {
|
|
if (Check.isNull(groupJson)) {
|
|
@@ -746,6 +762,8 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(scene_id)) {
|
|
if (!Check.isNull(scene_id)) {
|
|
unitJson.put("scene_id", scene_id);
|
|
unitJson.put("scene_id", scene_id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Integer sceneId = valueOf(scene_id.get(0).toString());
|
|
// 资源创作方式
|
|
// 资源创作方式
|
|
if (!Check.isNull(group.getUnitType())) {
|
|
if (!Check.isNull(group.getUnitType())) {
|
|
if (!Check.isNull(group.getUnitType())) {
|
|
if (!Check.isNull(group.getUnitType())) {
|
|
@@ -754,7 +772,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
|
|
|
//投放开始时间
|
|
//投放开始时间
|
|
if (!Check.isNull(group.getBeginTime())) {
|
|
if (!Check.isNull(group.getBeginTime())) {
|
|
-
|
|
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
boolean beginTimeBoolean = DateUtils.compare(group.getBeginTime(), nowDate);
|
|
boolean beginTimeBoolean = DateUtils.compare(group.getBeginTime(), nowDate);
|
|
if (beginTimeBoolean) {
|
|
if (beginTimeBoolean) {
|
|
@@ -869,29 +886,32 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(groupTarget.getDeviceBrand())) {
|
|
if (!Check.isNull(groupTarget.getDeviceBrand())) {
|
|
targetJson.put("device_brand", JSONArray.parseArray(groupTarget.getDeviceBrand()));
|
|
targetJson.put("device_brand", JSONArray.parseArray(groupTarget.getDeviceBrand()));
|
|
}
|
|
}
|
|
- //设备价格
|
|
|
|
- if (!Check.isNull(groupTarget.getDevicePrice())) {
|
|
|
|
- targetJson.put("device_price", JSONArray.parseArray(groupTarget.getDevicePrice()));
|
|
|
|
- }
|
|
|
|
- //商业兴趣类型
|
|
|
|
- if (!Check.isNull(groupTarget.getBusinessInterestType())) {
|
|
|
|
- targetJson.put("business_interest_type", groupTarget.getBusinessInterestType());
|
|
|
|
- }
|
|
|
|
- // 商业兴趣
|
|
|
|
- if (!Check.isNull(groupTarget.getBusinessInterest())) {
|
|
|
|
- targetJson.put("business_interest", JSONArray.parseArray(groupTarget.getBusinessInterest()));
|
|
|
|
- }
|
|
|
|
- //网红粉丝
|
|
|
|
- if (!Check.isNull(groupTarget.getFansStar())) {
|
|
|
|
- targetJson.put("fans_star", JSONArray.parseArray(groupTarget.getFansStar()));
|
|
|
|
- }
|
|
|
|
- //兴趣视频用户
|
|
|
|
- if (!Check.isNull(groupTarget.getInterestVideo())) {
|
|
|
|
- targetJson.put("interest_video", JSONArray.parseArray(groupTarget.getInterestVideo()));
|
|
|
|
- }
|
|
|
|
- // APP行为-按分类
|
|
|
|
- if (!Check.isNull(groupTarget.getAppInterest())) {
|
|
|
|
- targetJson.put("app_interest", JSONArray.parseArray(groupTarget.getAppInterest()));
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+
|
|
|
|
+ //设备价格
|
|
|
|
+ if (!Check.isNull(groupTarget.getDevicePrice())) {
|
|
|
|
+ targetJson.put("device_price", JSONArray.parseArray(groupTarget.getDevicePrice()));
|
|
|
|
+ }
|
|
|
|
+ //商业兴趣类型
|
|
|
|
+ if (!Check.isNull(groupTarget.getBusinessInterestType())) {
|
|
|
|
+ targetJson.put("business_interest_type", groupTarget.getBusinessInterestType());
|
|
|
|
+ }
|
|
|
|
+ // 商业兴趣
|
|
|
|
+ if (!Check.isNull(groupTarget.getBusinessInterest())) {
|
|
|
|
+ targetJson.put("business_interest", JSONArray.parseArray(groupTarget.getBusinessInterest()));
|
|
|
|
+ }
|
|
|
|
+ //网红粉丝
|
|
|
|
+ if (!Check.isNull(groupTarget.getFansStar())) {
|
|
|
|
+ targetJson.put("fans_star", JSONArray.parseArray(groupTarget.getFansStar()));
|
|
|
|
+ }
|
|
|
|
+ //兴趣视频用户
|
|
|
|
+ if (!Check.isNull(groupTarget.getInterestVideo())) {
|
|
|
|
+ targetJson.put("interest_video", JSONArray.parseArray(groupTarget.getInterestVideo()));
|
|
|
|
+ }
|
|
|
|
+ // APP行为-按分类
|
|
|
|
+ if (!Check.isNull(groupTarget.getAppInterest())) {
|
|
|
|
+ targetJson.put("app_interest", JSONArray.parseArray(groupTarget.getAppInterest()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// APP行为-按APP名称
|
|
// APP行为-按APP名称
|
|
if (!Check.isNull(groupTarget.getAppIds())) {
|
|
if (!Check.isNull(groupTarget.getAppIds())) {
|
|
@@ -906,26 +926,30 @@ public class BatchServiceImpl implements IBatchService {
|
|
targetJson.put("exclude_population", JSONArray.parseArray(groupTarget.getExcludePopulation()));
|
|
targetJson.put("exclude_population", JSONArray.parseArray(groupTarget.getExcludePopulation()));
|
|
}
|
|
}
|
|
|
|
|
|
- JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
|
|
- // 开启智能扩量
|
|
|
|
- if (!Check.isNull(groupTarget.getIsOpen())) {
|
|
|
|
- intelliExtendJson.put("is_open", groupTarget.getIsOpen());
|
|
|
|
- }
|
|
|
|
- //不可突破年龄
|
|
|
|
- if (!Check.isNull(groupTarget.getNoAgeBreak())) {
|
|
|
|
- intelliExtendJson.put("no_age_break", groupTarget.getNoAgeBreak());
|
|
|
|
- }
|
|
|
|
- //不可突破性别
|
|
|
|
- if (!Check.isNull(groupTarget.getNoGenderBreak())) {
|
|
|
|
- intelliExtendJson.put("no_gender_break", groupTarget.getNoGenderBreak());
|
|
|
|
- }
|
|
|
|
- // 不可突破地域
|
|
|
|
- if (!Check.isNull(groupTarget.getNoAreaBreak())) {
|
|
|
|
- intelliExtendJson.put("no_area_break", groupTarget.getNoAreaBreak());
|
|
|
|
- }
|
|
|
|
- if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
- targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
|
|
+
|
|
|
|
+ JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
+
|
|
|
|
+ // 开启智能扩量
|
|
|
|
+ if (!Check.isNull(groupTarget.getIsOpen())) {
|
|
|
|
+ intelliExtendJson.put("is_open", groupTarget.getIsOpen());
|
|
|
|
+ }
|
|
|
|
+ //不可突破年龄
|
|
|
|
+ if (!Check.isNull(groupTarget.getNoAgeBreak())) {
|
|
|
|
+ intelliExtendJson.put("no_age_break", groupTarget.getNoAgeBreak());
|
|
|
|
+ }
|
|
|
|
+ //不可突破性别
|
|
|
|
+ if (!Check.isNull(groupTarget.getNoGenderBreak())) {
|
|
|
|
+ intelliExtendJson.put("no_gender_break", groupTarget.getNoGenderBreak());
|
|
|
|
+ }
|
|
|
|
+ // 不可突破地域
|
|
|
|
+ if (!Check.isNull(groupTarget.getNoAreaBreak())) {
|
|
|
|
+ intelliExtendJson.put("no_area_break", groupTarget.getNoAreaBreak());
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
+ targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
unitJson.put("target", targetJson);
|
|
unitJson.put("target", targetJson);
|
|
@@ -1244,9 +1268,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
creativeJson.put("unit_id", unitId);
|
|
creativeJson.put("unit_id", unitId);
|
|
|
|
|
|
// 素材类型
|
|
// 素材类型
|
|
- if (!Check.isNull(requestJson.get("creativeMaterialType"))) {
|
|
|
|
- creativeJson.put("creative_material_type", requestJson.get("creativeMaterialType"));
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
String action_bar_text = requestJson.getString("actionBarText");
|
|
String action_bar_text = requestJson.getString("actionBarText");
|
|
String click_track_url = requestJson.getString("clickTrackUrl");
|
|
String click_track_url = requestJson.getString("clickTrackUrl");
|
|
String site_id = requestJson.getString("siteId");
|
|
String site_id = requestJson.getString("siteId");
|
|
@@ -1260,6 +1282,11 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(dataJsons)) {
|
|
if (!Check.isNull(dataJsons)) {
|
|
for (int i = 0; i < dataJsons.size(); i++) {
|
|
for (int i = 0; i < dataJsons.size(); i++) {
|
|
JSONObject dataJson = dataJsons.getJSONObject(i);
|
|
JSONObject dataJson = dataJsons.getJSONObject(i);
|
|
|
|
+
|
|
|
|
+ String creativeMaterialType = dataJson.getString("creativeMaterialType");
|
|
|
|
+ String shortSlogan = dataJson.getString("shortSlogan");
|
|
|
|
+
|
|
|
|
+
|
|
if (!Check.isNull(dataJsons)) {
|
|
if (!Check.isNull(dataJsons)) {
|
|
String description = dataJson.getString("description");
|
|
String description = dataJson.getString("description");
|
|
String photo_id = dataJson.getString("photoId");
|
|
String photo_id = dataJson.getString("photoId");
|
|
@@ -1274,10 +1301,20 @@ public class BatchServiceImpl implements IBatchService {
|
|
creativeJson.put("description", description.trim());
|
|
creativeJson.put("description", description.trim());
|
|
creativeJson.put("creative_name", name);
|
|
creativeJson.put("creative_name", name);
|
|
creativeJson.put("photo_id", photo_id);
|
|
creativeJson.put("photo_id", photo_id);
|
|
- creativeJson.put("click_track_url", click_track_url);
|
|
|
|
|
|
+
|
|
if (!Check.isNull(site_id)) {
|
|
if (!Check.isNull(site_id)) {
|
|
creativeJson.put("site_id", site_id);
|
|
creativeJson.put("site_id", site_id);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(creativeMaterialType)) {
|
|
|
|
+ creativeJson.put("creative_material_type", creativeMaterialType);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (creativeMaterialType.equals("4")) {
|
|
|
|
+ if (!Check.isNull("shortSlogan")) {
|
|
|
|
+ creativeJson.put("short_slogan", shortSlogan);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
String imageToken = null;
|
|
String imageToken = null;
|
|
String signature = imageJson.getString("signature");
|
|
String signature = imageJson.getString("signature");
|
|
if (!Check.isNull(signature)) {
|
|
if (!Check.isNull(signature)) {
|
|
@@ -1300,7 +1337,16 @@ public class BatchServiceImpl implements IBatchService {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- creativeJson.put("image_token", imageToken);
|
|
|
|
|
|
+ if (creativeMaterialType.equals("4")) {
|
|
|
|
+ JSONArray tokenArr = new JSONArray();
|
|
|
|
+ tokenArr.add(imageToken);
|
|
|
|
+ creativeJson.put("image_tokens", tokenArr);
|
|
|
|
+ creativeJson.put("click_track_url", click_track_url);
|
|
|
|
+ creativeJson.put("impression_url", click_track_url);
|
|
|
|
+ } else {
|
|
|
|
+ creativeJson.put("image_token", imageToken);
|
|
|
|
+ creativeJson.put("click_track_url", click_track_url);
|
|
|
|
+ }
|
|
Map<String, Object> returnUnitMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
|
|
Map<String, Object> returnUnitMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
|
|
if (!Check.isNullMap(returnUnitMap)) {
|
|
if (!Check.isNullMap(returnUnitMap)) {
|
|
Integer code = (Integer) returnUnitMap.get("code");
|
|
Integer code = (Integer) returnUnitMap.get("code");
|
|
@@ -1410,6 +1456,8 @@ public class BatchServiceImpl implements IBatchService {
|
|
unitJson.put("scene_id", scene_id);
|
|
unitJson.put("scene_id", scene_id);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Integer sceneId = Integer.valueOf(scene_id.get(0).toString());
|
|
|
|
+
|
|
// 出价
|
|
// 出价
|
|
if (!Check.isNull(requestJson.getLong("bid"))) {
|
|
if (!Check.isNull(requestJson.getLong("bid"))) {
|
|
unitJson.put("bid", requestJson.getLong("bid"));
|
|
unitJson.put("bid", requestJson.getLong("bid"));
|
|
@@ -1525,33 +1573,37 @@ public class BatchServiceImpl implements IBatchService {
|
|
if (!Check.isNull(requestJson.getInteger("network"))) {
|
|
if (!Check.isNull(requestJson.getInteger("network"))) {
|
|
targetJson.put("network", requestJson.getInteger("network"));
|
|
targetJson.put("network", requestJson.getInteger("network"));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
//设备品牌
|
|
//设备品牌
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
|
|
}
|
|
}
|
|
- //设备价格
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
- targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
- }
|
|
|
|
- //商业兴趣类型
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
- targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
- }
|
|
|
|
- // 商业兴趣
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
- targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
- }
|
|
|
|
- //网红粉丝
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
- targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
- }
|
|
|
|
- //兴趣视频用户
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
- targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
- }
|
|
|
|
- // APP行为-按分类
|
|
|
|
- if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
|
|
- targetJson.put("app_interest", requestJson.getJSONArray("appInterest"));
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+ //设备价格
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
|
|
|
|
+ targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
|
|
|
|
+ }
|
|
|
|
+ //商业兴趣类型
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
|
|
|
|
+ targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
|
|
|
|
+ }
|
|
|
|
+ // 商业兴趣
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
|
|
|
|
+ targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
|
|
|
|
+ }
|
|
|
|
+ //网红粉丝
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
|
|
|
|
+ targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
|
|
|
|
+ }
|
|
|
|
+ //兴趣视频用户
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
|
|
|
|
+ targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
|
|
|
|
+ }
|
|
|
|
+ // APP行为-按分类
|
|
|
|
+ if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
|
|
|
|
+ targetJson.put("app_interest", requestJson.getJSONArray("appInterest"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// APP行为-按APP名称
|
|
// APP行为-按APP名称
|
|
if (!Check.isNull(requestJson.getJSONArray("appIds"))) {
|
|
if (!Check.isNull(requestJson.getJSONArray("appIds"))) {
|
|
@@ -1566,26 +1618,28 @@ public class BatchServiceImpl implements IBatchService {
|
|
targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
|
|
targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
|
|
}
|
|
}
|
|
|
|
|
|
- JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
+ if (sceneId != 5) {
|
|
|
|
+ JSONObject intelliExtendJson = new JSONObject();
|
|
|
|
|
|
- // 开启智能扩量
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
- intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
- }
|
|
|
|
- //不可突破年龄
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
- }
|
|
|
|
- //不可突破性别
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
- }
|
|
|
|
- // 不可突破地域
|
|
|
|
- if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
- intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
- }
|
|
|
|
- if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
- targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
|
|
+ // 开启智能扩量
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("isOpen"))) {
|
|
|
|
+ intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破年龄
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
|
|
|
|
+ }
|
|
|
|
+ //不可突破性别
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
|
|
|
|
+ }
|
|
|
|
+ // 不可突破地域
|
|
|
|
+ if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
|
|
|
|
+ intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(intelliExtendJson)) {
|
|
|
|
+ targetJson.put("intelli_extend", intelliExtendJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
unitJson.put("target", targetJson);
|
|
unitJson.put("target", targetJson);
|
|
@@ -1695,6 +1749,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
|
|
|
String result = HttpUtils.httpPostRequest(url, param, headers);
|
|
String result = HttpUtils.httpPostRequest(url, param, headers);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
|
+ log.info("获取联盟白名单,accountId:{},data:{}", accountId, resultJson);
|
|
if (!Check.isNull(resultJson)) {
|
|
if (!Check.isNull(resultJson)) {
|
|
Integer code = resultJson.getInteger("code");
|
|
Integer code = resultJson.getInteger("code");
|
|
if (code == 0) {
|
|
if (code == 0) {
|