wangyunpeng 1 dzień temu
rodzic
commit
79b84de3b6

+ 11 - 1
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDemandVideoJob.java

@@ -368,9 +368,19 @@ public class ContentPlatformDemandVideoJob {
         }
         }
         Long now = System.currentTimeMillis();
         Long now = System.currentTimeMillis();
         for (List<ContentPlatformDemandVideo> partition : Lists.partition(activeVideos, 20)) {
         for (List<ContentPlatformDemandVideo> partition : Lists.partition(activeVideos, 20)) {
-            List<Long> videoIds = partition.stream().map(ContentPlatformDemandVideo::getVideoId).collect(Collectors.toList());
+            List<Long> videoIds = partition.stream()
+                    .filter(Objects::nonNull)
+                    .map(ContentPlatformDemandVideo::getVideoId)
+                    .filter(Objects::nonNull)
+                    .collect(Collectors.toList());
+            if (CollectionUtils.isEmpty(videoIds)) {
+                continue;
+            }
             Map<Long, VideoDetail> videoDetailMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
             Map<Long, VideoDetail> videoDetailMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
             for (ContentPlatformDemandVideo video : partition) {
             for (ContentPlatformDemandVideo video : partition) {
+                if (video == null || video.getVideoId() == null) {
+                    continue;
+                }
                 VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
                 VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
                 if (videoDetail == null || videoDetail.getAuditStatus() != 5) {
                 if (videoDetail == null || videoDetail.getAuditStatus() != 5) {
                     demandVideoMapperExt.updateStatusByVideoId(video.getVideoId(), dt, 0, now);
                     demandVideoMapperExt.updateStatusByVideoId(video.getVideoId(), dt, 0, now);

+ 1 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDemandVideoMapperExt.xml

@@ -140,7 +140,7 @@
     <select id="selectActiveVideos" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
     <select id="selectActiveVideos" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
         SELECT DISTINCT video_id
         SELECT DISTINCT video_id
         FROM content_platform_demand_video
         FROM content_platform_demand_video
-        WHERE dt = #{dt} AND status = 1
+        WHERE dt = #{dt} AND status = 1 AND video_id IS NOT NULL
     </select>
     </select>
 
 
     <update id="updateStatusByVideoId">
     <update id="updateStatusByVideoId">