From 784d643c8d073dc31652b03b7f1bd82a9d1c627f Mon Sep 17 00:00:00 2001
From: EricsHu <hrr145632>
Date: 星期四, 23 十一月 2023 20:21:26 +0800
Subject: [PATCH] 优化班级课程

---
 src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java |  304 +++++++++++++++++++++++++++++++------------------
 1 files changed, 191 insertions(+), 113 deletions(-)

diff --git a/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java b/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java
index ade7300..b387087 100644
--- a/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java
+++ b/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java
@@ -126,10 +126,10 @@
 
         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);
@@ -156,7 +156,7 @@
 
         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(),
@@ -171,7 +171,7 @@
         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",
@@ -188,9 +188,9 @@
     }
 
     /**
-     * 删除单个课程
+     * 鍒犻櫎鍗曚釜璇剧▼
      *
-     * @param chapterId 章节id
+     * @param chapterId 绔犺妭id
      * @return
      */
     private Result deleteSubject(String subjectId) {
@@ -207,8 +207,8 @@
 
     @Override
     public List<Subject> list(String text, String teacherId, String status, Integer type, Integer pageSize, Integer pageNum) {
-
-        StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false and origSubjectId is null ");
+        //and origSubjectId is null
+        StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false  ");
 
         List<Object> args = CollectionUtils.newList(text + "%", ClientUtils.getOrgId());
 
@@ -222,8 +222,12 @@
             args.add(status);
         }
 
+//        if (!StringUtils.isEmpty(teacherId)) {
+//            hql.append(" and createId=?");
+//            args.add(teacherId);
+//        }
         if (!StringUtils.isEmpty(teacherId)) {
-            hql.append(" and createId=?");
+            hql.append(" and teacherId=?");
             args.add(teacherId);
         }
         hql.append(" order by createTime desc");
@@ -234,7 +238,7 @@
 
 
     /**
-     * app教师端课程列表
+     * app鏁欏笀绔绋嬪垪琛�
      *
      * @param text
      * @param status
@@ -247,7 +251,7 @@
     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;
@@ -327,7 +331,7 @@
 
         Subject sub = read(subjectId);
 
-        //读取原课程
+        //璇诲彇鍘熻绋�
         if (StringUtils.isNotBlank(sub.getOrigSubjectId())) {
             sub = read(sub.getOrigSubjectId());
         }
@@ -362,9 +366,9 @@
     }
 
     /**
-     * 发布单个课程
+     * 鍙戝竷鍗曚釜璇剧▼
      *
-     * @param chapterId 章节id
+     * @param chapterId 绔犺妭id
      * @return
      */
     private Result releaseSubject(String subjectId) {
@@ -376,16 +380,16 @@
 
         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) {
@@ -397,7 +401,7 @@
 
         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");
@@ -417,6 +421,19 @@
 
         return result;
     }
+
+    @Override
+    public List<OpenSubjectV> listOpenSubjectV() {
+        StringBuffer hql = new StringBuffer("from OpenSubjectV p where 1 = ?");
+        int param = 1;
+        List<Object> args = CollectionUtils.newList(param);
+
+
+        List<OpenSubjectV> result = find(hql.toString(), args, OpenSubjectV.class);
+
+        return result;
+    }
+
 
     @Override
     public List<Map<String, Object>> listChapterStudyProgress(String subjectId) {
@@ -462,18 +479,18 @@
 
     @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);
+        //鏂板鑰佸笀璇剧▼
+//        Subject newSubject = new Subject();
+        Subject newSubject = this.read(origSubjectId);
         UserTeacher teacher = this.read(UserTeacher.class, teacherId);
-        BeanUtils.copyProperties(newSubject, origSubject);
+//        BeanUtils.copyProperties(newSubject, origSubject);
 
         TraceUtils.setCreateTrace(newSubject);
-        newSubject.setSubjectId(null);
+//        newSubject.setSubjectId(null);
         newSubject.setTeacherId(teacherId);
         newSubject.setSchoolYear(schoolYear);
         newSubject.setTerm(term);
-        newSubject.setStatus(origSubject.getStatus());
+//        newSubject.setStatus(origSubject.getStatus());
         newSubject.setOrigSubjectId(origSubjectId);
         newSubject.setOrigCopySubjectId(origSubjectId);
         newSubject.setType(Subject.TYPE_CLS_SUBJECT);
@@ -481,10 +498,10 @@
         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()));
