Преглед на файлове

自动投放-创建素材去除关联项目

yangzian преди 3 години
родител
ревизия
8ae10b1621

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

@@ -74,7 +74,10 @@
         (select count(1) from ctop_bytedance_video_slogen_info s where s.video_code = video.signature) as slogens,
          'video' As materialType
         from ctop_bytedance_video_info video
-        left join ctop_material_info cmi on video.signature = cmi.code and cmi.project_id = #{projectId}
+        left join ctop_material_info cmi on video.signature = cmi.code
+        <if test="projectId !=null and projectId != ''">
+            and cmi.project_id = #{projectId}
+        </if>
         where account_id = '${accountId}'
         and cmi.code is not null
         and cmi.status = 1
@@ -104,7 +107,10 @@
         order by sum(report.cost) desc ) a
         left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = #{accountId} and a.type = #{imageMode} and a.status = 1)as video
         on a.material_id = video.material_id
-        left join ctop_material_info cmi on cmi.code = video.signature and cmi.project_id = #{projectId}
+        left join ctop_material_info cmi on cmi.code = video.signature
+        <if test="projectId !=null and projectId != ''">
+            and cmi.project_id = #{projectId}
+        </if>
         where cmi.id is not null
           and video.id is not null
           and cmi.offline_flag = 0
@@ -133,7 +139,10 @@
               order by sum(report.cost) desc ) a
                  left join (select distinct a.* from ctop_bytedance_video_info a where a.account_id = #{accountId} and a.type = #{imageMode} and a.status = 1)as video
                            on a.material_id = video.material_id
-                 left join ctop_material_info cmi on cmi.code = video.signature and cmi.project_id = #{projectId}
+                 left join ctop_material_info cmi on cmi.code = video.signature
+        <if test="projectId !=null and projectId != ''">
+            and cmi.project_id = #{projectId}
+        </if>
         where cmi.id is not null
           and video.id is not null
           and cmi.offline_flag = 0

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

@@ -100,7 +100,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         if(timeEnd != 0){
             endTime = DateUtils.formatDateTime(endTimestamp + timeEnd * 60 * 1000L);
         }
-        List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
+        //获取素材 项目id 为空
+        List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(null,strategy,startTime,endTime,createType,videoCnt);
         if(null == videoInfos||videoInfos.isEmpty()){
             log.info("获取{}视频素材为空=>accountId:{}",BytedanceCreativeMatTypeEnum.getNameByType(createType+""),token.getAccountId());
             return videoCnt;