| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.qxueyou.scc.base.model.UserInfoWrapper; |
| | | import com.qxueyou.scc.user.model.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | |
| | | |
| | | /** |
| | | * 学习端 课程前端控制器 |
| | | * |
| | | * |
| | | * @author chenjunliang |
| | | * |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | ProgressDAO progressDao; |
| | | |
| | | |
| | | @Autowired |
| | | ITopicService topicService; |
| | | |
| | | |
| | | @Autowired |
| | | IEvaluateService evaluateService; |
| | | |
| | | |
| | | //--------------------------------------------------------------app端接口--------------------------------------------------------------------------------------------------- |
| | | /** |
| | | * 学习端获取 所有课件 |
| | | * |
| | | * |
| | | * @param classId |
| | | * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) |
| | | */ |
| | |
| | | System.out.println(classId); |
| | | return clsLectureService.listSubjectLecture(CommonUtils.getClassId(classId), sort, pager); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "学习端获取课程学年列表") |
| | | @ApiImplicitParams({ |
| | |
| | | List<Map<String, Object>> lstSubject = subjectService.clsSubjectlist(classId, null, null); |
| | | //组装的学期和课程 |
| | | List<Map<String, Object>> lstTerm = subjectService.termSubjectList(classId, lstSubject); |
| | | |
| | | |
| | | return new Result(true, "success",CollectionUtils.newObjectMap("termList", lstTerm, "allSubject", lstSubject)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "我的课程按学期分类") |
| | | @ApiImplicitParams({ |
| | |
| | | } |
| | | return new Result(true, "success",subjectService.myTermSubjectList(classId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "我的课程按时间排序") |
| | | @ApiImplicitParams({ |
| | |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("count", count, "listData", subjectService.mySubjectList(classId, pager))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 我的课程详情 |
| | | * |
| | | * |
| | | * @param subjectId |
| | | * @param classId |
| | | * @return |
| | |
| | | } |
| | | return new Result(true, "success", subjectService.mySubjectInfo(subjectId, classId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "我的班级信息") |
| | | @ApiImplicitParams({ |
| | |
| | | } |
| | | return new Result(true, "success",subjectService.myClassInfo(classId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "学习端获取课程列表") |
| | | @ApiImplicitParams({ |
| | |
| | | public Result subjectList(String classId, Integer schoolYear, Integer term) { |
| | | return new Result(true, "success",subjectService.clsSubjectlist(CommonUtils.getClassId(classId), schoolYear, term)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "学习端获取课程下课件,按创建时间排序") |
| | | @ApiImplicitParams({ |
| | |
| | | public Result listLectureBySubject(String subjectId, String classId, @RequestParam(defaultValue="desc")String sort, Pager pager) { |
| | | return new Result(true, "success",clsLectureService.listLectureBySubjectOrderCreateTime(subjectId, CommonUtils.getClassId(classId), sort, pager)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取其他课件统计 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "学习端获取其他课件统计") |
| | | @GetMapping(value = "/app/otherLectureCount") |
| | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("topicCount", |
| | | topicService.getClassTopicCount(ClientUtils.getClassId()), "evaluate", this.evaluateService.queryStuEvaluateCount())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * 学习端获取课程列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "学习端获取课程下课件,按目录分类", notes = "") |
| | | @ApiImplicitParams({ |
| | |
| | | @GetMapping(value = "/app/coursewareList") |
| | | public Result coursewareList(String classId,String subjectId, String type) { |
| | | classId = CommonUtils.getClassId(classId); |
| | | |
| | | |
| | | if(StringUtils.isEmpty(subjectId)) { |
| | | return new Result(false, "课程id不能为空"); |
| | | } |
| | | |
| | | |
| | | return this.clsLectureService.coursewareChapterList(classId, subjectId, type); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 我的公开课列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "我的公开课列表", notes = "") |
| | | @GetMapping(value = "/app/myOpenSubjectList") |
| | | public Result myOpenSubjectList(Pager pager, @RequestParam(defaultValue = "")String keyword) { |
| | | return new Result(true, "success", this.subjectService.myOpenSubjectList(pager.getOffset(), pager.getPageSize(), keyword)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 公开课列表 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "公开课列表", notes = "") |
| | | @GetMapping(value = "/app/openSubjectList") |
| | | public Result openSubjectList(Pager pager, @RequestParam(defaultValue = "")String keyword) { |
| | | return new Result(true, "success", this.subjectService.openSubjectList(pager.getOffset(), pager.getPageSize(), keyword)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 公开课详情 |
| | | * |
| | | * |
| | | */ |
| | | @ApiOperation(value = "公开课详情", notes = "") |
| | | @GetMapping(value = "/app/openSubjectInfo") |
| | | public Result openSubjectInfo(@RequestParam(defaultValue = "")String subjectId) { |
| | | return new Result(true, "success", this.subjectService.openSubjectInfo(subjectId)); |
| | | } |
| | | |
| | | |
| | | //--------------------------------------------------------后台端接口--------------------------------------------------------------------------------------------------- |
| | | |
| | | /** |
| | |
| | | for (SubjectProgressTreeV v : chapterLst) { |
| | | v.setNodeName(v.getNodeName() + "(" + String.format("%.2f", v.getPercent()*100) + "%)"); //保留两位小数 |
| | | } |
| | | |
| | | |
| | | return new Result(true, "success", QBeanUtils.listBean2ListMap(chapterLst, CollectionUtils |
| | | .newStringMap("nodeName", "name", "id.nodeId", "id", "parentId", "parentId", "percent", "percent"))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 学习端获取 所有课件 |
| | | * |
| | | * |
| | | * @param classId |
| | | * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课件列表 |
| | | * |
| | | * |
| | | * @param chapterId |
| | | * 章节id |
| | | * @param type |
| | |
| | | |
| | | /** |
| | | * 课件学习进度提交 stu/subject/study |
| | | * |
| | | * |
| | | * @param lectureId |
| | | * 课件id |
| | | * @param from |
| | |
| | | |
| | | /** |
| | | * 音频时长提交 stu/subject/submitAudioDuration |
| | | * |
| | | * |
| | | * @param lectureId |
| | | * 课件id |
| | | * @param seconds |
| | |
| | | |
| | | /** |
| | | * 课程列表 |
| | | * |
| | | * |
| | | * @param clssId |
| | | * 班级id |
| | | * @param startTime |
| | |
| | | @ApiImplicitParam(name = "startTime", value = "开班时间", required = false, paramType="query", dataType = "String") |
| | | }) |
| | | @GetMapping(value = "getSubjectLst") |
| | | public Result getList(String classId, String startTime, Integer limit, @RequestParam(defaultValue="1")Integer pageNum, HttpServletRequest request) { |
| | | // System.out.println("用户id"+request.getSession().getAttribute("userId")); |
| | | Object userId = request.getSession().getAttribute("userId"); |
| | | public Result getList(String userId,String classId, String startTime, Integer limit, @RequestParam(defaultValue="1")Integer pageNum, HttpServletRequest request) { |
| | | userId = StringUtils.isEmpty(userId)?ClientUtils.getUserId():userId; |
| | | if(userId == null || userId == ""){ |
| | | userId = ClientUtils.getUserId(); |
| | | } |
| | | classId = StringUtils.isEmpty(classId)?ClientUtils.getClassId():classId; |
| | | List<MySubjectV> result = subjectService.listMySubjectV(classId,String.valueOf(userId)); |
| | | List<MySubjectV> result = subjectService.listMySubjectV(classId,userId); |
| | | return new Result(true, "success", |
| | | QBeanUtils.listBean2ListMap(result, |
| | | CollectionUtils.newStringMap("id.subjectId", "subjectId", "id.classId", "classId", |
| | | "subjectName", "subjectName,coursewareName", "percent", "percent", "progressValue", |
| | | "studyTime", "coverPageUrl", "coverPageUrl"))); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 进入课程 |
| | | * |
| | | * |
| | | * @param subjectId |
| | | * 课程id |
| | | */ |