|
@@ -85,7 +85,7 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
task.setTaskStatus(1);
|
|
task.setTaskStatus(1);
|
|
task.setRemarks("待创建");
|
|
task.setRemarks("待创建");
|
|
task.setPhotoInfos(videoInfo.toString());
|
|
task.setPhotoInfos(videoInfo.toString());
|
|
- task.setName(getName(template.getName()));
|
|
|
|
|
|
+ task.setName(getName(template.getName(), task.getAccountId()));
|
|
task.setHostingScene(template.getHostingScene());
|
|
task.setHostingScene(template.getHostingScene());
|
|
task.setCampaignType(template.getCampaignType());
|
|
task.setCampaignType(template.getCampaignType());
|
|
if (!Check.isNull(template.getAppId())) {
|
|
if (!Check.isNull(template.getAppId())) {
|
|
@@ -155,7 +155,9 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
task.setPlatformOv(template.getPlatformOv());
|
|
task.setPlatformOv(template.getPlatformOv());
|
|
task.setFilterConvertedLevel(template.getFilterConvertedLevel());
|
|
task.setFilterConvertedLevel(template.getFilterConvertedLevel());
|
|
task.setRuleEnable(template.getRuleEnable());
|
|
task.setRuleEnable(template.getRuleEnable());
|
|
- task.setCampaignNameRule(getCampaignName(template.getCampaignNameRule()));
|
|
|
|
|
|
+ if (!Check.isNull(template.getCampaignNameRule())) {
|
|
|
|
+ task.setCampaignNameRule(getCampaignName(template.getCampaignNameRule(), task.getAccountId()));
|
|
|
|
+ }
|
|
task.setUnitNameRule(template.getUnitNameRule());
|
|
task.setUnitNameRule(template.getUnitNameRule());
|
|
task.setCreativeNameRule(template.getCreativeNameRule());
|
|
task.setCreativeNameRule(template.getCreativeNameRule());
|
|
addList.add(task);
|
|
addList.add(task);
|
|
@@ -378,6 +380,7 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
/*--------- 视频组装 ---------*/
|
|
/*--------- 视频组装 ---------*/
|
|
JSONArray videoInfo = getPhotoArray(photoArray);
|
|
JSONArray videoInfo = getPhotoArray(photoArray);
|
|
requestJson.put("photo_infos", videoInfo);
|
|
requestJson.put("photo_infos", videoInfo);
|
|
|
|
+ log.info("创建智能托管,accountId:{},入参:{}", task.getAccountId(), requestJson);
|
|
JSONObject hosting = createHosting(task.getAccountId(), token.getAccessToken(), requestJson);
|
|
JSONObject hosting = createHosting(task.getAccountId(), token.getAccessToken(), requestJson);
|
|
if (!Check.isNull(hosting)) {
|
|
if (!Check.isNull(hosting)) {
|
|
Integer code = hosting.getInteger("code");
|
|
Integer code = hosting.getInteger("code");
|
|
@@ -409,9 +412,9 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
hostingTaskMapper.updateStatusById(id, taskStatus, remarks);
|
|
hostingTaskMapper.updateStatusById(id, taskStatus, remarks);
|
|
}
|
|
}
|
|
|
|
|
|
- private String getName(String name) {
|
|
|
|
|
|
+ private String getName(String name, Long accountId) {
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd").replace("-", "");
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd").replace("-", "");
|
|
- String redisKey = hostingKey + "_" + nowDate;
|
|
|
|
|
|
+ String redisKey = hostingKey + "_" + nowDate + "_" + accountId;
|
|
Object o = redisUtil.get(redisKey);
|
|
Object o = redisUtil.get(redisKey);
|
|
Integer count;
|
|
Integer count;
|
|
if (Check.isNull(o)) {
|
|
if (Check.isNull(o)) {
|
|
@@ -424,9 +427,9 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
return name + "_" + nowDate + "_" + count;
|
|
return name + "_" + nowDate + "_" + count;
|
|
}
|
|
}
|
|
|
|
|
|
- private String getCampaignName(String name) {
|
|
|
|
|
|
+ private String getCampaignName(String name, Long accountId) {
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd").replace("-", "");
|
|
String nowDate = DateUtils.getNowDate("yyyy-MM-dd").replace("-", "");
|
|
- String redisKey = hostingKey + "_" + nowDate;
|
|
|
|
|
|
+ String redisKey = hostingKey + "_" + nowDate + "_" + accountId;
|
|
Object o = redisUtil.get(redisKey);
|
|
Object o = redisUtil.get(redisKey);
|
|
Integer count;
|
|
Integer count;
|
|
if (Check.isNull(o)) {
|
|
if (Check.isNull(o)) {
|
|
@@ -480,10 +483,10 @@ public class KuaishouHostingTaskServiceImpl extends ServiceImpl<KuaishouHostingT
|
|
if (Check.isNull(photoId)) {
|
|
if (Check.isNull(photoId)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- /* Integer materialType = hostingTaskMapper.getMaterialType(photoId);
|
|
|
|
|
|
+ Integer materialType = hostingTaskMapper.getMaterialType(photoId);
|
|
if (Check.isNull(materialType)) {
|
|
if (Check.isNull(materialType)) {
|
|
continue;
|
|
continue;
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
JSONObject videoJson = new JSONObject();
|
|
JSONObject videoJson = new JSONObject();
|
|
videoJson.put("photo_id", photoId);
|
|
videoJson.put("photo_id", photoId);
|
|
videoJson.put("photo_orientation", 1);
|
|
videoJson.put("photo_orientation", 1);
|