教师端开始课程-视频展示

master
pd 4 years ago
parent d62d3df997
commit 588ab02ed1
  1. 1
      src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java
  2. 15
      src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java
  3. 10
      src/main/java/com/yipin/liuwanr/entity/Project_Management.java
  4. 21
      src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java
  5. 24
      src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java

@ -46,7 +46,6 @@ public class AliyunOssController {
/** /**
* 下载文件 * 下载文件
* @param objectName在阿里云的文件路径 * @param objectName在阿里云的文件路径
* @param fileurl:本地路径
* @return * @return
*/ */
@GetMapping("/downloadFiles") @GetMapping("/downloadFiles")

@ -128,4 +128,19 @@ public class ProjectAndCourseController {
} }
return resp; return resp;
} }
@GetMapping("/getCoursevideo")
Response getCoursevideo(@RequestParam Integer courseId,@RequestParam Integer experimentalClassId,@RequestParam Integer studentId) {
Response resp = new Response();
HashMap<String, Object> ret = service.getCoursevideo(courseId,experimentalClassId,studentId);
int status = (int) ret.get("retcode");
if (status == 200) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
return resp;
}
} }

@ -1,5 +1,7 @@
package com.yipin.liuwanr.entity; package com.yipin.liuwanr.entity;
import java.util.List;
/** /**
* 项目管理 * 项目管理
* *
@ -28,7 +30,15 @@ public class Project_Management {
private Integer isAttendance; private Integer isAttendance;
private Integer signin;//是否签到 private Integer signin;//是否签到
private List<CourseLink> courseLinks;
public List<CourseLink> getCourseLinks() {
return courseLinks;
}
public void setCourseLinks(List<CourseLink> courseLinks) {
this.courseLinks = courseLinks;
}
public Integer getSignin() { public Integer getSignin() {
return signin; return signin;

@ -2,12 +2,10 @@ package com.yipin.liuwanr.mapper;
import java.util.List; import java.util.List;
import com.yipin.liuwanr.entity.CourseLink;
import com.yipin.liuwanr.entity.CourseSchedule; import com.yipin.liuwanr.entity.CourseSchedule;
import com.yipin.liuwanr.vo.CourseAndProjectVo; import com.yipin.liuwanr.vo.CourseAndProjectVo;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.yipin.liuwanr.entity.Project_Management; import com.yipin.liuwanr.entity.Project_Management;
@ -29,7 +27,7 @@ public interface TeacherProjectAndCourseMapper {
// "</script>"}) // "</script>"})
@Select("select DISTINCT hpm.projectId,projectName,isOpenProject,isAttendance from hr_project_management hpm left join teacher_project tp on hpm.projectId=tp.projectId " + @Select("select DISTINCT hpm.projectId,projectName,isOpenProject,isAttendance from hr_project_management hpm left join teacher_project tp on hpm.projectId=tp.projectId " +
" where hpm.isdel=0 and tp.courseId=#{courseId} and tp.experimentalClassId=#{experimentalClassId}") " where tp.courseId=#{courseId} and tp.experimentalClassId=#{experimentalClassId}")
List<Project_Management> getBySystemId(@Param("courseId") Integer courseId,@Param("experimentalClassId")Integer experimentalClassId); List<Project_Management> getBySystemId(@Param("courseId") Integer courseId,@Param("experimentalClassId")Integer experimentalClassId);
@ -63,4 +61,17 @@ public interface TeacherProjectAndCourseMapper {
//添加课程进度 //添加课程进度
@Insert("insert into hr_course_schedule (courseId,experimentalClassId,projectId) VALUES (#{courseId},#{experimentalClassId},#{projectId})") @Insert("insert into hr_course_schedule (courseId,experimentalClassId,projectId) VALUES (#{courseId},#{experimentalClassId},#{projectId})")
void addCourseSchedule(CourseSchedule courseSchedule); void addCourseSchedule(CourseSchedule courseSchedule);
@Select("select DISTINCT hpm.projectId,projectName from hr_project_management hpm left join teacher_project tp on hpm.projectId=tp.projectId " +
" where tp.courseId=#{courseId} and tp.experimentalClassId=#{experimentalClassId}")
@Results({
@Result(id = true,column = "projectId",property = "projectId"),
@Result(column = "projectName",property = "projectName"),
@Result(column = "projectId",property = "courseLinks",many = @Many(select = "com.yipin.liuwanr.mapper.TeacherProjectAndCourseMapper.queryCourseLink"))
})
List<Project_Management> queryProjects(@Param("courseId") Integer courseId,@Param("experimentalClassId")Integer experimentalClassId);
@Select("select linkName,fileLink from hr_course_link where projectId=#{projectId} and isdel=0 GROUP BY linkId")
List<CourseLink> queryCourseLink(Integer projectId);
} }

@ -145,4 +145,28 @@ public class ProjectAndCourseService {
return resp; return resp;
} }
//课程视频
public HashMap<String, Object> getCoursevideo(Integer courseId,Integer experimentalClassId,Integer studentId){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
if(!StringUtils.isEmpty(courseId)){
if(StringUtils.isEmpty(experimentalClassId)){
if(!StringUtils.isEmpty(studentId)){
experimentalClassId=experimentallearningMapper.queryExperimentalClassId(courseId,studentId);
}
}
List<Project_Management> project=mapper.queryProjects(courseId,experimentalClassId);
resp.put("retvalue", project);
resp.put("retcode", 200);
}
}catch (Exception e){
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "视频失败");
return resp;
}
return resp;
}
} }

Loading…
Cancel
Save