|
@@ -7,11 +7,7 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTemplate;
|
|
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.KuaishouTemplateTarget;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplateTarget;
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupTemplateMapper;
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupTemplateMapper;
|
|
-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.IKuaishouInterfaceService;
|
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouTemplateTargetService;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -123,7 +119,11 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
|
|
String description = requestJson.getString("description");
|
|
String description = requestJson.getString("description");
|
|
Long site_id = requestJson.getLong("siteId");
|
|
Long site_id = requestJson.getLong("siteId");
|
|
String schema_uri = requestJson.getString("schemaUri");
|
|
String schema_uri = requestJson.getString("schemaUri");
|
|
-
|
|
|
|
|
|
+ Integer startNumber = 0;
|
|
|
|
+ if (unitName.contains("{{序号}}")) {
|
|
|
|
+ startNumber = requestJson.getInteger("startNumber");
|
|
|
|
+ }
|
|
|
|
+ Integer imageCount = requestJson.getInteger("imageCount");
|
|
|
|
|
|
List<KuaiShouGroupTemplate> templates = new ArrayList<>();
|
|
List<KuaiShouGroupTemplate> templates = new ArrayList<>();
|
|
for (int i = 0; i < createCount; i++) {
|
|
for (int i = 0; i < createCount; i++) {
|
|
@@ -140,11 +140,22 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
|
|
}
|
|
}
|
|
template.setPhotoIds(photoIds.toJSONString());
|
|
template.setPhotoIds(photoIds.toJSONString());
|
|
}
|
|
}
|
|
- String name = unitName + "_" + i;
|
|
|
|
|
|
+ String name = "";
|
|
|
|
+ if (!unitName.contains("{{序号}}")) {
|
|
|
|
+ name = unitName + "_" + i;
|
|
|
|
+ } else {
|
|
|
|
+ if (i == 0) {
|
|
|
|
+ name = unitName.replace("{{序号}}", String.valueOf(startNumber));
|
|
|
|
+ } else {
|
|
|
|
+ name = unitName.replace("{{序号}}", String.valueOf(startNumber + i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ template.setUnitName(name);
|
|
template.setAccountId(accountId);
|
|
template.setAccountId(accountId);
|
|
template.setUserId(userId);
|
|
template.setUserId(userId);
|
|
template.setCampaignId(campaignId);
|
|
template.setCampaignId(campaignId);
|
|
- template.setUnitName(name);
|
|
|
|
|
|
+
|
|
if (!Check.isNull(template_id)) {
|
|
if (!Check.isNull(template_id)) {
|
|
template.setTemplateId(template_id);
|
|
template.setTemplateId(template_id);
|
|
}
|
|
}
|
|
@@ -238,6 +249,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
|
|
if (!Check.isNull(site_id)) {
|
|
if (!Check.isNull(site_id)) {
|
|
template.setSiteId(site_id);
|
|
template.setSiteId(site_id);
|
|
}
|
|
}
|
|
|
|
+ template.setImageCount(imageCount);
|
|
template.setTaskStatus(0);
|
|
template.setTaskStatus(0);
|
|
template.setCreativeReviewDetail("创意待创建");
|
|
template.setCreativeReviewDetail("创意待创建");
|
|
template.setCreativeStatus(0);
|
|
template.setCreativeStatus(0);
|
|
@@ -609,7 +621,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
|
|
}
|
|
}
|
|
Integer materialType = videoMd5Json.getInteger("materialType");
|
|
Integer materialType = videoMd5Json.getInteger("materialType");
|
|
String videoMd5 = videoMd5Json.getString("md5");
|
|
String videoMd5 = videoMd5Json.getString("md5");
|
|
- List<JSONObject> imageList = groupTemplateMapper.getImageListByMd5(videoMd5);
|
|
|
|
|
|
+ List<JSONObject> imageList = groupTemplateMapper.getImageListByMd5(videoMd5, template.getImageCount());
|
|
if (Check.isNull(imageList)) {
|
|
if (Check.isNull(imageList)) {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("creative_name", template.getCreativeName());
|
|
json.put("creative_name", template.getCreativeName());
|