| | |
| | | } |
| | | |
| | | /** |
| | | * 课程课件 |
| | | * 课程课件 |
| | | * |
| | | */ |
| | | @Override |
| | | public Map<String,Object> listLectureBySubjectOrderCreateTime(String subjectId, String classId, String sort, Pager pager) { |
| | | Subject subject = this.read(Subject.class, subjectId); |
| | | if(Subject.TYPE_PUBLIC_SUBJECT == subject.getType()) {//公开课课件 |
| | | if(Subject.TYPE_PUBLIC_SUBJECT == subject.getType()) {//公开课课件 |
| | | return this.listOpenLectureBySubjectOrderCreateTime(subjectId, sort, pager); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 公开课课件 |
| | | * 公开课课件 |
| | | * |
| | | * @param subjectId |
| | | * @param sort |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除单个章节 |
| | | * 删除单个章节 |
| | | * |
| | | * @param chapterId 章节id |
| | | * @param chapterId 章节id |
| | | * @return |
| | | */ |
| | | private Result deleteChapter(String chapterId) { |
| | |
| | | lecture.setStatus(res.getStatus()); |
| | | save(lecture); |
| | | |
| | | // 发送消息 |
| | | // 发送消息 |
| | | doPublishMsg(lecture); |
| | | |
| | | return new Result(true, "success"); |
| | | } |
| | | |
| | | //添加课程,发送消息 |
| | | //添加课程,发送消息 |
| | | private void doPublishMsg(ClsSubjectLecture lecture){ |
| | | Subject subject = this.read(Subject.class, lecture.getSubjectId()); |
| | | |
| | |
| | | return ; |
| | | } |
| | | |
| | | //查询直播关联的班级 |
| | | //查询直播关联的班级 |
| | | String hql = "select userId from StuStudent where classId =:classId and deleteFlag is false "; |
| | | |
| | | List<String> lstUserIds = this.findByComplexHql(hql, CollectionUtils.newObjectMap("classId",lecture.getClassId()), String.class); |
| | |
| | | Map<String,String> attrs = CollectionUtils.newStringMap("lectureId",lecture.getLectureId(),"lectureName",lecture.getName(),"subjectId",subject.getSubjectId(), |
| | | "lectureType",lecture.getLectureType(),"subjectName",subject.getName()); |
| | | |
| | | msgInfoService.doSendTextMsgToUsers(lstUserIds.toArray(new String[lstUserIds.size()]),MsgInfo.TYPE_COURSEWARE,"发布了课件",attrs); |
| | | msgInfoService.doSendTextMsgToUsers(lstUserIds.toArray(new String[lstUserIds.size()]),MsgInfo.TYPE_COURSEWARE,"发布了课件",attrs); |
| | | } |
| | | } |
| | | |
| | | public Result updateLecturetime(String targetId) { |
| | | |
| | | ClsSubjectLecture lecture = read(ClsSubjectLecture.class, targetId); |
| | | |
| | | |
| | | TraceUtils.setUpdateTrace(lecture); |
| | | |
| | | lecture.setUpdateTime(new Date()); |
| | | lecture.setUpdator(ClientUtils.getUserId()); |
| | | save(lecture); |
| | | |
| | | return new Result(true, "success"); |
| | | } |
| | | @Override |
| | | public Result updateLecture(String lectureId, String resId) { |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param lectureId 课件id |
| | | * @param lectureId 课件id |
| | | * @return |
| | | */ |
| | | private Result deleteLecture(String lectureId) { |
| | |
| | | TraceUtils.setUpdateTrace(lecture); |
| | | lecture.setDeleteFlag(true); |
| | | save(lecture); |
| | | deleteProgress(lectureId);// 删除对应的进度 |
| | | deleteProgress(lectureId);// 删除对应的进度 |
| | | return new Result(true, "success"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的公开课课件查询 |
| | | * 我的公开课课件查询 |
| | | * |
| | | * @param subjectId |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询数量 |
| | | * 查询数量 |
| | | * |
| | | * @param subjectId |
| | | * @param classId |
| | |
| | | ClsSubjectLecture lecture = read(ClsSubjectLecture.class, lectureId); |
| | | String resItemId = null; |
| | | if(lecture == null) { |
| | | resItemId = read(SubjectLecture.class, lectureId).getResItemId();//班级课件 |
| | | resItemId = read(SubjectLecture.class, lectureId).getResItemId();//班级课件 |
| | | }else { |
| | | resItemId = lecture.getResItemId(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Result doStudy(String clsLectureId, Double from, Double to) { |
| | | return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, clsLectureId, from.doubleValue(), to.doubleValue(), |
| | | return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, clsLectureId, from.intValue(), to.intValue(), |
| | | ClientUtils.getUserId()); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Result listSubjectLecture(String classId, String sort, Pager pager) { |
| | | if(StringUtils.isEmpty(classId)) { |
| | | return new Result(false, "班级id不能为空"); |
| | | return new Result(false, "班级id不能为空"); |
| | | } |
| | | QMyLectureV qMyLectureV = QMyLectureV.myLectureV; |
| | | |
| | |
| | | |
| | | long count = query.fetchCount(); |
| | | |
| | | // 获取查询结果集合 |
| | | // 获取查询结果集合 |
| | | QueryResults<MyLectureV> results = query.limit(pager.getPageSize()).offset(pager.getOffset()).orderBy(order).fetchResults(); |
| | | |
| | | List<Map<String,Object>> resultLst = |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除对应的课件 |
| | | * 删除对应的课件 |
| | | * |
| | | * @param chapterId |
| | | * @return |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取章节下的课件 |
| | | * 获取章节下的课件 |
| | | * |
| | | * @param chapterLst |
| | | * @param lectures |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取章节的第一层数据 |
| | | * 获取章节的第一层数据 |
| | | * |
| | | * @param chapterLst |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 课件按目录分类 |
| | | * 课件按目录分类 |
| | | * |
| | | * @param classId |
| | | * @param subjectId |
| | |
| | | public Result coursewareChapterList(String classId,String subjectId, String type) { |
| | | Subject subject = this.read(Subject.class, subjectId); |
| | | |
| | | if(Subject.TYPE_PUBLIC_SUBJECT == subject.getType() || Subject.TYPE_ORG_SUBJECT == subject.getType()) {//公开课和管理员课程 |
| | | if(Subject.TYPE_PUBLIC_SUBJECT == subject.getType() || Subject.TYPE_ORG_SUBJECT == subject.getType()) {//公开课和管理员课程 |
| | | QSubjectLecture qSubjectLecture = QSubjectLecture.subjectLecture; |
| | | //课件 |
| | | //课件 |
| | | List<Map<String, Object>> lectures = this.listStuLectureByOpenSubject(subjectId); |
| | | |
| | | List<SubjectChapter> lstSubjectChapterLst = this.getListOpenChapter(subjectId); |
| | |
| | | try { |
| | | BeanUtils.copyProperties(objClsSubjectChapter, objSubjectChapter); |
| | | } catch (IllegalAccessException e) { |
| | | log.error("拷贝属性失败BeanUtils.copyProperties(objClsSubjectChapter, objSubjectChapter)", e); |
| | | log.error("拷贝属性失败BeanUtils.copyProperties(objClsSubjectChapter, objSubjectChapter)", e); |
| | | } catch (InvocationTargetException e) { |
| | | log.error("拷贝属性失败BeanUtils.copyProperties(objClsSubjectChapter, objSubjectChapter)", e); |
| | | log.error("拷贝属性失败BeanUtils.copyProperties(objClsSubjectChapter, objSubjectChapter)", e); |
| | | } |
| | | |
| | | lstClsSubjectChapter.add(objClsSubjectChapter); |
| | | } |
| | | } |
| | | //章节 |
| | | //章节 |
| | | List<ClsSubjectChapter> chapterLst = this.getChapterLectures(lstClsSubjectChapter, lectures); |
| | | |
| | | long count = this.getQueryFactory().selectFrom(qSubjectLecture) |
| | |
| | | CollectionUtils.newStringMap("name", "name", "chapterId", "chapterId", "lectures", "lectures")))); |
| | | |
| | | }else{ |
| | | //课件 |
| | | //课件 |
| | | List<Map<String, Object>> lectures = this.listStuLectureBySubject(subjectId, classId); |
| | | //章节 |
| | | //章节 |
| | | List<ClsSubjectChapter> chapterLst = this.getChapterLectures(this.getListChapter(classId, subjectId, null), lectures); |
| | | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("count",this.stuLectureCountBySubject(subjectId, classId), "listData", QBeanUtils.listBean2ListMap(chapterLst, |