@@ -504,7 +521,7 @@
         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());
@@ -513,7 +530,7 @@
             subject.setOrigSubjectId(origSubjectId);
             subject.setOrigCopySubjectId(origSubjectId);
 
-            //清理并复制原课程
+            //娓呯悊骞跺鍒跺師璇剧▼
             clsLectureService.doClearLecturesToClass(classId, subjectId);
             clsLectureService.doCopyLecturesToClass(origSubjectId, subjectId, classId);
         } else {
@@ -539,7 +556,7 @@
         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());
         }
@@ -594,7 +611,6 @@
             }
             subject.put("percent", new BigDecimal(percentAvg));
             subject.put("progressValue", new BigDecimal(progressValue));
-
             subject.put("lectureParentId", map.get("lectureParentId"));
             subject.put("lectureId", map.get("lectureId"));
             subject.put("unCommitExerciseCount", exerciseInfoService.getUnCommitExerciseCount(classId, userId));
@@ -607,6 +623,48 @@
             subject.put("toBeCommitExamCount", examService.getToBeCommitExamCount(classId, userId));
 
         }
+        List<OpenSubjectV> subjects = listOpenSubjectV();
+        for(OpenSubjectV subject : subjects){
+            Map<String, Object> subjectMap = new HashMap<>();
+            String classId = ClientUtils.getClassId();
+            String subjectId =  subject.getSubjectId();
+            Map<String, Object> map = progressDao.getStudyById(userId, subjectId, null);
+            List<MyOpenLectureV> myLectureVList = lectureService.listOpenLectureVBySubjectId(userId, subjectId, "", 1000, 1, null);
+            Double percent = 0.0;
+            Double progressValue = 0.0;
+            Double percentAvg = 0.0;
+            if (!myLectureVList.isEmpty()) {
+                for (MyOpenLectureV myOpenLectureV : myLectureVList) {
+                    if (myOpenLectureV.getPercent() != null && myOpenLectureV.getProgressValue() != null) {
+                        percent += myOpenLectureV.getPercent();
+                        progressValue += myOpenLectureV.getProgressValue().intValue();
+                    }
+                }
+                percentAvg = percent / myLectureVList.size();
+                if (percentAvg.isNaN()) {
+                    percentAvg = 0.0;
+                }
+            }
+            String className = "鍏紑璇�";
+            subjectMap.put("subjectName",subject.getSubjectName());
+            subjectMap.put("subjectId",subject.getSubjectId());
+            subjectMap.put("coverPageUrl",subject.getCoverPageUrl());
+            subjectMap.put("percent", new BigDecimal(percentAvg));
+            subjectMap.put("progressValue", new BigDecimal(progressValue));
+            subjectMap.put("className",className);
+            subjectMap.put("lectureParentId", map.get("lectureParentId"));
+            subjectMap.put("lectureId", map.get("lectureId"));
+            subjectMap.put("unCommitExerciseCount", exerciseInfoService.getUnCommitExerciseCount(classId, userId));
+            subjectMap.put("toBeCommitExerciseCount", exerciseInfoService.getToBeCommitExerciseCount(classId, userId));
+            subjectMap.put("CommitExerciseCount", exerciseInfoService.getCommitExerciseCount(classId, userId));
+            subjectMap.put("exerciseCount", exerciseInfoService.getExerciseCount(classId, userId));
+            subjectMap.put("examCount", examService.getExamCount(classId, userId));
+            subjectMap.put("unCommitExamCount", examService.getUnCommitExamCount(classId, userId));
+            subjectMap.put("commitExamCount", examService.getCommitExamCount(classId, userId));
+            subjectMap.put("toBeCommitExamCount", examService.getToBeCommitExamCount(classId, userId));
+
+            subjectLstMap.add(subjectMap);
+        }
         return new Result(true, "success", subjectLstMap);
     }
 
