he2802 4 лет назад
Родитель
Сommit
fe7887361e

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseStreamingAddBo.java

@@ -63,4 +63,6 @@ public class CourseStreamingAddBo {
     /** 业务层级列表 */
     @ApiModelProperty("业务层级列表")
     private List<CourseStreamingBusinessAddBo> businessList;
+
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseStreaming.java

@@ -56,4 +56,6 @@ private static final long serialVersionUID=1L;
     private Long updateTime;
     /** 状态 1正常 0关闭 */
     private Integer status;
+    /** 本地保利威视频ID */
+    private Long polyvId;
 }

+ 19 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseStreamingServiceImpl.java

@@ -2,6 +2,8 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
@@ -14,6 +16,8 @@ import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingService;
 import com.zhongzheng.modules.course.vo.CourseStreamingVo;
+import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
+import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -42,6 +46,9 @@ public class CourseStreamingServiceImpl extends ServiceImpl<CourseStreamingMappe
     @Autowired
     private CourseStreamingMapper courseStreamingMapper;
 
+    @Autowired
+    private IPolyvVideoService iPolyvVideoService;
+
     @Override
     public CourseStreamingVo queryById(Long id){
         CourseStreaming db = this.baseMapper.selectById(id);
@@ -133,6 +140,18 @@ public class CourseStreamingServiceImpl extends ServiceImpl<CourseStreamingMappe
      */
     private void validEntityBeforeSave(CourseStreaming entity){
         //TODO 做一些数据校验,如唯一约束
+        if(StringUtils.isNotBlank(entity.getRecordingVideoId())){
+            try{
+                PolyvVideoQuerVo polyvVideo = iPolyvVideoService.queryById(entity.getRecordingVideoId());
+                if(polyvVideo == null){
+                    throw new CustomException("保利威视频不存在");
+                }
+                entity.setPolyvId(polyvVideo.getPolyvId());
+            }catch (Exception e){
+                throw new CustomException("保利威视频错误");
+            }
+
+        }
     }
 
     @Override

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseStreamingVo.java

@@ -77,5 +77,9 @@ public class CourseStreamingVo {
 	/** 业务层级列表 */
 	@ApiModelProperty("业务层级列表")
 	private List<CourseStreamingBusiness> businessList;
+	/** 保利威视频url */
+	@Excel(name = "保利威视频url")
+	@ApiModelProperty("保利威视频url")
+	private String polyvUrl;
 
 }

+ 6 - 2
zhongzheng-system/src/main/resources/mapper/modules/course/CourseStreamingMapper.xml

@@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="status" column="status"/>
+        <result property="polyvId" column="polyv_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseStreamingVo" id="CourseStreamingResultVo">
@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="recordingVideoId" column="recording_video_id"/>
         <result property="playbackUrl" column="playback_url"/>
         <result property="status" column="status"/>
+        <result property="polyvUrl" column="polyv_url"/>
         <collection property="businessList" javaType="java.util.List" resultMap="CourseStreamingBusinessResult"/>
     </resultMap>
 
@@ -56,18 +58,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
         cs.*,
         csb.education_type_id,
-        csb.id as join_id,
+        csb.id AS join_id,
         csb.business_id,
         csb.project_id,
         cet.education_name,
         cpt.project_name,
-        cb.business_name
+        cb.business_name,
+        pv.mp4 AS polyv_url
         FROM
         course_streaming cs
         LEFT JOIN course_streaming_business csb ON cs.id = csb.streaming_id
         LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
         LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
         LEFT JOIN course_business cb ON csb.business_id = cb.id
+        LEFT JOIN polyv_video pv ON cs.polyv_id = pv.polyv_id
         WHERE
         1 = 1
         <if test="businessId != null and businessId != ''">