教师端完成课程接口

master
pd 4 years ago
parent c761cea942
commit d48bffbfae
  1. 16
      src/main/java/com/yipin/liuwanr/controller/ProjectAndCourseController.java
  2. 44
      src/main/java/com/yipin/liuwanr/entity/CourseSchedule.java
  3. 5
      src/main/java/com/yipin/liuwanr/mapper/TeacherProjectAndCourseMapper.java
  4. 16
      src/main/java/com/yipin/liuwanr/service/ProjectAndCourseService.java

@ -2,6 +2,7 @@ package com.yipin.liuwanr.controller;
import java.util.HashMap; import java.util.HashMap;
import com.yipin.liuwanr.entity.CourseSchedule;
import com.yipin.liuwanr.vo.CourseAndProjectVo; import com.yipin.liuwanr.vo.CourseAndProjectVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@ -109,7 +110,22 @@ public class ProjectAndCourseController {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
return resp;
}
//添加课程进度
@PostMapping("/addCourseSchedule")
Response addCourseSchedule(@RequestBody CourseSchedule courseSchedule) {
Response resp = new Response();
HashMap<String, Object> ret = service.addCourseSchedule(courseSchedule);
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; return resp;
} }
} }

@ -0,0 +1,44 @@
package com.yipin.liuwanr.entity;
/**
* 课程进度
*/
public class CourseSchedule {
private Integer scheduleId;
private Integer courseId;
private Integer experimentalClassId;
private Integer projectId;
public Integer getScheduleId() {
return scheduleId;
}
public void setScheduleId(Integer scheduleId) {
this.scheduleId = scheduleId;
}
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getExperimentalClassId() {
return experimentalClassId;
}
public void setExperimentalClassId(Integer experimentalClassId) {
this.experimentalClassId = experimentalClassId;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
}

@ -2,6 +2,7 @@ package com.yipin.liuwanr.mapper;
import java.util.List; import java.util.List;
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.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -58,4 +59,8 @@ public interface TeacherProjectAndCourseMapper {
"</script>"}) "</script>"})
void addBatchTeachProject(@Param("experimentalClassId") Integer experimentalClassId,@Param("courseId") Integer courseId,@Param("projectIds") List<Integer> projectIds); void addBatchTeachProject(@Param("experimentalClassId") Integer experimentalClassId,@Param("courseId") Integer courseId,@Param("projectIds") List<Integer> projectIds);
//添加课程进度
@Insert("insert into hr_course_schedule (courseId,experimentalClassId,projectId) VALUES (#{courseId},#{experimentalClassId},#{projectId})")
void addCourseSchedule(CourseSchedule courseSchedule);
} }

@ -5,6 +5,7 @@ import java.util.List;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yipin.liuwanr.entity.CourseSchedule;
import com.yipin.liuwanr.entity.PageResult; import com.yipin.liuwanr.entity.PageResult;
import com.yipin.liuwanr.mapper.ExperimentallearningMapper; import com.yipin.liuwanr.mapper.ExperimentallearningMapper;
import com.yipin.liuwanr.vo.CourseAndProjectVo; import com.yipin.liuwanr.vo.CourseAndProjectVo;
@ -129,6 +130,19 @@ public class ProjectAndCourseService {
return resp; return resp;
} }
//添加课程进度
public HashMap<String, Object> addCourseSchedule(CourseSchedule courseSchedule){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
mapper.addCourseSchedule(courseSchedule);
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