@@ -614,7 +672,7 @@
     @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;
 
@@ -631,7 +689,7 @@
     }
 
     /**
-     * 获取班级对应的学员 按进度进行排序
+     * 鑾峰彇鐝骇瀵瑰簲鐨勫鍛� 鎸夎繘搴﹁繘琛屾帓搴�
      */
     private List<Map<String, Object>> percentDesc(String classId, String subjectId, @SuppressWarnings("rawtypes") OrderSpecifier order) {
         QSubjectProgressTreeV qSubjectProgressTreeV = QSubjectProgressTreeV.subjectProgressTreeV;
@@ -645,27 +703,47 @@
                 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);
+            int type = 3;
+            List<Subject> subjects = find("from Subject where type = ?",CollectionUtils.newList(type),Subject.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;
+                    }
+                }
+            }
+            for(Subject subject : subjects){
+                List<MyOpenLectureV> myOpenLectureVList = lectureService.listOpenLectureVBySubjectId(tuple.get(qUser.userId), subject.getSubjectId(), "", 1000, 1, null);
+                if(!myOpenLectureVList.isEmpty()){
+                    for(MyOpenLectureV myOpenLecture : myOpenLectureVList){
+                        if (myOpenLecture.getPercent() != null && myOpenLecture.getProgressValue() != null) {
+                            percent += myOpenLecture.getPercent();
+                            progressValue += myOpenLecture.getProgressValue().intValue();
+                        }
+                    }
+                    size += myOpenLectureVList.size();
+                    if (percentAvg.isNaN()) {
+                        percentAvg += 0.0;
+                    }
+                }
+            }
             percentAvg += percent / size;
+            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));
@@ -680,20 +758,20 @@
     }
 
     /**
-     * 通过作业完成个数排序
+     * 閫氳繃浣滀笟瀹屾垚涓暟鎺掑簭
      */
     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)))
@@ -723,13 +801,13 @@
     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();
 
@@ -813,10 +891,10 @@
                 .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);
         }
 
