Browse Source

超分接口修改

private_deployment
lrh 1 year ago
parent
commit
03e54c610d
5 changed files with 38 additions and 4 deletions
  1. +8
    -4
      suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java
  2. +2
    -0
      suimangService/src/main/java/com/iformall/mapper/PhotoSpeakVideoMapper.java
  3. +2
    -0
      suimangService/src/main/java/com/iformall/service/sm/PhotoSpeakVideoService.java
  4. +14
    -0
      suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java
  5. +12
    -0
      suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml

+ 8
- 4
suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java View File

@@ -87,7 +87,7 @@ public class PhotoSpeakSchedule {
*/ */
@Scheduled(cron = "0 1/5 * * * *?") // 每五分钟检查一次 @Scheduled(cron = "0 1/5 * * * *?") // 每五分钟检查一次
public void userVideoDetailSchedule() { public void userVideoDetailSchedule() {
List<PhotoSpeakVideo> videos = photoSpeakVideoService.getUpLoadIngList();
List<PhotoSpeakVideo> videos = photoSpeakVideoService.getNotHaveUrl();
if (videos != null && videos.size() > 0) { if (videos != null && videos.size() > 0) {
for (PhotoSpeakVideo video : videos) { for (PhotoSpeakVideo video : videos) {
try { try {
@@ -99,7 +99,11 @@ public class PhotoSpeakSchedule {
video.setVideoPlayUrl(videoDetail.getVideoUrl()); video.setVideoPlayUrl(videoDetail.getVideoUrl());
video.setVideoTime(videoDetail.getDuration()); video.setVideoTime(videoDetail.getDuration());
video.setVideoSize(videoDetail.getSize()); video.setVideoSize(videoDetail.getSize());
video.setVideoStatus(EnumVideoStatus.upload_success.getCode());
if (video.getVideoStatus() <= 5){
video.setVideoStatus(EnumVideoStatus.upload_success.getCode());
}else {
video.setVideoStatus(EnumVideoStatus.hy_upload_success.getCode());
}
photoSpeakVideoService.updateById(video); photoSpeakVideoService.updateById(video);
} }
} catch (Exception e) { } catch (Exception e) {
@@ -112,7 +116,7 @@ public class PhotoSpeakSchedule {
/** /**
* 超分上传阿里云 * 超分上传阿里云
*/ */
@Scheduled(cron = "0 */30 * * * *?") // 每半小时检查一次
// @Scheduled(cron = "0 */30 * * * *?") // 每半小时检查一次
public void userVideoHyUploadSchedule() { public void userVideoHyUploadSchedule() {
List<PhotoSpeakVideo> videos = photoSpeakVideoService.getNotHyUploadList(); List<PhotoSpeakVideo> videos = photoSpeakVideoService.getNotHyUploadList();
if (videos != null && videos.size() > 0) { if (videos != null && videos.size() > 0) {
@@ -129,7 +133,7 @@ public class PhotoSpeakSchedule {
/** /**
* 获取超分时长和大小 * 获取超分时长和大小
*/ */
@Scheduled(cron = "0 1/5 * * * *?") // 每五分钟检查一次
// @Scheduled(cron = "0 1/5 * * * *?") // 每五分钟检查一次
public void userVideoHyDetailSchedule() { public void userVideoHyDetailSchedule() {
List<PhotoSpeakVideo> videos = photoSpeakVideoService.getUpLoadHyIngList(); List<PhotoSpeakVideo> videos = photoSpeakVideoService.getUpLoadHyIngList();
if (videos != null && videos.size() > 0) { if (videos != null && videos.size() > 0) {


+ 2
- 0
suimangService/src/main/java/com/iformall/mapper/PhotoSpeakVideoMapper.java View File

@@ -24,4 +24,6 @@ public interface PhotoSpeakVideoMapper extends CommonMapper<PhotoSpeakVideo, Lon
List<PhotoSpeakVideo> getSortList(PhotoSpeakVideo record); List<PhotoSpeakVideo> getSortList(PhotoSpeakVideo record);


Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list); Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list);

List<PhotoSpeakVideo> getNotHaveUrl(PhotoSpeakVideo umVideoQ);
} }

+ 2
- 0
suimangService/src/main/java/com/iformall/service/sm/PhotoSpeakVideoService.java View File

@@ -66,4 +66,6 @@ public interface PhotoSpeakVideoService {
List<PhotoSpeakVideo> getNotHyUploadList(); List<PhotoSpeakVideo> getNotHyUploadList();


ResultData checkVideoStatus(Long userId, List<Long> time); ResultData checkVideoStatus(Long userId, List<Long> time);

List<PhotoSpeakVideo> getNotHaveUrl();
} }

+ 14
- 0
suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java View File

@@ -323,6 +323,8 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService {
List<Integer> videoStatuss = new ArrayList<>(); List<Integer> videoStatuss = new ArrayList<>();
videoStatuss.add(EnumVideoStatus.success.getCode()); videoStatuss.add(EnumVideoStatus.success.getCode());
videoStatuss.add(EnumVideoStatus.upload_fail.getCode()); videoStatuss.add(EnumVideoStatus.upload_fail.getCode());
videoStatuss.add(EnumVideoStatus.hy_success.getCode());
videoStatuss.add(EnumVideoStatus.hy_upload_fail.getCode());
umVideoQ.setVideoStatuss(videoStatuss); umVideoQ.setVideoStatuss(videoStatuss);
return photoSpeakVideoMapper.getSortList(umVideoQ); return photoSpeakVideoMapper.getSortList(umVideoQ);
} }
@@ -457,6 +459,18 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService {
return photoSpeakVideoMapper.getSortList(umVideoQ); return photoSpeakVideoMapper.getSortList(umVideoQ);
} }


@Override
public List<PhotoSpeakVideo> getNotHaveUrl() {
PhotoSpeakVideo umVideoQ = new PhotoSpeakVideo();
List<Integer> videoStatuss = new ArrayList<>();
videoStatuss.add(EnumVideoStatus.hy_upload_ing.getCode());
videoStatuss.add(EnumVideoStatus.hy_upload_success.getCode());
videoStatuss.add(EnumVideoStatus.upload_ing.getCode());
videoStatuss.add(EnumVideoStatus.upload_success.getCode());
umVideoQ.setVideoStatuss(videoStatuss);
return photoSpeakVideoMapper.getNotHaveUrl(umVideoQ);
}

@Override @Override
public ResultData checkVideoStatus(Long userId, List<Long> list) { public ResultData checkVideoStatus(Long userId, List<Long> list) {
if (CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)){


+ 12
- 0
suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml View File

@@ -169,4 +169,16 @@
</if> </if>
</select> </select>


<select id="getNotHaveUrl" resultType="com.iformall.domain.po.sm.PhotoSpeakVideo">
select id,title,video_id,video_path, video_play_url,video_status
from photo_speak_video
where `is_del` = 0 and `cover_img` = ''
<if test=" null != videoStatuss ">
or video_status in
<foreach collection="videoStatuss" index="index" item="videoStatusItem" open="(" separator="," close=")">
#{videoStatusItem}
</foreach>
</if>
</select>

</mapper> </mapper>

Loading…
Cancel
Save