|
@@ -334,9 +334,10 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
|
continue;
|
|
|
}
|
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, videoItem.getMaterialType());
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, videoItem, operationType);
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, appId, videoItem, operationType);
|
|
|
if (!Check.isNull(unitParams) && operationType == 2) {
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, videoItem.getMaterialType());
|
|
|
+ unitParams.put("unit_name", unitName);
|
|
|
AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
|
|
|
BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
|
|
|
unitLevelOperationRecord.setGroupName(unitName);
|
|
@@ -361,17 +362,19 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
unitLevelOperationRecord.setMessage(msg);
|
|
|
if (unitCode == 0) {
|
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
|
+ log.info("(accountId:{})创建自定义组({}).....success....",accountId,unitId);
|
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
videoCnt--;
|
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
|
|
|
createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
|
- }
|
|
|
- if (unitCode != 0) {
|
|
|
+ } else {
|
|
|
+ log.info("(accountId:{})创建自定义组.....fail....{}",accountId, msg);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
redisUtil.set(redisKey, redisValue - 1, 100000L);
|
|
|
}
|
|
|
} else {
|
|
|
+ log.info("(accountId:{})创建自定义组.....fail....{}",accountId, msg);
|
|
|
unitLevelOperationRecord.setStatus(unitCode);
|
|
|
unitLevelOperationRecord.setMessage(msg);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
@@ -481,9 +484,10 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
}
|
|
|
}
|
|
|
//创建组
|
|
|
- String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId, null);
|
|
|
- JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, null, operationType);
|
|
|
- if (!Check.isNull(unitParams)) {
|
|
|
+ JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, appId, null, operationType);
|
|
|
+ if (!Check.isNull(unitParams) && operationType == 2) {
|
|
|
+ String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId, null);
|
|
|
+ unitParams.put("unit_name", unitName);
|
|
|
AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
|
|
|
BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
|
|
|
unitLevelOperationRecord.setGroupName(unitName);
|
|
@@ -508,17 +512,18 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
unitLevelOperationRecord.setMessage(errorMsg);
|
|
|
if (unitCode == 0) {
|
|
|
Long unitId = (Long) unitCreateResult.get("unitId");
|
|
|
+ log.info(".........程序化组创建成功 =>accountId:{};unitId:{}", accountId, unitId);
|
|
|
unitLevelOperationRecord.setUnitId(unitId);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null);
|
|
|
createProgramCreative(token, creativeParams, strategy);
|
|
|
- }
|
|
|
- if (unitCode != 0) {
|
|
|
- log.error("组创建失败=>accountId:{};message:{}", accountId, errorMsg);
|
|
|
+ } else {
|
|
|
+ log.info(".........程序化组创建失败=>accountId:{};message:{}", accountId, errorMsg);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
|
redisUtil.set(redisKey, redisValue - 1, 100000L);
|
|
|
}
|
|
|
} else {
|
|
|
+ log.info(".........程序化组创建失败=>accountId:{};message:{}", accountId, errorMsg);
|
|
|
unitLevelOperationRecord.setStatus(unitCode);
|
|
|
unitLevelOperationRecord.setMessage(errorMsg);
|
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
@@ -816,7 +821,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
return campaignId;
|
|
|
}
|
|
|
|
|
|
- private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, KuaishouProjectStrategy strategy, String unitName, Long appId, KuaiShouVideoGet videoItem, Integer operationType) {
|
|
|
+ private JSONObject createUnitParams(CtopOauthToken token, Long campaignId, KuaishouProjectStrategy strategy, Long appId, KuaiShouVideoGet videoItem, Integer operationType) {
|
|
|
JSONObject unitParams = null;
|
|
|
try {
|
|
|
// 拼装创建组的入参 json
|
|
@@ -826,7 +831,6 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
|
|
|
unitParams.put("unit_type", unitType);
|
|
|
unitParams.put("advertiser_id", token.getAccountId());
|
|
|
unitParams.put("campaign_id", campaignId);
|
|
|
- unitParams.put("unit_name", unitName);
|
|
|
//出价类型
|
|
|
unitParams.put("bid_type", strategy.getBidType());
|
|
|
if (!Check.isNull(strategy.getGroupStatus()) && strategy.getGroupStatus() == 2) {
|