@@ -862,7 +940,7 @@
     }
 
     /**
-     * 我的班级信息
+     * 鎴戠殑鐝骇淇℃伅
      *
      * @param classId
      * @return
@@ -873,7 +951,7 @@
 
         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());
@@ -888,7 +966,7 @@
 
             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",
@@ -900,7 +978,7 @@
     }
 
     /**
-     * 获取我的课程进度
+     * 鑾峰彇鎴戠殑璇剧▼杩涘害
      *
      * @param classId
      * @return
@@ -937,7 +1015,7 @@
     }
 
     /**
-     * 获取我的课程数量
+     * 鑾峰彇鎴戠殑璇剧▼鏁伴噺
      *
      * @param classId
      * @return
@@ -954,7 +1032,7 @@
     }
 
     /**
-     * 获取学员的课程进度
+     * 鑾峰彇瀛﹀憳鐨勮绋嬭繘搴�
      *
      * @param classId
      * @return
@@ -993,7 +1071,7 @@
     }
 
     /**
-     * 获取课件数量
+     * 鑾峰彇璇句欢鏁伴噺
      *
      * @param subjectId
      * @return
@@ -1004,7 +1082,7 @@
         if (subject == null) {
             return 0l;
         }
-        if (subject.getType() == Subject.TYPE_CLS_SUBJECT) {//班级课程
+        if (subject.getType() == Subject.TYPE_CLS_SUBJECT) {//鐝骇璇剧▼
 
             QClsSubjectLecture qSubjectLecture = QClsSubjectLecture.clsSubjectLecture;
 
@@ -1021,7 +1099,7 @@
 
 
     /**
-     * 我的公开课列表
+     * 鎴戠殑鍏紑璇惧垪琛�
      *
      * @param pageNum
      * @param pageSize
@@ -1058,18 +1136,18 @@
 
             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;
@@ -1079,7 +1157,7 @@
     }
 
     /**
-     * 课程统计详情
+     * 璇剧▼缁熻璇︽儏
      *
      * @param subjectId
      * @return
@@ -1090,7 +1168,7 @@
         QSubjectLecture qSubjectLecture = QSubjectLecture.subjectLecture;
         QProgress qProgress = QProgress.progress;
 
-        // 直播数量
+        // 鐩存挱鏁伴噺
         map.put("mediaVideoLiveCount",
                 this.getQueryFactory().select(qMediaVideoLive).from(qMediaVideoLive)
                         .where(qMediaVideoLive.deleteFlag.isFalse()
@@ -1098,14 +1176,14 @@
                                 .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))
@@ -1114,7 +1192,7 @@
 
         map.put("content", this.readSubjectContent(subjectId));
 
-        // 已观看完成课件数量
+        // 宸茶鐪嬪畬鎴愯浠舵暟閲�
         map.put("subjectLectureDoCount",
                 this.getQueryFactory().select(qSubjectLecture).from(qSubjectLecture, qProgress)
                         .where(qSubjectLecture.deleteFlag.isFalse().and(qProgress.deleteFlag.isFalse())
@@ -1127,7 +1205,7 @@
     }
 
     /**
-     * 公开课详情
+     * 鍏紑璇捐鎯�
      *
      * @param subjectId
      * @return
@@ -1158,18 +1236,18 @@
 
         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);
@@ -1189,7 +1267,7 @@
         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)
@@ -1219,15 +1297,15 @@
 
         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)))
@@ -1242,7 +1320,7 @@
     }
 
     /**
-     * 公开课列表
+     * 鍏紑璇惧垪琛�
      *
      * @param pageNum
      * @param pageSize
@@ -1277,7 +1355,7 @@
     }
 
     /**
-     * 班级学员课件总体进度
+     * 鐝骇瀛﹀憳璇句欢鎬讳綋杩涘害
      *
      * @param subjectId
      * @param classId
@@ -1307,7 +1385,7 @@
     }
 
     /**
-     * 学员课程作业进度
+     * 瀛﹀憳璇剧▼浣滀笟杩涘害
      *
      * @param classId
      * @param subjectId
@@ -1353,7 +1431,7 @@
     }
 
     /**
-     * 学员考试作业进度
+     * 瀛﹀憳鑰冭瘯浣滀笟杩涘害
      *
      * @param classId
      * @param subjectId
@@ -1389,7 +1467,7 @@
     }
 
     /**
-     * 我的课件情况
+     * 鎴戠殑璇句欢鎯呭喌
      *
      * @param classId
      * @return
@@ -1400,7 +1478,7 @@
         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()
@@ -1414,15 +1492,15 @@
     }
 
     /**
-     * 我的课程,按时间排序
+     * 鎴戠殑璇剧▼锛屾寜鏃堕棿鎺掑簭
      *
      * @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");
@@ -1438,11 +1516,11 @@
     }
 
     /**
-     * 统计课程的数据
+     * 缁熻璇剧▼鐨勬暟鎹�
      *
-     * @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()) {
@@ -1456,7 +1534,7 @@
     }
 
     /**
-     * 我的课程详情
+     * 鎴戠殑璇剧▼璇︽儏
      *
      * @param classId
      * @return
@@ -1466,7 +1544,7 @@
         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)
@@ -1496,15 +1574,15 @@
 
         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)))
@@ -1519,14 +1597,14 @@
     }
 
     /**
-     * 我的课程按学期分类
+     * 鎴戠殑璇剧▼鎸夊鏈熷垎绫�
      *
      * @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);
@@ -1534,14 +1612,14 @@
 
 
     /**
-     * 课程按学期分类
+     * 璇剧▼鎸夊鏈熷垎绫�
      *
      * @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()) {
@@ -1563,7 +1641,7 @@
 
 
     /**
-     * 查询课程关联的班级课程信息
+     * 鏌ヨ璇剧▼鍏宠仈鐨勭彮绾ц绋嬩俊鎭�
      *
      * @param classId
      * @return

--
Gitblit v1.8.0