|
@@ -199,6 +199,12 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
|
|
|
BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
|
|
|
unitLevelOperationRecord.setGroupName(unitName);
|
|
|
+ if (!Check.isNull(strategy.getCpaBid())) {
|
|
|
+ unitLevelOperationRecord.setCpaBid(Integer.valueOf(strategy.getCpaBid() + ""));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(strategy.getBid())) {
|
|
|
+ unitLevelOperationRecord.setBid(Integer.valueOf(strategy.getBid() + ""));
|
|
|
+ }
|
|
|
unitLevelOperationRecord.setCreateTime(new Date());
|
|
|
unitLevelOperationRecord.setStatus(unitCode);
|
|
|
unitLevelOperationRecord.setMessage(unitMessage);
|
|
@@ -674,8 +680,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
// 拼装创建组的入参 json
|
|
|
JSONObject unitParams = new JSONObject();
|
|
|
Integer unitType = strategy.getUnitType();
|
|
|
-
|
|
|
-
|
|
|
//创意制作方式
|
|
|
unitParams.put("unit_type", unitType);
|
|
|
unitParams.put("advertiser_id", token.getAccountId());
|
|
@@ -737,6 +741,10 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
if (!Check.isNull(appId)) {
|
|
|
unitParams.put("app_id", appId);
|
|
|
}
|
|
|
+ // 直达链接
|
|
|
+ if (!Check.isNull(strategy.getSchemaUri())) {
|
|
|
+ unitParams.put("schema_uri", strategy.getSchemaUri());
|
|
|
+ }
|
|
|
// 优先从系统应用商店下载
|
|
|
if (null != strategy.getUseAppMarket()) {
|
|
|
unitParams.put("use_app_market", strategy.getUseAppMarket());
|
|
@@ -745,7 +753,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
unitParams.put("app_store", JSON.parseArray(strategy.getAppStore()));
|
|
|
}
|
|
|
} else if (campaignType == 3) { // 获取电商下单
|
|
|
-
|
|
|
//url类型
|
|
|
if (!Check.isNull(strategy.getUrlType())) {
|
|
|
unitParams.put("url_type", strategy.getUrlType());
|
|
@@ -882,17 +889,36 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
if (null != strategy.getDevicePrice() && !"".equals(strategy.getDevicePrice()) && !"[]".equals(strategy.getDevicePrice())) {
|
|
|
targetJsonObject.put("device_price", JSON.parseArray(strategy.getDevicePrice()));
|
|
|
}
|
|
|
- if (null != strategy.getPopulation() && !"".equals(strategy.getPopulation())) {
|
|
|
- JSONArray population = JSON.parseArray(strategy.getPopulation());
|
|
|
- targetJsonObject.put("population", population);
|
|
|
- }
|
|
|
+
|
|
|
if (null != strategy.getFilterConvertedLevel() && strategy.getFilterConvertedLevel() != 0) {
|
|
|
targetJsonObject.put("filter_converted_level", strategy.getFilterConvertedLevel());
|
|
|
}
|
|
|
- if (null != strategy.getExcludePopulation() && !"".equals(strategy.getExcludePopulation())) {
|
|
|
- JSONArray excludePopulation = JSON.parseArray(strategy.getExcludePopulation());
|
|
|
- targetJsonObject.put("exclude_population", excludePopulation);
|
|
|
+
|
|
|
+ JSONArray appInterest = JSONArray.parseArray(strategy.getAppInterest());
|
|
|
+ if (!Check.isNull(appInterest)) {
|
|
|
+ targetJsonObject.put("app_interest", appInterest);
|
|
|
+ }
|
|
|
+ // APP行为-按APP名称
|
|
|
+ JSONArray appIds = JSONArray.parseArray(strategy.getAppIds());
|
|
|
+ if (!Check.isNull(appIds)) {
|
|
|
+ targetJsonObject.put("app_ids", appIds);
|
|
|
+ }
|
|
|
+ // 人群包定向
|
|
|
+ JSONArray populationString = JSONArray.parseArray(strategy.getPopulation());
|
|
|
+ if (!Check.isNull(populationString)) {
|
|
|
+ targetJsonObject.put("population", populationString);
|
|
|
+ }
|
|
|
+ // 人群包排除
|
|
|
+ JSONArray excludePopulationString = JSONArray.parseArray(strategy.getExcludePopulation());
|
|
|
+ if (!Check.isNull(excludePopulationString)) {
|
|
|
+ targetJsonObject.put("exclude_population", excludePopulationString);
|
|
|
}
|
|
|
+ // 付费人群包id
|
|
|
+ JSONArray paidAudienceString = JSONArray.parseArray(strategy.getPaidAudience());
|
|
|
+ if (!Check.isNull(paidAudienceString)) {
|
|
|
+ targetJsonObject.put("paid_audience", paidAudienceString);
|
|
|
+ }
|
|
|
+
|
|
|
//是否开启智能扩量
|
|
|
if (null != strategy.getIsOpen() && strategy.getIsOpen().equals(1)) {
|
|
|
JSONObject intelliExtend = new JSONObject();
|
|
@@ -1039,30 +1065,30 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
|
|
|
}
|
|
|
// APP行为-按分类
|
|
|
- String appInterestString = strategy.getAppInterest();
|
|
|
- if (null != appInterestString && !"".equals(appInterestString.trim())) {
|
|
|
- target.put("app_interest", JSON.parseArray(appInterestString));
|
|
|
+ JSONArray appInterest = JSONArray.parseArray(strategy.getAppInterest());
|
|
|
+ if (!Check.isNull(appInterest)) {
|
|
|
+ target.put("app_interest", appInterest);
|
|
|
}
|
|
|
// APP行为-按APP名称
|
|
|
- String appIdsString = strategy.getAppIds();
|
|
|
- if (null != appIdsString && !"".equals(appIdsString.trim())) {
|
|
|
- target.put("app_ids", JSON.parseArray(appIdsString));
|
|
|
+ JSONArray appIds = JSONArray.parseArray(strategy.getAppIds());
|
|
|
+ if (!Check.isNull(appIds)) {
|
|
|
+ target.put("app_ids", appIds);
|
|
|
}
|
|
|
|
|
|
// 人群包定向
|
|
|
- String populationString = strategy.getPopulation();
|
|
|
- if (null != populationString && !"".equals(populationString.trim())) {
|
|
|
- target.put("population", JSON.parseArray(populationString));
|
|
|
+ JSONArray populationString = JSONArray.parseArray(strategy.getPopulation());
|
|
|
+ if (!Check.isNull(populationString)) {
|
|
|
+ target.put("population", populationString);
|
|
|
}
|
|
|
// 人群包排除
|
|
|
- String excludePopulationString = strategy.getExcludePopulation();
|
|
|
- if (null != excludePopulationString && !"".equals(excludePopulationString.trim())) {
|
|
|
- target.put("exclude_population", JSON.parseArray(excludePopulationString));
|
|
|
+ JSONArray excludePopulationString = JSONArray.parseArray(strategy.getExcludePopulation());
|
|
|
+ if (!Check.isNull(excludePopulationString)) {
|
|
|
+ target.put("exclude_population", excludePopulationString);
|
|
|
}
|
|
|
// 付费人群包id
|
|
|
- String paidAudienceString = strategy.getPaidAudience();
|
|
|
- if (null != paidAudienceString && !"".equals(paidAudienceString.trim())) {
|
|
|
- target.put("paid_audience", JSON.parseArray(paidAudienceString));
|
|
|
+ JSONArray paidAudienceString = JSONArray.parseArray(strategy.getPaidAudience());
|
|
|
+ if (!Check.isNull(paidAudienceString)) {
|
|
|
+ target.put("paid_audience", paidAudienceString);
|
|
|
}
|
|
|
if (Check.isNull(strategy.getBehaviorInterest())) {
|
|
|
target.put("behavior_interest", JSON.parseObject(strategy.getBehaviorInterest()));
|
|
@@ -1071,6 +1097,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, CtopOauthToken token, JSONObject creativeParams,
|
|
|
Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
|
|
|
int imageNumber, AiKuaishouAdvertiserStrategy strategy, String uuid, String appVersion) {
|