From 588ab02ed1267829c2a1fe546120b7c3e2261544 Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Fri, 7 Aug 2020 16:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E7=AB=AF=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B-=E8=A7=86=E9=A2=91=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AliyunOssController.java | 1 - .../ProjectAndCourseController.java | 15 ++++++++++++ .../liuwanr/entity/Project_Management.java | 12 +++++++++- .../mapper/TeacherProjectAndCourseMapper.java | 21 ++++++++++++---- .../service/ProjectAndCourseService.java | 24 +++++++++++++++++++ 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java b/src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java index 74fedab..01c35c1 100644 --- a/src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java +++ b/src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java @@ -46,7 +46,6 @@ public class AliyunOssController { /** * 下载文件 * @param objectName:在阿里云的文件路径 - * @param fileurl:本地路径 * @return */ @GetMapping("/downloadFiles") diff --git a/src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java b/src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java index 4ebd58f..58a9c41 100644 --- a/src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java @@ -128,4 +128,19 @@ public class ProjectAndCourseController { } return resp; } + + @GetMapping("/getCoursevideo") + Response getCoursevideo(@RequestParam Integer courseId,@RequestParam Integer experimentalClassId,@RequestParam Integer studentId) { + Response resp = new Response(); + HashMap 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; + } } diff --git a/src/main/java/com/yipin/liuwanr/entity/Project_Management.java b/src/main/java/com/yipin/liuwanr/entity/Project_Management.java index 49dff99..ca491bc 100644 --- a/src/main/java/com/yipin/liuwanr/entity/Project_Management.java +++ b/src/main/java/com/yipin/liuwanr/entity/Project_Management.java @@ -1,5 +1,7 @@ package com.yipin.liuwanr.entity; +import java.util.List; + /** * 项目管理 * @@ -28,7 +30,15 @@ public class Project_Management { private Integer isAttendance; private Integer signin;//是否签到 - + private List courseLinks; + + public List getCourseLinks() { + return courseLinks; + } + + public void setCourseLinks(List courseLinks) { + this.courseLinks = courseLinks; + } public Integer getSignin() { return signin; diff --git a/src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java b/src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java index b64d3a8..914fb02 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java @@ -2,12 +2,10 @@ package com.yipin.liuwanr.mapper; import java.util.List; +import com.yipin.liuwanr.entity.CourseLink; import com.yipin.liuwanr.entity.CourseSchedule; import com.yipin.liuwanr.vo.CourseAndProjectVo; -import org.apache.ibatis.annotations.Insert; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.*; import com.yipin.liuwanr.entity.Project_Management; @@ -29,7 +27,7 @@ public interface TeacherProjectAndCourseMapper { // ""}) @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 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})") 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 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 queryCourseLink(Integer projectId); } diff --git a/src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java b/src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java index 8a643a7..2a60e96 100644 --- a/src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java +++ b/src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java @@ -145,4 +145,28 @@ public class ProjectAndCourseService { return resp; } + + //课程视频 + public HashMap getCoursevideo(Integer courseId,Integer experimentalClassId,Integer studentId){ + HashMap resp = new HashMap(); + try { + if(!StringUtils.isEmpty(courseId)){ + if(StringUtils.isEmpty(experimentalClassId)){ + if(!StringUtils.isEmpty(studentId)){ + experimentalClassId=experimentallearningMapper.queryExperimentalClassId(courseId,studentId); + } + } + List 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; + } + }