Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java
master
shijie 4 years ago
commit 9cc9fcfe7d
  1. 45
      src/main/java/com/yipin/liuwanr/controller/AliyunOssController.java
  2. 15
      src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java
  3. 12
      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

@ -24,7 +24,6 @@ public class AliyunOssController {
/**
* 上传文件
*
* @param file
* @return
*/
@ -42,29 +41,27 @@ public class AliyunOssController {
}
return resp;
}
}
/**
* 下载文件
* @param objectName在阿里云的文件路径
* @return
*/
@GetMapping("/downloadFiles")
Response downloadFiles(HttpServletResponse response,@RequestParam String objectName) {
Response resp = new Response();
try {
ossService.downloadFiles(response,objectName);
resp.setStatus(200);
resp.setMessage("下载成功!");
} catch (Exception e) {
resp.setStatus(300);
resp.setErrmessage("下载失败");
}
return null;
/**
* 下载文件
*
* @param objectName在阿里云的文件路径
* @param fileurl:本地路径
* @return
*/
@GetMapping("/downloadFiles")
Response downloadFiles(HttpServletResponse response, @RequestParam String objectName) {
Response resp = new Response();
try {
ossService.downloadFiles(response, objectName);
resp.setStatus(200);
resp.setMessage("下载成功!");
} catch (Exception e) {
resp.setStatus(300);
resp.setErrmessage("下载失败");
}
return null;
}
}
}

@ -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<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;
import java.util.List;
/**
* 项目管理
*
@ -28,7 +30,15 @@ public class Project_Management {
private Integer isAttendance;
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() {
return signin;

@ -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 {
// "</script>"})
@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);
@ -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<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;
}
//课程视频
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