|
|
@@ -166,4 +166,31 @@ public class ContentPlatformDemandVideoJob {
|
|
|
return ReturnT.FAIL;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @XxlJob("checkContentPlatformDemandVideoStatusJob")
|
|
|
+ public ReturnT<String> checkContentPlatformDemandVideoStatusJob(String param) {
|
|
|
+ String dt = demandVideoMapperExt.getMaxDt();
|
|
|
+ if (!StringUtils.hasText(dt)) {
|
|
|
+ log.info("checkContentPlatformDemandVideoStatusJob no data");
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+ log.info("checkContentPlatformDemandVideoStatusJob start, dt={}", dt);
|
|
|
+ List<ContentPlatformDemandVideo> activeVideos = demandVideoMapperExt.selectActiveVideos(dt);
|
|
|
+ if (CollectionUtils.isEmpty(activeVideos)) {
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+ Long now = System.currentTimeMillis();
|
|
|
+ for (List<ContentPlatformDemandVideo> partition : Lists.partition(activeVideos, 20)) {
|
|
|
+ List<Long> videoIds = partition.stream().map(ContentPlatformDemandVideo::getVideoId).collect(Collectors.toList());
|
|
|
+ Map<Long, VideoDetail> videoDetailMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
|
|
|
+ for (ContentPlatformDemandVideo video : partition) {
|
|
|
+ VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
|
|
|
+ if (videoDetail == null || videoDetail.getAuditStatus() != 5) {
|
|
|
+ demandVideoMapperExt.updateStatusByVideoId(video.getVideoId(), dt, 0, now);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("checkContentPlatformDemandVideoStatusJob done, dt={}", dt);
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
}
|