فهرست منبع

通投智选-竖图大图

yangzian 3 سال پیش
والد
کامیت
7d89b852df

+ 10 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/ByteDanceVideoInfoMapper.java

@@ -68,6 +68,16 @@ public interface ByteDanceVideoInfoMapper extends BaseMapper<ByteDanceVideoInfo>
      */
     List<ByteDanceVideoInfo> getModeImageLarge(@Param(value = "accountId") Long accountId,@Param(value = "startTime")String startTime, @Param(value = "endTime")String endTime, @Param(value = "videoCnt")Long videoCnt);
 
+    /**
+     * 通投智选 - 竖图大图
+     * @param accountId
+     * @param startTime
+     * @param endTime
+     * @param videoCnt
+     * @return
+     */
+    List<ByteDanceVideoInfo> getModeImageVertical(@Param(value = "accountId") Long accountId,@Param(value = "startTime")String startTime, @Param(value = "endTime")String endTime, @Param(value = "videoCnt")Long videoCnt);
+
 
 
 

+ 16 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceVideoInfoMapper.xml

@@ -306,6 +306,22 @@
         limit #{videoCnt}
     </select>
 
+    <!-- 通投智选 - 竖图大图 -->
+    <select id="getModeImageVertical" resultType="org.jeecg.modules.bytedance.advertise.entity.ByteDanceVideoInfo">
+        select distinct image.*,
+        (select count(1) from ctop_bytedance_creative c
+        where SUBSTRING_INDEX(SUBSTRING_INDEX(image_ids,'["',-1),'"]',1) in(image.id)
+        and c.account_id = '${accountId}') as creativeCnt,
+        'image' as materialType
+        from ctop_bytedance_image_info image
+        where account_id = #{accountId}
+        and image.type = '2'
+        and image.image_create_time &gt;= #{startTime}
+        and image.image_create_time &lt;= #{endTime}
+        order by  creativeCnt ASC
+        limit #{videoCnt}
+    </select>
+
 
 
 </mapper>

+ 24 - 1
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -526,7 +526,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
 
         }
 
-        //通投智选 竖版视频 横版视频 横图大图
+        //通投智选 竖版视频 横版视频 横图大图 竖图大图
         if (!Check.isNull(strategy.getAdDeliveryRange()) && "UNIVERSAL".equalsIgnoreCase(strategy.getAdDeliveryRange())){
             List<ByteDanceVideoInfo> resultList = new ArrayList<>();
             //获取 最近14天的时间 开始 和截至时间点
@@ -575,6 +575,29 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                     }
                 }
             }
+
+            //竖图大图
+            if (strategy.getCreativeImageMode().contains("CREATIVE_IMAGE_MODE_LARGE_VERTICAL")){
+                List<ByteDanceVideoInfo>  listImage = byteDanceVideoInfoMapper.getModeImageVertical(strategy.getAccountId(),map.get("startTime"),map.get("endTime"),1L);
+                if (!Check.isNull(listImage)){
+                    for (ByteDanceVideoInfo info : listImage) {
+                        JSONObject objectImg = new JSONObject();
+                        //图片素材
+                        objectImg.put("image_mode","CREATIVE_IMAGE_MODE_LARGE");
+                        String[] imageIds = new String[]{info.getId()};
+                        JSONArray image_info = new JSONArray();
+                        for (String imgId : imageIds) {
+                            JSONObject imageObject = new JSONObject();
+                            imageObject.put("image_id",imgId);
+                            image_info.add(imageObject);
+                        }
+                        objectImg.put("image_info",image_info);
+                        imageMaterials.add(objectImg);
+                    }
+                }
+            }
+
+
         }
         creObj.put("image_materials",imageMaterials);
         creObj.put("video_materials",videoMaterials);