|
@@ -90,7 +90,7 @@ public class VideoSchedule { |
|
|
/** |
|
|
/** |
|
|
* 获取时长和大小 |
|
|
* 获取时长和大小 |
|
|
*/ |
|
|
*/ |
|
|
@Scheduled(cron = "0 1/5 * * * *?") // 每五分钟检查一次 |
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0/5 * * * *?") // 每五分钟检查一次 |
|
|
public void userVideoDetailSchedule() { |
|
|
public void userVideoDetailSchedule() { |
|
|
List<UserMouldVideo> videos = userMouldVideoService.getNotHaveUrl(); |
|
|
List<UserMouldVideo> videos = userMouldVideoService.getNotHaveUrl(); |
|
|
if (videos != null && videos.size() > 0) { |
|
|
if (videos != null && videos.size() > 0) { |
|
@@ -99,15 +99,21 @@ public class VideoSchedule { |
|
|
VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(video.getVideoId(),false); |
|
|
VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(video.getVideoId(),false); |
|
|
if (videoDetail.isSuccess() |
|
|
if (videoDetail.isSuccess() |
|
|
&& StringUtils.isNotBlank(videoDetail.getDuration()) |
|
|
&& StringUtils.isNotBlank(videoDetail.getDuration()) |
|
|
&& !"0.0".equals(videoDetail.getDuration())) { |
|
|
|
|
|
|
|
|
&& StringUtils.isNotBlank(videoDetail.getVideoUrl())) { |
|
|
video.setCoverImg(videoDetail.getCoverURL()); |
|
|
video.setCoverImg(videoDetail.getCoverURL()); |
|
|
video.setVideoPlayUrl(videoDetail.getVideoUrl()); |
|
|
video.setVideoPlayUrl(videoDetail.getVideoUrl()); |
|
|
video.setVideoTime(videoDetail.getDuration()); |
|
|
|
|
|
|
|
|
Double _vt = Double.valueOf(videoDetail.getDuration()); |
|
|
|
|
|
if (null != _vt && _vt > 0) { |
|
|
|
|
|
video.setVideoTime(videoDetail.getDuration()); |
|
|
|
|
|
} |
|
|
video.setVideoSize(videoDetail.getSize()); |
|
|
video.setVideoSize(videoDetail.getSize()); |
|
|
video.setVideoStatus(EnumVideoStatus.upload_success.getCode()); |
|
|
video.setVideoStatus(EnumVideoStatus.upload_success.getCode()); |
|
|
video.setVideoMsg("视频上传成功"); |
|
|
video.setVideoMsg("视频上传成功"); |
|
|
video.setUpdateDate(new Date()); |
|
|
video.setUpdateDate(new Date()); |
|
|
//设置扣费,当前方法是慧影项目专用的 |
|
|
//设置扣费,当前方法是慧影项目专用的 |
|
|
|
|
|
if (StringUtils.isBlank(video.getVideoTime()) || null == video.getVideoSize() || video.getVideoSize() <= 0) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
CreateBilling cb = projectFactory.getProjectService(EnumProject.PROJECT_2.getCode()) |
|
|
CreateBilling cb = projectFactory.getProjectService(EnumProject.PROJECT_2.getCode()) |
|
|
.handleCreateVideoBilling(video.getUserId(), video.getFinalTenantId(), video.getVideoTime(), video.getVideoSize()); |
|
|
.handleCreateVideoBilling(video.getUserId(), video.getFinalTenantId(), video.getVideoTime(), video.getVideoSize()); |
|
|
if (null != cb) { |
|
|
if (null != cb) { |
|
|