|
@@ -8,19 +8,43 @@ import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
|
|
import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
|
|
import cn.com.ctop.common.module.utils.PropertiesUtils;
|
|
import cn.com.ctop.common.module.utils.PropertiesUtils;
|
|
-import cn.com.ctop.kuaishou.modules.ai.entity.*;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaiShouAppInfo;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountCreativeOverrunInfo;
|
|
import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeAdsenceTypeEnum;
|
|
import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeAdsenceTypeEnum;
|
|
import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeMatTypeEnum;
|
|
import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeMatTypeEnum;
|
|
-import cn.com.ctop.kuaishou.modules.ai.service.*;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaiShouAppInfoService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCampaignLevelOperationRecordService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreativeLevelOperationRecordService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouUnitLevelOperationRecordService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouAppMultipleBidsService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountCreativeOverrunInfoService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouLandpagePackageService;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
|
|
-import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.channel.service.IKuaishouChannelService;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -29,7 +53,14 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Random;
|
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
@@ -64,6 +95,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
private IKuaishouLandpagePackageService landpagePackageService;
|
|
private IKuaishouLandpagePackageService landpagePackageService;
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouAppMultipleBidsService kuaiShouAppMultipleBidsService;
|
|
private IKuaiShouAppMultipleBidsService kuaiShouAppMultipleBidsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouChannelService channelService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -117,7 +150,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
|
|
log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid);
|
|
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid, null);
|
|
for (KuaiShouVideoGet videoItem : allVideos) {
|
|
for (KuaiShouVideoGet videoItem : allVideos) {
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
if (unitOverrun) {
|
|
if (unitOverrun) {
|
|
@@ -137,8 +170,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
//开始创建组+创意
|
|
//开始创建组+创意
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appInfo.getAppId());
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
|
|
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appInfo.getAppId(), null);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId(), null);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
@@ -164,7 +197,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
videoCnt--;
|
|
videoCnt--;
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
@@ -209,10 +242,10 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
log.info("该账户创意创建已超限=>accountId:{}", accountId);
|
|
log.info("该账户创意创建已超限=>accountId:{}", accountId);
|
|
return 0L;
|
|
return 0L;
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, null);
|
|
//开始创建组+创意
|
|
//开始创建组+创意
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId);
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|
|
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, null);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, null);
|
|
unitParams.remove("cpa_bid");
|
|
unitParams.remove("cpa_bid");
|
|
unitParams.put("cpa_bid", multipleBids.getCpaBid());
|
|
unitParams.put("cpa_bid", multipleBids.getCpaBid());
|
|
if (!Check.isNull(multipleBids.getDeepConversionBid())) {
|
|
if (!Check.isNull(multipleBids.getDeepConversionBid())) {
|
|
@@ -245,7 +278,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
videoCnt--;
|
|
videoCnt--;
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
@@ -262,19 +295,47 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
Long appId = null;
|
|
Long appId = null;
|
|
|
|
+ String appName = null;
|
|
if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
|
|
if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
|
|
appId = JSONArray.parseArray(strategy.getAppIdArray()).getLong(0);
|
|
appId = JSONArray.parseArray(strategy.getAppIdArray()).getLong(0);
|
|
if (Check.isNull(appId)) {
|
|
if (Check.isNull(appId)) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
|
|
+ KuaiShouAppList appInfo = appListService.getAppInfo(accountId, appId);
|
|
|
|
+ if (!Check.isNull(appInfo)) {
|
|
|
|
+ appName = appInfo.getAppName();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
|
|
|
+ //渠道号应用层级,account-账户,plan-计划,group-组
|
|
|
|
+ String level = strategy.getUsageLevel();
|
|
|
|
+ Integer useChannel = strategy.getUseChannel();//0不使用,1使用
|
|
|
|
+ KuaishouChannel channel = null;
|
|
|
|
+ if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
|
|
|
|
+ try {
|
|
|
|
+ Result<Object> result = channelService.queryChannel(accountId, level, appName);
|
|
|
|
+ Integer code = result.getCode();
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ channel = (KuaishouChannel) result.getResult();
|
|
|
|
+ if (Check.isNull(channel)) {
|
|
|
|
+ log.info("账户:{},{}", accountId, result.getMessage());
|
|
|
|
+ return videoCnt;
|
|
|
|
+ } else {
|
|
|
|
+ log.info("获取渠道号:{}", channel.getChannelCode());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
|
|
|
|
+ return videoCnt;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
|
|
if (null == newCampaignId) {
|
|
if (null == newCampaignId) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
//3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
|
|
//3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
|
|
for (KuaiShouVideoGet videoItem : newVideos) {
|
|
for (KuaiShouVideoGet videoItem : newVideos) {
|
|
-
|
|
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
if (unitOverrun) {
|
|
if (unitOverrun) {
|
|
log.error("组创建超限,accountId:{}", accountId);
|
|
log.error("组创建超限,accountId:{}", accountId);
|
|
@@ -291,8 +352,29 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId);
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|
|
|
|
|
|
+ //获取组级渠道号
|
|
|
|
+ if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
|
|
|
|
+ try {
|
|
|
|
+ Result<Object> result = channelService.queryChannel(accountId, level, appName);
|
|
|
|
+ Integer code = result.getCode();
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ channel = (KuaishouChannel) result.getResult();
|
|
|
|
+ if (Check.isNull(channel)) {
|
|
|
|
+ log.info("(组级)账户:{},{}", accountId, result.getMessage());
|
|
|
|
+ continue;
|
|
|
|
+ } else {
|
|
|
|
+ log.info("(组级)获取到渠道号:{}", channel.getChannelCode());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("(组级)通过账户(" + accountId + ")未获取到渠道号!!!");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, channel);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
@@ -312,13 +394,19 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (unitCode != 0) {
|
|
if (unitCode != 0) {
|
|
log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
|
|
log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
|
+ if (!Check.isNull(channel)) {
|
|
|
|
+ channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null,0);
|
|
|
|
+ }
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
videoCnt--;
|
|
videoCnt--;
|
|
- JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
|
|
|
+ if (!Check.isNull(channel)) {
|
|
|
|
+ channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, unitId,1);
|
|
|
|
+ }
|
|
|
|
+ JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, channel);//TODO 添加素材
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return 0L;
|
|
return 0L;
|
|
@@ -408,7 +496,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
log.info("该账户创意创建已超限=>accountId:{}", accountId);
|
|
log.info("该账户创意创建已超限=>accountId:{}", accountId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid);
|
|
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid, null);
|
|
//创建组+创意
|
|
//创建组+创意
|
|
List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
|
|
List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
|
|
for (int j = 1; j < splitVideos.size() + 1; j++) {
|
|
for (int j = 1; j < splitVideos.size() + 1; j++) {
|
|
@@ -421,8 +509,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//创建组
|
|
//创建组
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appInfo.getAppId());
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
|
|
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appInfo.getAppId(), null);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId(), null);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
@@ -447,7 +535,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
- JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, appInfo.getAppVersion());
|
|
|
|
|
|
+ JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, appInfo.getAppVersion(), null);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -491,10 +579,10 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, null);
|
|
//创建组
|
|
//创建组
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, videoGet.getPhotoName(), "unit", newCampaignId, appId);
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|
|
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, videoGet.getPhotoName(), "unit", newCampaignId, appId, null);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, null);
|
|
unitParams.remove("cpa_bid");
|
|
unitParams.remove("cpa_bid");
|
|
unitParams.put("cpa_bid", multipleBids.getCpaBid());
|
|
unitParams.put("cpa_bid", multipleBids.getCpaBid());
|
|
if (!Check.isNull(multipleBids.getDeepConversionBid())) {
|
|
if (!Check.isNull(multipleBids.getDeepConversionBid())) {
|
|
@@ -527,7 +615,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
- JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null);
|
|
|
|
|
|
+ JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null, null);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -541,6 +629,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Long appId = null;
|
|
Long appId = null;
|
|
|
|
+ String appName = null;
|
|
String appIdString = strategy.getAppIdArray();
|
|
String appIdString = strategy.getAppIdArray();
|
|
if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
|
|
if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
|
|
if (!Check.isNull(appIdString) && !Check.isNull(JSON.parseArray(appIdString))) {
|
|
if (!Check.isNull(appIdString) && !Check.isNull(JSON.parseArray(appIdString))) {
|
|
@@ -548,9 +637,37 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (Check.isNull(appId)) {
|
|
if (Check.isNull(appId)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ KuaiShouAppList appInfo = appListService.getAppInfo(accountId, appId);
|
|
|
|
+ if (!Check.isNull(appInfo)) {
|
|
|
|
+ appName = appInfo.getAppName();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
|
|
|
+ //渠道号应用层级,account-账户,plan-计划,group-组
|
|
|
|
+ String level = strategy.getUsageLevel();
|
|
|
|
+ Integer useChannel = strategy.getUseChannel();//0不使用,1使用
|
|
|
|
+ KuaishouChannel channel = null;
|
|
|
|
+ if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
|
|
|
|
+ try {
|
|
|
|
+ Result<Object> result = channelService.queryChannel(accountId, level, appName);
|
|
|
|
+ Integer code = result.getCode();
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ channel = (KuaishouChannel) result.getResult();
|
|
|
|
+ if (Check.isNull(channel)) {
|
|
|
|
+ log.info("账户:{},{}", accountId, result.getMessage());
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ log.info("获取渠道号:{}", channel.getChannelCode());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
|
|
if (null == newCampaignId) {
|
|
if (null == newCampaignId) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -571,9 +688,31 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //获取组级渠道号
|
|
|
|
+ if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
|
|
|
|
+ try {
|
|
|
|
+ Result<Object> result = channelService.queryChannel(accountId, level, appName);
|
|
|
|
+ Integer code = result.getCode();
|
|
|
|
+ if (code == 200) {
|
|
|
|
+ channel = (KuaishouChannel) result.getResult();
|
|
|
|
+ if (Check.isNull(channel)) {
|
|
|
|
+ log.info("(组级)账户:{},{}", accountId, result.getMessage());
|
|
|
|
+ continue;
|
|
|
|
+ } else {
|
|
|
|
+ log.info("(组级)获取到渠道号:{}", channel.getChannelCode());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("(组级)通过账户(" + accountId + ")未获取到渠道号!!!");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//创建组
|
|
//创建组
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId);
|
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|
|
|
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId, channel);
|
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
log.info("创建广告组入参:{}", unitParams);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
Integer unitCode = (Integer) unitCreateResult.get("code");
|
|
@@ -593,12 +732,18 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (unitCode != 0) {
|
|
if (unitCode != 0) {
|
|
log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
|
|
log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
|
+ if (!Check.isNull(channel)) {
|
|
|
|
+ channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null,0);
|
|
|
|
+ }
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
- JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null);
|
|
|
|
|
|
+ if (!Check.isNull(channel)) {
|
|
|
|
+ channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, unitId,1);
|
|
|
|
+ }
|
|
|
|
+ JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null, channel);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -707,7 +852,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private JSONObject programCreativeParams(CtopOauthToken token, Long unitId, List<KuaiShouVideoGet> list, AiKuaishouAdvertiserStrategy strategy, Integer creativeCnt, String appVersion) {
|
|
|
|
|
|
+ private JSONObject programCreativeParams(CtopOauthToken token, Long unitId, List<KuaiShouVideoGet> list, AiKuaishouAdvertiserStrategy strategy, Integer creativeCnt, String appVersion, KuaishouChannel channel) {
|
|
JSONObject programJson = new JSONObject();
|
|
JSONObject programJson = new JSONObject();
|
|
programJson.put("advertiser_id", token.getAccountId());
|
|
programJson.put("advertiser_id", token.getAccountId());
|
|
programJson.put("unit_id", unitId);
|
|
programJson.put("unit_id", unitId);
|
|
@@ -749,7 +894,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
programJson.put("cover_image_tokens", coverImageTokens);
|
|
programJson.put("cover_image_tokens", coverImageTokens);
|
|
|
|
|
|
if (!Check.isNull(strategy.getSiteId())) {
|
|
if (!Check.isNull(strategy.getSiteId())) {
|
|
- if (!strategy.getSiteId().equals("-1") ) {
|
|
|
|
|
|
+ if (!strategy.getSiteId().equals("-1")) {
|
|
programJson.put("site_id", strategy.getSiteId());
|
|
programJson.put("site_id", strategy.getSiteId());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -764,10 +909,15 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (!Check.isNull(strategy.getClickTrackUrl())) {
|
|
if (!Check.isNull(strategy.getClickTrackUrl())) {
|
|
programJson.put("click_url", strategy.getClickTrackUrl());
|
|
programJson.put("click_url", strategy.getClickTrackUrl());
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getActionbarClickUrl())) {
|
|
|
|
+ programJson.put("click_url", channel.getActionbarClickUrl());
|
|
|
|
+ }
|
|
if (!Check.isNull(strategy.getActionbarClickUrl())) {
|
|
if (!Check.isNull(strategy.getActionbarClickUrl())) {
|
|
programJson.put("actionbar_click_url", strategy.getActionbarClickUrl());
|
|
programJson.put("actionbar_click_url", strategy.getActionbarClickUrl());
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getActionbarClickUrl())) {
|
|
|
|
+ programJson.put("actionbar_click_url", channel.getActionbarClickUrl());
|
|
|
|
+ }
|
|
JSONArray captions = getCaptions(strategy.getDescription());
|
|
JSONArray captions = getCaptions(strategy.getDescription());
|
|
programJson.put("captions", captions);
|
|
programJson.put("captions", captions);
|
|
if (!Check.isNull(strategy.getCreativeCategory())) {
|
|
if (!Check.isNull(strategy.getCreativeCategory())) {
|
|
@@ -907,7 +1057,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private Long getCampaignId(AiKuaishouAdvertiserStrategy strategy, CtopOauthToken token, String replaceString, String checkType, Integer createType, Long appId, String uuid) {
|
|
|
|
|
|
+ private Long getCampaignId(AiKuaishouAdvertiserStrategy strategy, CtopOauthToken token, String replaceString, String checkType, Integer createType, Long appId, String uuid, KuaishouChannel channel) {
|
|
Long campaignId = null;
|
|
Long campaignId = null;
|
|
if ("ALL_CAMPAIGN".equals(checkType)) {
|
|
if ("ALL_CAMPAIGN".equals(checkType)) {
|
|
campaignId = campaignService.getCampaignIdByAccountAndName(strategy.getAccountId(), replaceString);
|
|
campaignId = campaignService.getCampaignIdByAccountAndName(strategy.getAccountId(), replaceString);
|
|
@@ -922,7 +1072,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
// 不存在“上新”计划,则创建一个计划
|
|
// 不存在“上新”计划,则创建一个计划
|
|
JSONObject campaignParams = new JSONObject();
|
|
JSONObject campaignParams = new JSONObject();
|
|
campaignParams.put("advertiser_id", token.getAccountId());
|
|
campaignParams.put("advertiser_id", token.getAccountId());
|
|
- String campaignName = getName(strategy.getCampaignName(), strategy, createType, null, "plan", null, appId);
|
|
|
|
|
|
+ String campaignName = getName(strategy.getCampaignName(), strategy, createType, null, "plan", null, appId, channel);
|
|
campaignParams.put("campaign_name", campaignName);
|
|
campaignParams.put("campaign_name", campaignName);
|
|
campaignParams.put("type", strategy.getCampaignType());
|
|
campaignParams.put("type", strategy.getCampaignType());
|
|
if (null != strategy.getCampaignDayBudget() && strategy.getCampaignDayBudget() != 0) {
|
|
if (null != strategy.getCampaignDayBudget() && strategy.getCampaignDayBudget() != 0) {
|
|
@@ -953,7 +1103,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
|
|
|
|
private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, AiKuaishouAdvertiserStrategy strategy,
|
|
private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, AiKuaishouAdvertiserStrategy strategy,
|
|
- String unitName, Long appId) {
|
|
|
|
|
|
+ String unitName, Long appId, KuaishouChannel channel) {
|
|
// 拼装创建组的入参 json
|
|
// 拼装创建组的入参 json
|
|
JSONObject unitParams = new JSONObject();
|
|
JSONObject unitParams = new JSONObject();
|
|
Integer unitType = strategy.getUnitType();
|
|
Integer unitType = strategy.getUnitType();
|
|
@@ -1019,10 +1169,16 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (!Check.isNull(appId)) {
|
|
if (!Check.isNull(appId)) {
|
|
unitParams.put("app_id", appId);
|
|
unitParams.put("app_id", appId);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getAppId())) {
|
|
|
|
+ unitParams.put("app_id", channel.getAppId());
|
|
|
|
+ }
|
|
// 直达链接
|
|
// 直达链接
|
|
if (!Check.isNull(strategy.getSchemaUri())) {
|
|
if (!Check.isNull(strategy.getSchemaUri())) {
|
|
unitParams.put("schema_uri", strategy.getSchemaUri());
|
|
unitParams.put("schema_uri", strategy.getSchemaUri());
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getSchemaUri())) {
|
|
|
|
+ unitParams.put("schema_uri", channel.getSchemaUri());
|
|
|
|
+ }
|
|
// 优先从系统应用商店下载
|
|
// 优先从系统应用商店下载
|
|
if (null != strategy.getUseAppMarket()) {
|
|
if (null != strategy.getUseAppMarket()) {
|
|
unitParams.put("use_app_market", strategy.getUseAppMarket());
|
|
unitParams.put("use_app_market", strategy.getUseAppMarket());
|
|
@@ -1426,7 +1582,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return imageGet.getImageToken();
|
|
return imageGet.getImageToken();
|
|
}
|
|
}
|
|
|
|
|
|
- private JSONObject creativeParams(CtopOauthToken token, Long unitId, KuaiShouVideoGet videoItem, AiKuaishouAdvertiserStrategy strategy) {
|
|
|
|
|
|
+ private JSONObject creativeParams(CtopOauthToken token, Long unitId, KuaiShouVideoGet videoItem, AiKuaishouAdvertiserStrategy strategy, KuaishouChannel channel) {
|
|
JSONObject creativeParams = new JSONObject();
|
|
JSONObject creativeParams = new JSONObject();
|
|
creativeParams.put("advertiser_id", token.getAccountId());
|
|
creativeParams.put("advertiser_id", token.getAccountId());
|
|
creativeParams.put("unit_id", unitId);
|
|
creativeParams.put("unit_id", unitId);
|
|
@@ -1455,13 +1611,16 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
// 安卓下载中间页ID
|
|
// 安卓下载中间页ID
|
|
if (!Check.isNull(strategy.getSiteId())) {
|
|
if (!Check.isNull(strategy.getSiteId())) {
|
|
- if (!strategy.getSiteId().equals("-1") ) {
|
|
|
|
|
|
+ if (!strategy.getSiteId().equals("-1")) {
|
|
creativeParams.put("site_id", strategy.getSiteId());
|
|
creativeParams.put("site_id", strategy.getSiteId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (null != strategy.getClickTrackUrl() && !"".equals(strategy.getClickTrackUrl())) {
|
|
if (null != strategy.getClickTrackUrl() && !"".equals(strategy.getClickTrackUrl())) {
|
|
creativeParams.put("click_track_url", strategy.getClickTrackUrl());
|
|
creativeParams.put("click_track_url", strategy.getClickTrackUrl());
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getClickTrackUrl())) {
|
|
|
|
+ creativeParams.put("click_track_url", channel.getClickTrackUrl());
|
|
|
|
+ }
|
|
if (null != strategy.getImpressionUrl() && !"".equals(strategy.getImpressionUrl())) {
|
|
if (null != strategy.getImpressionUrl() && !"".equals(strategy.getImpressionUrl())) {
|
|
creativeParams.put("impression_url", strategy.getImpressionUrl());
|
|
creativeParams.put("impression_url", strategy.getImpressionUrl());
|
|
}
|
|
}
|
|
@@ -1472,6 +1631,9 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
if (null != strategy.getActionbarClickUrl() && !"".equals(strategy.getActionbarClickUrl())) {
|
|
if (null != strategy.getActionbarClickUrl() && !"".equals(strategy.getActionbarClickUrl())) {
|
|
creativeParams.put("actionbar_click_url", strategy.getActionbarClickUrl());
|
|
creativeParams.put("actionbar_click_url", strategy.getActionbarClickUrl());
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(channel) && !Check.isNull(channel.getActionbarClickUrl())) {
|
|
|
|
+ creativeParams.put("actionbar_click_url", channel.getActionbarClickUrl());
|
|
|
|
+ }
|
|
if (null != strategy.getCreativeCategory()) {
|
|
if (null != strategy.getCreativeCategory()) {
|
|
creativeParams.put("creative_category", strategy.getCreativeCategory());
|
|
creativeParams.put("creative_category", strategy.getCreativeCategory());
|
|
}
|
|
}
|
|
@@ -1534,7 +1696,16 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
private IKuaiShouAppListService appListService;
|
|
private IKuaiShouAppListService appListService;
|
|
|
|
|
|
|
|
|
|
- private String getName(String wildcard, AiKuaishouAdvertiserStrategy strategy, Integer createType, String materialName, String type, Long campaignId, Long appId) {
|
|
|
|
|
|
+ private String getName(String wildcard, AiKuaishouAdvertiserStrategy strategy, Integer createType, String materialName, String type, Long campaignId, Long appId, KuaishouChannel channel) {
|
|
|
|
+ if (wildcard.contains("{{渠道号}}") || wildcard.contains("{{渠道号名称}}")) {
|
|
|
|
+ if (Check.isNull(channel)) {
|
|
|
|
+ wildcard = wildcard.replace("{{渠道号}}", "");
|
|
|
|
+ wildcard = wildcard.replace("{{渠道号名称}}", "");
|
|
|
|
+ } else {
|
|
|
|
+ wildcard = wildcard.replace("{{渠道号}}", channel.getChannelCode());
|
|
|
|
+ wildcard = wildcard.replace("{{渠道号名称}}", channel.getChannelName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if (wildcard.contains("{{应用名称}}") || wildcard.contains("{{应用标记}}")) {
|
|
if (wildcard.contains("{{应用名称}}") || wildcard.contains("{{应用标记}}")) {
|
|
KuaiShouAppList getAppInfo = appListService.getAppInfo(strategy.getAccountId(), appId);
|
|
KuaiShouAppList getAppInfo = appListService.getAppInfo(strategy.getAccountId(), appId);
|
|
if (!Check.isNull(getAppInfo)) {
|
|
if (!Check.isNull(getAppInfo)) {
|