|
@@ -1,6 +1,5 @@
|
|
|
package com.ynfy.buss.course.course.controller;
|
|
|
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -28,9 +27,9 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -137,6 +136,23 @@ public class CourseController extends JeecgController<Course, ICourseService> {
|
|
|
@ApiOperation(value = "course-通过id查询", notes = "course-通过id查询")
|
|
|
@GetMapping(value = "/queryById")
|
|
|
public Result<Course> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ Course course = courseService.queryById(id);
|
|
|
+ if (course == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ course.setCatalogList(courseCatalogService.listByCourseId(course.getId()));
|
|
|
+ return Result.OK(course);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取课程学习明细
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "获取课程学习明细", notes = "获取课程学习明细")
|
|
|
+ @GetMapping(value = "/getCourseStudyDetail")
|
|
|
+ public Result<Course> getCourseStudyDetail(@RequestParam String id) {
|
|
|
Course course = courseService.queryById(id);
|
|
|
if (course == null) {
|
|
|
return Result.error("未找到对应数据");
|
|
@@ -145,6 +161,13 @@ public class CourseController extends JeecgController<Course, ICourseService> {
|
|
|
if (StringUtils.isNotBlank(course.getTeacherPost())) {
|
|
|
course.setTeacherPost(sysPositionService.listByCodes(Arrays.asList(course.getTeacherPost().split(","))));
|
|
|
}
|
|
|
+
|
|
|
+ //获取课程学习进度
|
|
|
+ List<String> courseIdList = new ArrayList<>();
|
|
|
+ courseIdList.add(course.getId());
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ courseService.setCourseStudyProcess(userCourseCatalogService.getUserCourseStudy(courseIdList, sysUser.getId()), course);
|
|
|
+
|
|
|
return Result.OK(course);
|
|
|
}
|
|
|
|