课程资源添加

master
wenyu441069198 5 months ago
parent 2cd9bbe1d7
commit 0d4ec1803b
  1. 14
      src/main/java/com/teaching/backend/controller/courseResource/CourseResourceController.java
  2. 12
      src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java
  3. BIN
      src/main/resources/templates/courses.docx

@ -48,7 +48,19 @@ public class CourseResourceController {
*/ */
@DeleteMapping("/delete") @DeleteMapping("/delete")
public BaseResponse<String> deleteRecords(@RequestParam List<Long> ids){ public BaseResponse<String> deleteRecords(@RequestParam List<Long> ids){
courseResourcesService.removeCourseResources(ids); // courseResourcesService.removeCourseResources(ids);
courseResourcesService.removeBatchByIds(ids);
return ResultUtils.success("删除成功!!"); return ResultUtils.success("删除成功!!");
} }
/**
* 新增
* @param courseResources
* @return
*/
@GetMapping("/save")
public BaseResponse<String> saveCourseResource(@RequestBody CourseResources courseResources){
courseResourcesService.save(courseResources);
return ResultUtils.success("添加成功!");
}
} }

@ -325,7 +325,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
//准备导出数据 //准备导出数据
//查询课程通过课程id查--课程简介 //查询课程通过课程id查--课程简介
Courses courses = this.getById(id); Courses courses = this.getById(id);
System.out.println("课程:"+courses); // System.out.println("课程:"+courses);
//准备数据 //准备数据
String course_name = courses.getName(); String course_name = courses.getName();
String course_code = courses.getCode(); String course_code = courses.getCode();
@ -337,12 +337,12 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
//查询课程目标 //查询课程目标
List<CourseObjectivesTreeVO> courseObjectivesTreeVO = objectivesService.queryCourseObjectivesTree(id); List<CourseObjectivesTreeVO> courseObjectivesTreeVO = objectivesService.queryCourseObjectivesTree(id);
System.out.println("课程目标:"+courseObjectivesTreeVO); // System.out.println("课程目标:"+courseObjectivesTreeVO);
//准备数据 //准备数据
//总目标 //总目标
StringBuilder overall_goal = new StringBuilder(); StringBuilder overall_goal = new StringBuilder();
for (ObjectiveContents content : courseObjectivesTreeVO.get(0).getContents()) { for (ObjectiveContents content : courseObjectivesTreeVO.get(0).getContents()) {
overall_goal.append("\r\n").append(content.getContent()); overall_goal.append("\r\n ").append(content.getContent());
} }
System.out.println(overall_goal); System.out.println(overall_goal);
@ -358,19 +358,19 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl
//知识目标 //知识目标
if (i == 0){ if (i == 0){
for (ObjectiveContents c : content.getContents()) { for (ObjectiveContents c : content.getContents()) {
knowledge_goals.append("\r\n").append(c.getContent()); knowledge_goals.append("\r\n ").append(c.getContent());
} }
} }
//思政目标 //思政目标
if (i == 1){ if (i == 1){
for (ObjectiveContents c : content.getContents()) { for (ObjectiveContents c : content.getContents()) {
political_goals.append("\r\n").append(c.getContent()); political_goals.append("\r\n ").append(c.getContent());
} }
} }
//价值目标 //价值目标
if (i == 2){ if (i == 2){
for (ObjectiveContents c : content.getContents()) { for (ObjectiveContents c : content.getContents()) {
value_goals.append("\r\n").append(c.getContent()); value_goals.append("\r\n ").append(c.getContent());
} }
} }
} }

Loading…
Cancel
Save