浏览代码

fix

photo
winter 1年前
父节点
当前提交
37fbb2f661
共有 2 个文件被更改,包括 13 次插入7 次删除
  1. +9
    -3
      suimangSchedule/src/main/java/com/iformall/schedule/VideoSchedule.java
  2. +4
    -4
      suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java

+ 9
- 3
suimangSchedule/src/main/java/com/iformall/schedule/VideoSchedule.java 查看文件

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


+ 4
- 4
suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java 查看文件

@@ -499,6 +499,7 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService {
if (null != _vt && _vt > 0) {
videoUpd.setVideoTime(videoDetail.getDuration());
}else {
logger.debug(">>>>> video no time:"+userMouldVideo.getId()+">"+userMouldVideo.getVideoTime());
videoUpd.setVideoTime(userMouldVideo.getVideoTime());
}
videoUpd.setVideoSize(videoDetail.getSize());
@@ -506,17 +507,16 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService {
videoUpd.setVideoMsg("视频上传成功");
videoUpd.setUpdateDate(new Date());
//设置扣费,当前方法是慧影项目专用的
if (StringUtils.isBlank(videoUpd.getVideoTime()) || null == videoUpd.getVideoSize() || videoUpd.getVideoSize() <= 0) {
break;
}
CreateBilling cb = projectFactory.getProjectService(EnumProject.PROJECT_2.getCode())
.handleCreateVideoBilling(userMouldVideo.getUserId(), userMouldVideo.getFinalTenantId(), videoUpd.getVideoTime(), videoUpd.getVideoSize());
if (null != cb) {
logger.info("createBilling result:"+JSON.toJSONString(cb));
videoUpd.setCostPoints(cb.getTotalCostPoins());
videoUpd.setCostPointsDetail(cb.getDetail());
}
this.updateById(videoUpd);
logger.debug(" video upload progress: vid-"+result.getVideoId()+">"
+com.aliyun.openservices.shade.com.alibaba.fastjson.JSON.toJSONString(videoDetail)
+">"+com.aliyun.openservices.shade.com.alibaba.fastjson.JSON.toJSONString(videoUpd));
break;
}
}


正在加载...
取消
保存