瀏覽代碼

批量创建--创建计划、组

zhaoxian 4 年之前
父節點
當前提交
78da22907b

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouBatchCreativePreviewMapper.java

@@ -2,6 +2,9 @@ package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCreativePreview;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 快手-广告创意预览信息
@@ -12,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KuaishouBatchCreativePreviewMapper extends BaseMapper<KuaishouBatchCreativePreview> {
 
+    List<KuaishouBatchCreativePreview> selectBatchByUnitIds(@Param("groupList") List<String> groupList);
 }

+ 9 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouBatchCreativePreviewMapper.xml

@@ -2,4 +2,13 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouBatchCreativePreviewMapper">
 
+    <select id="selectBatchByUnitIds" resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCreativePreview">
+        SELECT * FROM ctop_kuaishou_batch_creative_preview
+        where group_id in
+        <foreach collection="groupList" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+
 </mapper>

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouBatchCreativePreviewServiceImpl.java

@@ -81,10 +81,9 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
         if (!Check.isNull(dataList)) {
             List<String> compaignList = dataList.getJSONArray("campaigns").toJavaList(String.class);
             List<String> groupList = dataList.getJSONArray("groups").toJavaList(String.class);
-            List<String> creativeList = dataList.getJSONArray("creatives").toJavaList(String.class);
             List<KuaishouBatchCampaignPreview> campaignPreviewList = campaignPreviewMapper.selectBatchIds(compaignList);
             List<KuaishouBatchGroupPreview> kuaishouBatchGroupPreviews = groupPreviewMapper.selectBatchIds(groupList);
-            List<KuaishouBatchCreativePreview> kuaishouBatchCreativePreviews = creativePreviewMapper.selectBatchIds(creativeList);
+            List<KuaishouBatchCreativePreview> kuaishouBatchCreativePreviews = creativePreviewMapper.selectBatchByUnitIds(groupList);
             //待建计划
             List<KuaishouBatchCampaignPreview> campaignList = getCampaignList(campaignPreviewList, kuaishouBatchGroupPreviews, kuaishouBatchCreativePreviews);
             CtopOauthToken oauthToken = tokenService.getTokenByAccountId(accountId);