| | |
| | | |
| | | save(subject); |
| | | |
| | | //初始化创建 根节点 |
| | | //初始化创建 根节点 |
| | | SubjectChapter chapter = new SubjectChapter(); |
| | | TraceUtils.setCreateTrace(chapter); |
| | | chapter.setName("根节点"); |
| | | chapter.setName("根节点"); |
| | | chapter.setSubjectId(subject.getSubjectId()); |
| | | chapter.setParentChapterId(SubjectChapter.ROOT_CHAPTER_ID); |
| | | save(chapter); |
| | |
| | | |
| | | save(subject); |
| | | |
| | | //更新所有关联的课程 |
| | | //更新所有关联的课程 |
| | | if (subject.getType() == Subject.TYPE_ORG_SUBJECT) { |
| | | this.bulkUpdate("update Subject t set t.name=?,t.contentFileId=?," |
| | | + "t.coverPageFileId=?,t.coverPageUrl=? where t.deleteFlag is false and t.origSubjectId=? ", new Object[]{subject.getName(), |
| | |
| | | for (String subjectId : subjectIds) { |
| | | deleteSubject(subjectId); |
| | | |
| | | //删除班级课程 |
| | | //删除班级课程 |
| | | List<Map<String, Object>> result = this.findListWithMapByHql( |
| | | "select r.classId as classId,r.subjectId as subjectId from ClsClassReSubject r,Subject j " |
| | | + "where r.subjectId = j.subjectId and j.origSubjectId=:origSubjectId and r.deleteFlag is false and j.deleteFlag is false", |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除单个课程 |
| | | * 删除单个课程 |
| | | * |
| | | * @param chapterId 章节id |
| | | * @param chapterId 章节id |
| | | * @return |
| | | */ |
| | | private Result deleteSubject(String subjectId) { |
| | |
| | | |
| | | |
| | | /** |
| | | * app教师端课程列表 |
| | | * app教师端课程列表 |
| | | * |
| | | * @param text |
| | | * @param status |
| | |
| | | public Result teacherSubjectList(Pager pager, String keyword, String status, Integer type) { |
| | | String teacherId = teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | if (StringUtils.isEmpty(teacherId)) { |
| | | return new Result(false, "当前用户无老师角色"); |
| | | return new Result(false, "当前用户无老师角色"); |
| | | } |
| | | |
| | | QSubject qSubject = QSubject.subject; |
| | |
| | | |
| | | Subject sub = read(subjectId); |
| | | |
| | | //读取原课程 |
| | | //读取原课程 |
| | | if (StringUtils.isNotBlank(sub.getOrigSubjectId())) { |
| | | sub = read(sub.getOrigSubjectId()); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 发布单个课程 |
| | | * 发布单个课程 |
| | | * |
| | | * @param chapterId 章节id |
| | | * @param chapterId 章节id |
| | | * @return |
| | | */ |
| | | private Result releaseSubject(String subjectId) { |
| | |
| | | |
| | | save(subject); |
| | | |
| | | //更新所有关联的课程 |
| | | //更新所有关联的课程 |
| | | this.bulkUpdate("update Subject set status='" + Subject.STATUS_ISSUED + "' where origSubjectId=? and deleteFlag is false ", new Object[]{subjectId}); |
| | | |
| | | return new Result(true, "success"); |
| | | } |
| | | |
| | | /** |
| | | * 发布单个课程 |
| | | * 发布单个课程 |
| | | * |
| | | * @param chapterId 章节id |
| | | * @param chapterId 章节id |
| | | * @return |
| | | */ |
| | | private Result cancelSubject(String subjectId) { |
| | |
| | | |
| | | save(subject); |
| | | |
| | | //更新所有关联的课程 |
| | | //更新所有关联的课程 |
| | | this.bulkUpdate("update Subject set status='" + Subject.STATUS_OFFLINE + "' where origSubjectId=? and deleteFlag is false ", new Object[]{subjectId}); |
| | | |
| | | return new Result(true, "success"); |
| | |
| | | |
| | | @Override |
| | | public Result addClsSubject(String classId, String origSubjectId, String teacherId, Integer schoolYear, Integer term) throws IllegalAccessException, InvocationTargetException { |
| | | //新增老师课程 |
| | | //新增老师课程 |
| | | Subject newSubject = new Subject(); |
| | | Subject origSubject = this.read(origSubjectId); |
| | | UserTeacher teacher = this.read(UserTeacher.class, teacherId); |
| | |
| | | newSubject.setOrgId(ClientUtils.getOrgId()); |
| | | save(newSubject); |
| | | |
| | | //添加班级课程关系 |
| | | //添加班级课程关系 |
| | | addClassReSubject(newSubject.getSubjectId(), classId); |
| | | |
| | | //复制课件 |
| | | //复制课件 |
| | | clsLectureService.doCopyLecturesToClass(origSubjectId, newSubject.getSubjectId(), classId); |
| | | |
| | | return new Result(true, "success", CollectionUtils.newStringMap("subjectId", newSubject.getSubjectId())); |
| | |
| | | Subject subject = this.read(subjectId); |
| | | UserTeacher teacher = this.read(UserTeacher.class, teacherId); |
| | | |
| | | //如果原课程做出了修改 |
| | | //如果原课程做出了修改 |
| | | if (!origSubjectId.equals(subject.getOrigSubjectId())) { |
| | | subject.setContentFileId(origSubject.getCoverPageFileId()); |
| | | subject.setCoverPageUrl(origSubject.getCoverPageUrl()); |
| | |
| | | subject.setOrigSubjectId(origSubjectId); |
| | | subject.setOrigCopySubjectId(origSubjectId); |
| | | |
| | | //清理并复制原课程 |
| | | //清理并复制原课程 |
| | | clsLectureService.doClearLecturesToClass(classId, subjectId); |
| | | clsLectureService.doCopyLecturesToClass(origSubjectId, subjectId, classId); |
| | | } else { |
| | |
| | | List<String> reIdLst = this.findByComplexHql("select r.clsReSubjectId from ClsClassReSubject r where r.deleteFlag is false and r.classId=:classId and r.subjectId in (:subjectIds) ", |
| | | paramMap, String.class); |
| | | |
| | | //删除关联关系 |
| | | //删除关联关系 |
| | | if (reIdLst != null && reIdLst.size() > 0) { |
| | | this.bulkUpdateInLoop("update ClsClassReSubject set deleteFlag = true where clsReSubjectId=?", reIdLst.toArray()); |
| | | } |
| | |
| | | @Override |
| | | public Result getDataDesc(String classId, String subjectId) { |
| | | if (StringUtils.isEmpty(classId)) { |
| | | return new Result(false, "班级id参数错误"); |
| | | return new Result(false, "班级id参数错误"); |
| | | } |
| | | QSubjectProgressTreeV qSubjectProgressTreeV = QSubjectProgressTreeV.subjectProgressTreeV; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取班级对应的学员 按进度进行排序 |
| | | * 获取班级对应的学员 按进度进行排序 |
| | | */ |
| | | private List<Map<String, Object>> percentDesc(String classId, String subjectId, @SuppressWarnings("rawtypes") OrderSpecifier order) { |
| | | QSubjectProgressTreeV qSubjectProgressTreeV = QSubjectProgressTreeV.subjectProgressTreeV; |
| | |
| | | where(qSubjectProgressTreeV.id.userId.eq(qUser.userId).and(qSubjectProgressTreeV.nodeType.eq(nodeType)) |
| | | .and(qSubjectProgressTreeV.id.nodeId.eq(nodeId))).orderBy(order).fetch().stream().map(tuple -> { |
| | | |
| | | List<ClsClassReSubject> clsClassReSubjects = find("from ClsClassReSubject where classId = ?",CollectionUtils.newList(nodeId),ClsClassReSubject.class); |
| | | Double percent = 0.0; |
| | | Double progressValue = 0.0; |
| | | Double percentAvg = 0.0; |
| | | int size = 0; |
| | | for(ClsClassReSubject c : clsClassReSubjects) { |
| | | List<MyLectureV> myLectureVList = lectureService.listLectureVBySubjectId(tuple.get(qUser.userId), c.getSubjectId(), "", 1000, 1, null); |
| | | if (!myLectureVList.isEmpty()) { |
| | | for (MyLectureV myLectureV : myLectureVList) { |
| | | if (myLectureV.getPercent() != null && myLectureV.getProgressValue() != null) { |
| | | percent += myLectureV.getPercent(); |
| | | progressValue += myLectureV.getProgressValue().intValue(); |
| | | } |
| | | } |
| | | size += myLectureVList.size(); |
| | | if (percentAvg.isNaN()) { |
| | | percentAvg += 0.0; |
| | | } |
| | | } |
| | | } |
| | | List<ClsClassReSubject> clsClassReSubjects = find("from ClsClassReSubject where classId = ?",CollectionUtils.newList(nodeId),ClsClassReSubject.class); |
| | | Double percent = 0.0; |
| | | Double progressValue = 0.0; |
| | | Double percentAvg = 0.0; |
| | | int size = 0; |
| | | for(ClsClassReSubject c : clsClassReSubjects) { |
| | | List<MyLectureV> myLectureVList = lectureService.listLectureVBySubjectId(tuple.get(qUser.userId), c.getSubjectId(), "", 1000, 1, null); |
| | | if (!myLectureVList.isEmpty()) { |
| | | for (MyLectureV myLectureV : myLectureVList) { |
| | | if (myLectureV.getPercent() != null && myLectureV.getProgressValue() != null) { |
| | | percent += myLectureV.getPercent(); |
| | | progressValue += myLectureV.getProgressValue().intValue(); |
| | | } |
| | | } |
| | | size += myLectureVList.size(); |
| | | if (percentAvg.isNaN()) { |
| | | percentAvg += 0.0; |
| | | } |
| | | } |
| | | } |
| | | percentAvg += percent / size; |
| | | if(percentAvg.isNaN()){ |
| | | percentAvg = 0.0; |
| | | } |
| | | if(percentAvg.isNaN()){ |
| | | percentAvg = 0.0; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("userName", tuple.get(qUser.name)); |
| | | map.put("userId", tuple.get(qUser.userId)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过作业完成个数排序 |
| | | * 通过作业完成个数排序 |
| | | */ |
| | | private List<Map<String, Object>> exerciseInfoDesc(String classId, String subjectId) { |
| | | QExerciseResultV qExerciseResultV = QExerciseResultV.exerciseResultV; |
| | | //查询条件 |
| | | //查询条件 |
| | | Predicate predicate = StringUtils.isEmpty(subjectId) ? qExerciseResultV.id.classId.eq(classId) : |
| | | qExerciseResultV.id.classId.eq(classId).and(qExerciseResultV.subjectId.eq(subjectId)); |
| | | //case数量判断 |
| | | //case数量判断 |
| | | NumberExpression<BigDecimal> caseCount = new CaseBuilder() |
| | | .when(qExerciseResultV.completeStatus.eq(ExerciseCompleteInfo.STATUS_CHECKED) |
| | | .or(qExerciseResultV.completeStatus.eq(ExerciseCompleteInfo.STATUS_COMMIT))) |
| | | .then(BigDecimal.ONE).otherwise(BigDecimal.ZERO).sum(); |
| | | |
| | | //case分数 |
| | | //case分数 |
| | | NumberExpression<BigDecimal> caseScoreSum = new CaseBuilder() |
| | | .when(qExerciseResultV.completeStatus.eq(ExerciseCompleteInfo.STATUS_CHECKED) |
| | | .or(qExerciseResultV.completeStatus.eq(ExerciseCompleteInfo.STATUS_COMMIT))) |
| | |
| | | private List<Map<String, Object>> examInfoDesc(String classId, String subjectId) { |
| | | |
| | | QExamResultV qExamResultV = QExamResultV.examResultV; |
| | | //查询条件 |
| | | //查询条件 |
| | | Predicate predicate = StringUtils.isEmpty(subjectId) ? qExamResultV.id.classId.eq(classId) : |
| | | qExamResultV.id.classId.eq(classId).and(qExamResultV.subjectId.eq(subjectId)); |
| | | //case判断 |
| | | //case判断 |
| | | NumberExpression<BigDecimal> caseCount = new CaseBuilder() |
| | | .when(qExamResultV.status.eq("0")).then(BigDecimal.ZERO).otherwise(BigDecimal.ONE).sum(); |
| | | //case分数 |
| | | //case分数 |
| | | NumberExpression<BigDecimal> caseScoreSum = new CaseBuilder() |
| | | .when(qExamResultV.status.eq("0")).then(BigDecimal.ZERO).otherwise(qExamResultV.score).sum(); |
| | | |
| | |
| | | .and(qClsClassReSubject.classId::eq, classId) |
| | | .and(qClsClassReSubject.subjectId::eq, qSubject.subjectId) |
| | | .and(qClsClassReSubject.deleteFlag::eq, false).and(qSubject.status::eq, Subject.STATUS_ISSUED); |
| | | if (schoolYear != null && schoolYear != 0) {//学年 |
| | | if (schoolYear != null && schoolYear != 0) {//学年 |
| | | builder = builder.and(qSubject.schoolYear::eq, schoolYear); |
| | | } |
| | | if (term != null && term != 0) {//学期 |
| | | if (term != null && term != 0) {//学期 |
| | | builder = builder.and(qSubject.term::eq, term); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的班级信息 |
| | | * 我的班级信息 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | |
| | | List<Subject> lstSubject = objClsClass.getSubjects(); |
| | | |
| | | //过滤掉状态为草稿的 |
| | | //过滤掉状态为草稿的 |
| | | List<String> teachers = lstSubject.stream().filter(u -> u.getStatus().equals(Subject.STATUS_ISSUED)).map(tuple -> { |
| | | return tuple.getTeacherName(); |
| | | }).collect(Collectors.toList()); |
| | |
| | | |
| | | long lgCount = this.getQueryFactory().selectFrom(qSubjectProgressTreeV) |
| | | .where(qSubjectProgressTreeV.id.nodeId.eq(classId).and(qSubjectProgressTreeV.percent.gt(objSubjectProgressTreeV.getPercent()))).fetchCount(); |
| | | //排行 |
| | | //排行 |
| | | float rank = (allCount - lgCount) / allCount; |
| | | |
| | | return CollectionUtils.newObjectMap("className", objClsClass.getName(), "progressPercent", |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取我的课程进度 |
| | | * 获取我的课程进度 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取我的课程数量 |
| | | * 获取我的课程数量 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取学员的课程进度 |
| | | * 获取学员的课程进度 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取课件数量 |
| | | * 获取课件数量 |
| | | * |
| | | * @param subjectId |
| | | * @return |
| | |
| | | if (subject == null) { |
| | | return 0l; |
| | | } |
| | | if (subject.getType() == Subject.TYPE_CLS_SUBJECT) {//班级课程 |
| | | if (subject.getType() == Subject.TYPE_CLS_SUBJECT) {//班级课程 |
| | | |
| | | QClsSubjectLecture qSubjectLecture = QClsSubjectLecture.clsSubjectLecture; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 我的公开课列表 |
| | | * 我的公开课列表 |
| | | * |
| | | * @param pageNum |
| | | * @param pageSize |
| | |
| | | |
| | | Map<String, Object> openSubjectDetail = this.openSubjectDetail(subjectId); |
| | | |
| | | // 直播数量 |
| | | // 直播数量 |
| | | map.put("mediaVideoLiveCount", openSubjectDetail.get("mediaVideoLiveCount")); |
| | | |
| | | // 课件数量 |
| | | // 课件数量 |
| | | map.put("subjectLectureCount", openSubjectDetail.get("subjectLectureCount")); |
| | | |
| | | //学习人次 |
| | | //学习人次 |
| | | map.put("studyCount", openSubjectDetail.get("studyCount")); |
| | | |
| | | map.put("content", openSubjectDetail.get("content")); |
| | | |
| | | // 已观看完成课件数量 |
| | | // 已观看完成课件数量 |
| | | map.put("subjectLectureDoCount", openSubjectDetail.get("subjectLectureDoCount")); |
| | | |
| | | return map; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 课程统计详情 |
| | | * 课程统计详情 |
| | | * |
| | | * @param subjectId |
| | | * @return |
| | |
| | | QSubjectLecture qSubjectLecture = QSubjectLecture.subjectLecture; |
| | | QProgress qProgress = QProgress.progress; |
| | | |
| | | // 直播数量 |
| | | // 直播数量 |
| | | map.put("mediaVideoLiveCount", |
| | | this.getQueryFactory().select(qMediaVideoLive).from(qMediaVideoLive) |
| | | .where(qMediaVideoLive.deleteFlag.isFalse() |
| | |
| | | .and(qMediaVideoLive.subjectId.eq(subjectId))) |
| | | .fetchCount()); |
| | | |
| | | // 课件数量 |
| | | // 课件数量 |
| | | map.put("subjectLectureCount", |
| | | this.getQueryFactory().select(qSubjectLecture).from(qSubjectLecture) |
| | | .where(qSubjectLecture.deleteFlag.isFalse() |
| | | .and(qSubjectLecture.subjectId.eq(subjectId)).and(qSubjectLecture.status.eq(SubjectLecture.STATUS_DRAFT))) |
| | | .fetchCount()); |
| | | |
| | | //学习人次 |
| | | //学习人次 |
| | | map.put("studyCount", |
| | | this.getQueryFactory().selectDistinct(qProgress.learnerId).from(qProgress, qSubjectLecture) |
| | | .where(qProgress.deleteFlag.isFalse().and(qSubjectLecture.deleteFlag.isFalse()).and(qSubjectLecture.subjectId.eq(subjectId)).and(qProgress.type.eq(Progress.PROGRESS_TYPE_LECTURE)) |
| | |
| | | |
| | | map.put("content", this.readSubjectContent(subjectId)); |
| | | |
| | | // 已观看完成课件数量 |
| | | // 已观看完成课件数量 |
| | | map.put("subjectLectureDoCount", |
| | | this.getQueryFactory().select(qSubjectLecture).from(qSubjectLecture, qProgress) |
| | | .where(qSubjectLecture.deleteFlag.isFalse().and(qProgress.deleteFlag.isFalse()) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 公开课详情 |
| | | * 公开课详情 |
| | | * |
| | | * @param subjectId |
| | | * @return |
| | |
| | | |
| | | Map<String, Object> map = new HashMap<String, Object>(7); |
| | | |
| | | // 直播数量 |
| | | // 直播数量 |
| | | map.put("mediaVideoLiveCount", openSubjectDetail.get("mediaVideoLiveCount")); |
| | | |
| | | // 课件数量 |
| | | // 课件数量 |
| | | map.put("subjectLectureCount", openSubjectDetail.get("subjectLectureCount")); |
| | | |
| | | //学习人次 |
| | | //学习人次 |
| | | map.put("studyCount", openSubjectDetail.get("studyCount")); |
| | | |
| | | subjectInfo.put("content", openSubjectDetail.get("content")); |
| | | |
| | | // 已观看完成课件数量 |
| | | // 已观看完成课件数量 |
| | | map.put("subjectLectureDoCount", openSubjectDetail.get("subjectLectureDoCount")); |
| | | |
| | | map.put("subjectInfo", subjectInfo); |
| | |
| | | QMySubjectV qMySubjectV = QMySubjectV.mySubjectV; |
| | | QMyLectureV qMyLectureV = QMyLectureV.myLectureV; |
| | | |
| | | // 课程 |
| | | // 课程 |
| | | Tuple tuple = this.getQueryFactory() |
| | | .select(qMySubjectV.id.subjectId, qMySubjectV.subjectName, qMySubjectV.term, qMySubjectV.schoolYear, qMySubjectV.origSubjectId, |
| | | qMySubjectV.percent, qMySubjectV.coverPageUrl, qMySubjectV.progressValue) |
| | |
| | | |
| | | String origSubjectId = objSubject.getOrigSubjectId(); |
| | | |
| | | // 考试统计 |
| | | // 考试统计 |
| | | long examsCount = this.examService.listStudentExamCount("", new String[]{classId}, origSubjectId, null); |
| | | |
| | | // 作业统计 |
| | | // 作业统计 |
| | | long homeworksCount = exerciseInfoService.queryStuExerciseListCount("", null, ClientUtils.getUserId(), origSubjectId, null); |
| | | |
| | | // 课件统计 |
| | | // 课件统计 |
| | | Tuple tupleLecture = this.getQueryFactory().select(qMyLectureV.count(), |
| | | new CaseBuilder().when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).// 大于95%算完成 |
| | | new CaseBuilder().when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).// 大于95%算完成 |
| | | from(qMyLectureV) |
| | | .where(qMyLectureV.classId.eq(classId).and(qMyLectureV.id.userId.eq(ClientUtils.getUserId())) |
| | | .and(qMyLectureV.subjectId.eq(subjectId))) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 公开课列表 |
| | | * 公开课列表 |
| | | * |
| | | * @param pageNum |
| | | * @param pageSize |
| | |
| | | } |
| | | |
| | | /** |
| | | * 班级学员课件总体进度 |
| | | * 班级学员课件总体进度 |
| | | * |
| | | * @param subjectId |
| | | * @param classId |
| | |
| | | } |
| | | |
| | | /** |
| | | * 学员课程作业进度 |
| | | * 学员课程作业进度 |
| | | * |
| | | * @param classId |
| | | * @param subjectId |
| | |
| | | } |
| | | |
| | | /** |
| | | * 学员考试作业进度 |
| | | * 学员考试作业进度 |
| | | * |
| | | * @param classId |
| | | * @param subjectId |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的课件情况 |
| | | * 我的课件情况 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | return this.getQueryFactory().select(qMyLectureV.subjectId, |
| | | qMyLectureV.count(), |
| | | new CaseBuilder() |
| | | .when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).//大于95%算完成 |
| | | .when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).//大于95%算完成 |
| | | from(qMyLectureV). |
| | | where(qMyLectureV.classId.eq(classId).and(qMyLectureV.id.userId.eq(ClientUtils.getUserId()))). |
| | | groupBy(qMyLectureV.subjectId).fetch().stream() |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的课程,按时间排序 |
| | | * 我的课程,按时间排序 |
| | | * |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> mySubjectList(String classId, Pager pager) { |
| | | //课程 |
| | | //课程 |
| | | List<Map<String, Object>> clsSubjectlist = this.myClsSubjectlist(classId, ClientUtils.getUserId(), pager); |
| | | //课件统计 |
| | | //课件统计 |
| | | List<Map<String, Object>> lectures = this.myLectureList(classId); |
| | | for (Map<String, Object> clsSubject : clsSubjectlist) { |
| | | String origSubjectId = (String) clsSubject.get("origSubjectId"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 统计课程的数据 |
| | | * 统计课程的数据 |
| | | * |
| | | * @param type 类型 |
| | | * @param clsSubject 课程 |
| | | * @param lstStatistics 统计信息 |
| | | * @param type 类型 |
| | | * @param clsSubject 课程 |
| | | * @param lstStatistics 统计信息 |
| | | */ |
| | | private void setSubjectStatistics(String type, Map<String, Object> clsSubject, List<Map<String, Object>> lstStatistics) { |
| | | if (lstStatistics != null && !lstStatistics.isEmpty()) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的课程详情 |
| | | * 我的课程详情 |
| | | * |
| | | * @param classId |
| | | * @return |
| | |
| | | QMySubjectV qMySubjectV = QMySubjectV.mySubjectV; |
| | | QMyLectureV qMyLectureV = QMyLectureV.myLectureV; |
| | | Object userId = request.getSession().getAttribute("userId"); |
| | | // 课程 |
| | | // 课程 |
| | | Tuple tuple = this.getQueryFactory() |
| | | .select(qMySubjectV.id.subjectId, qMySubjectV.subjectName, qMySubjectV.term, qMySubjectV.schoolYear, qMySubjectV.origSubjectId, |
| | | qMySubjectV.percent, qMySubjectV.coverPageUrl, qMySubjectV.progressValue) |
| | |
| | | |
| | | String origSubjectId = objSubject.getOrigSubjectId(); |
| | | |
| | | // 考试统计 |
| | | // 考试统计 |
| | | long examsCount = this.examService.listStudentExamCount("", new String[]{classId}, origSubjectId, null); |
| | | |
| | | // 作业统计 |
| | | // 作业统计 |
| | | long homeworksCount = exerciseInfoService.queryStuExerciseListCount("", null, ClientUtils.getUserId(), origSubjectId, null); |
| | | |
| | | // 课件统计 |
| | | // 课件统计 |
| | | Tuple tupleLecture = this.getQueryFactory().select(qMyLectureV.count(), |
| | | new CaseBuilder().when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).// 大于95%算完成 |
| | | new CaseBuilder().when(qMyLectureV.percent.gt(0.95)).then(1).otherwise(0).sum()).// 大于95%算完成 |
| | | from(qMyLectureV) |
| | | .where(qMyLectureV.classId.eq(classId).and(qMyLectureV.id.userId.eq(ClientUtils.getUserId())) |
| | | .and(qMyLectureV.subjectId.eq(subjectId))) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 我的课程按学期分类 |
| | | * 我的课程按学期分类 |
| | | * |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> myTermSubjectList(String classId) { |
| | | //课程 |
| | | //课程 |
| | | List<Map<String, Object>> clsSubjectlist = this.mySubjectList(classId, new Pager()); |
| | | System.out.println("clsSubjectlistaaaaaa" + clsSubjectlist); |
| | | return this.termSubjectList(classId, clsSubjectlist); |
| | |
| | | |
| | | |
| | | /** |
| | | * 课程按学期分类 |
| | | * 课程按学期分类 |
| | | * |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> termSubjectList(String classId, List<Map<String, Object>> clsSubjectlist) { |
| | | //学期 |
| | | //学期 |
| | | List<Map<String, Object>> termList = this.termList(classId); |
| | | |
| | | if (termList != null && !termList.isEmpty()) { |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询课程关联的班级课程信息 |
| | | * 查询课程关联的班级课程信息 |
| | | * |
| | | * @param classId |
| | | * @return |