瀏覽代碼

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 年之前
父節點
當前提交
c8aaf8e976

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -734,6 +734,15 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      */
     List<Map<Integer, Integer>> countClassGroupCourseTimes(@Param("classGroupIds") List<Integer> classGroupIds);
 
+    /**
+     * @describe 统计班级上的课程数量
+     * @author Joburgess
+     * @date 2020/2/13
+     * @param classGroupId:
+     * @return int
+     */
+    int countClassGroupCourses(@Param("classGroupId") Integer classGroupId);
+
 
     /**
      * 根据班级编号列表删除课程

+ 233 - 82
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -503,6 +503,169 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         return teacherCourseSchedulesWithDate;
     }
 
+//    @Override
+//    public void checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule) {
+//        if (CollectionUtils.isEmpty(courseSchedules)) {
+//            return;
+//        }
+//        List<String> classDates = courseSchedules.stream().map(courseSchedule -> DateUtil.dateToString(courseSchedule.getClassDate(), "yyyy-MM-dd"))
+//                .collect(Collectors.toList());
+//
+//        List<CourseSchedule> existCourseSchedules = courseScheduleDao.findByClassDate(classDates);
+//
+//        //只需要调整课程信息的课程编号列表
+//        List<Long> updateCourseScheduleIds = courseSchedules
+//                .stream()
+//                .filter(courseSchedule -> Objects.nonNull(courseSchedule.getId()))
+//                .map(CourseSchedule::getId)
+//                .collect(Collectors.toList());
+//
+//        //排除只需调整的课程
+//        existCourseSchedules = existCourseSchedules.stream()
+//                .filter(courseSchedule -> !updateCourseScheduleIds.contains(courseSchedule.getId()))
+//                .collect(Collectors.toList());
+//        //新课程对应的班级编号列表
+//        List<Integer> newCourseScheduleClassGroupIds = courseSchedules
+//                .stream()
+//                .map(CourseSchedule::getClassGroupId)
+//                .distinct()
+//                .collect(Collectors.toList());
+//
+//        List<Long> existCourseScheduleIds = existCourseSchedules.stream()
+//                .map(CourseSchedule::getId)
+//                .collect(Collectors.toList());
+//
+//        HashSet<Long> courseScheduleIdsSet = new HashSet<>(existCourseScheduleIds);
+//
+//        //合并新课程和已存在的课程
+//        List<CourseSchedule> allCourseSchedules;
+//        if (!CollectionUtils.isEmpty(existCourseSchedules)) {
+//            allCourseSchedules = ListUtils.sum(courseSchedules, existCourseSchedules);
+//        } else {
+//            allCourseSchedules = courseSchedules;
+//        }
+//        //所有课程的班级编号
+//        List<Integer> classGroupIds = allCourseSchedules
+//                .stream()
+//                .map(CourseSchedule::getClassGroupId)
+//                .distinct()
+//                .collect(Collectors.toList());
+//        //班级与学生的关联记录
+//        List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIds);
+//        Map<Integer, List<ClassGroupStudentMapper>> classGroupStudentsMap = classGroupStudentMappers
+//                .stream()
+//                .collect(Collectors.groupingBy(ClassGroupStudentMapper::getClassGroupId));
+//
+//        //根据课程获取助教id关联集合
+//        List<IntegerAndIntegerListDto> courseScheduleTeachingTeacherIdList = new ArrayList<>();
+//        if (!CollectionUtils.isEmpty(existCourseScheduleIds)) {
+//            courseScheduleTeachingTeacherIdList = courseScheduleDao.findCourseScheduleIdAndUserIdsMap(existCourseScheduleIds, TeachTypeEnum.TEACHING.getCode());
+//        }
+//        Map<Integer, IntegerAndIntegerListDto> courseScheduleTeachingTeacherMap = courseScheduleTeachingTeacherIdList.stream()
+//                .collect(Collectors.toMap(IntegerAndIntegerListDto::getId, integerAndIntegerListDto -> integerAndIntegerListDto));
+//
+//        //班级助教关联ID集合
+//        List<IntegerAndIntegerListDto> classGroupAndUserIdsMap = courseScheduleDao.findClassGroupAndUserIdsMap(newCourseScheduleClassGroupIds, TeachTypeEnum.TEACHING.getCode());
+//        Map<Integer, IntegerAndIntegerListDto> classGroupTeachingTeacherMap = classGroupAndUserIdsMap.stream()
+//                .collect(Collectors.toMap(IntegerAndIntegerListDto::getId, integerAndIntegerListDto -> integerAndIntegerListDto));
+//
+//        //将课程计划按照开课时间排序
+//        allCourseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
+//        if (allCourseSchedules.size() > 1) {
+//            //记录连续冲突的次数
+//            int repeatTimes = 1;
+//            for (int i = 1; i < allCourseSchedules.size(); i++) {
+//                int temp_repeat = repeatTimes;
+//                for (int j = 1; j <= temp_repeat; j++) {
+//                    //当前课程
+//                    CourseSchedule preCourseSchedule = allCourseSchedules.get(i - j);
+//                    //后面一节课程
+//                    CourseSchedule backCourseSchedule = allCourseSchedules.get(i);
+//                    //判断前后两节课是否存在冲突
+//                    if (backCourseSchedule.getStartClassTime().before(preCourseSchedule.getEndClassTime())) {
+//                        if (j == repeatTimes) {
+//                            repeatTimes += 1;
+//                        }
+//                        if (!checkExistCourseSchedule
+//                                && courseScheduleIdsSet.contains(preCourseSchedule.getId())
+//                                && courseScheduleIdsSet.contains(backCourseSchedule.getId())) {
+//                            continue;
+//                        }
+//
+//                        //如果存在时间重叠,则需要判断前后两节课的教师和学生是否存在冲突
+//                        //主教冲突检测
+//                        if (Objects.nonNull(preCourseSchedule.getActualTeacherId())
+//                                && preCourseSchedule.getActualTeacherId().equals(backCourseSchedule.getActualTeacherId())) {
+//
+//                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
+//                        }
+//                        //助教冲突检测
+//                        if (Objects.isNull(preCourseSchedule.getId())) {
+//                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
+//                            if (Objects.nonNull(integerAndIntegerListDto)) {
+//                                preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+//                            }
+//                        } else if (existCourseScheduleIds.contains(preCourseSchedule.getId())) {
+//                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
+//                            if (Objects.nonNull(integerAndIntegerListDto)) {
+//                                preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+//                            }
+//                        }
+//                        if (Objects.isNull(backCourseSchedule.getId())) {
+//                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId());
+//                            if (Objects.nonNull(integerAndIntegerListDto)) {
+//                                backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+//                            }
+//                        } else if (existCourseScheduleIds.contains(backCourseSchedule.getId())) {
+//                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
+//                            if (Objects.nonNull(integerAndIntegerListDto)) {
+//                                backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+//                            }
+//                        }
+//                        if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
+//                                && !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
+//                            List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()
+//                                    .stream().filter(backCourseSchedule.getTeachingTeacherIdList()::contains)
+//                                    .collect(Collectors.toList());
+//                            if (!CollectionUtils.isEmpty(repeatIds)) {
+//                                throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 2));
+//                            }
+//                        }
+//                        //学生冲突检测
+//                        if (preCourseSchedule.getClassGroupId().equals(backCourseSchedule.getClassGroupId())) {
+//                            //如果班级相同,则学生肯定存在冲突
+//                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
+//                        }
+//                        //如果班级不同,则需要检测两个班级是否存在重复的学生
+//                        List<ClassGroupStudentMapper> preClassGroupStudents = classGroupStudentsMap.get(preCourseSchedule.getClassGroupId());
+//                        List<ClassGroupStudentMapper> backClassGroupStudents = classGroupStudentsMap.get(backCourseSchedule.getClassGroupId());
+//                        //如果有一个存在没有学生的班级则不存在冲突
+//                        if (CollectionUtils.isEmpty(preClassGroupStudents) || CollectionUtils.isEmpty(backClassGroupStudents)) {
+//                            continue;
+//                        }
+//                        //当前课程所在班级的学生编号列表
+//                        List<Integer> preClassGroupStudentIds = preClassGroupStudents.stream()
+//                                .map(ClassGroupStudentMapper::getUserId)
+//                                .collect(Collectors.toList());
+//                        //后面一节课程所在班级的学生编号列表
+//                        List<Integer> backClassGroupStudentIds = backClassGroupStudents.stream()
+//                                .map(ClassGroupStudentMapper::getUserId)
+//                                .collect(Collectors.toList());
+//                        List<Integer> repeatStudentIds = preClassGroupStudentIds.stream()
+//                                .filter(backClassGroupStudentIds::contains)
+//                                .collect(Collectors.toList());
+//                        if (!CollectionUtils.isEmpty(repeatStudentIds)) {
+//                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
+//                        }
+//                    } else {
+//                        repeatTimes = j;
+//                        break;
+//                    }
+//                }
+//            }
+//        }
+//    }
+
     @Override
     public void checkNewCourseSchedules(List<CourseSchedule> courseSchedules, boolean checkExistCourseSchedule) {
         if (CollectionUtils.isEmpty(courseSchedules)) {
@@ -572,94 +735,82 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         //将课程计划按照开课时间排序
         allCourseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
         if (allCourseSchedules.size() > 1) {
-            //记录连续冲突的次数
-            int repeatTimes = 1;
-            for (int i = 1; i < allCourseSchedules.size(); i++) {
-                int temp_repeat = repeatTimes;
-                for (int j = 1; j <= temp_repeat; j++) {
-                    //当前课程
-                    CourseSchedule preCourseSchedule = allCourseSchedules.get(i - j);
-                    //后面一节课程
-                    CourseSchedule backCourseSchedule = allCourseSchedules.get(i);
+            for (CourseSchedule preCourseSchedule : courseSchedules) {
+                for (CourseSchedule backCourseSchedule : allCourseSchedules) {
                     //判断前后两节课是否存在冲突
-                    if (backCourseSchedule.getStartClassTime().before(preCourseSchedule.getEndClassTime())) {
-                        if (j == repeatTimes) {
-                            repeatTimes += 1;
-                        }
-                        if (!checkExistCourseSchedule
-                                && courseScheduleIdsSet.contains(preCourseSchedule.getId())
-                                && courseScheduleIdsSet.contains(backCourseSchedule.getId())) {
-                            continue;
-                        }
+                    if (!preCourseSchedule.getStartClassTime().before(backCourseSchedule.getEndClassTime())
+                        ||!preCourseSchedule.getEndClassTime().after(backCourseSchedule.getStartClassTime())) {
+                        continue;
+                    }
+                    if (!checkExistCourseSchedule
+                            && !courseScheduleIdsSet.contains(backCourseSchedule.getId())) {
+                        continue;
+                    }
 
-                        //如果存在时间重叠,则需要判断前后两节课的教师和学生是否存在冲突
-                        //主教冲突检测
-                        if (Objects.nonNull(preCourseSchedule.getActualTeacherId())
-                                && preCourseSchedule.getActualTeacherId().equals(backCourseSchedule.getActualTeacherId())) {
+                    //如果存在时间重叠,则需要判断前后两节课的教师和学生是否存在冲突
+                    //主教冲突检测
+                    if (Objects.nonNull(preCourseSchedule.getActualTeacherId())
+                            && preCourseSchedule.getActualTeacherId().equals(backCourseSchedule.getActualTeacherId())) {
 
-                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
-                        }
-                        //助教冲突检测
-                        if (Objects.isNull(preCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
-                        } else if (existCourseScheduleIds.contains(preCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
-                        }
-                        if (Objects.isNull(backCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
-                        } else if (existCourseScheduleIds.contains(backCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
+                        throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
+                    }
+                    //助教冲突检测
+                    if (Objects.isNull(preCourseSchedule.getId())) {
+                        IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
+                        if (Objects.nonNull(integerAndIntegerListDto)) {
+                            preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                         }
-                        if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
-                                && !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
-                            List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()
-                                    .stream().filter(backCourseSchedule.getTeachingTeacherIdList()::contains)
-                                    .collect(Collectors.toList());
-                            if (!CollectionUtils.isEmpty(repeatIds)) {
-                                throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 2));
-                            }
+                    } else if (existCourseScheduleIds.contains(preCourseSchedule.getId())) {
+                        IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
+                        if (Objects.nonNull(integerAndIntegerListDto)) {
+                            preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                         }
-                        //学生冲突检测
-                        if (preCourseSchedule.getClassGroupId().equals(backCourseSchedule.getClassGroupId())) {
-                            //如果班级相同,则学生肯定存在冲突
-                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
+                    }
+                    if (Objects.isNull(backCourseSchedule.getId())) {
+                        IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId());
+                        if (Objects.nonNull(integerAndIntegerListDto)) {
+                            backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                         }
-                        //如果班级不同,则需要检测两个班级是否存在重复的学生
-                        List<ClassGroupStudentMapper> preClassGroupStudents = classGroupStudentsMap.get(preCourseSchedule.getClassGroupId());
-                        List<ClassGroupStudentMapper> backClassGroupStudents = classGroupStudentsMap.get(backCourseSchedule.getClassGroupId());
-                        //如果有一个存在没有学生的班级则不存在冲突
-                        if (CollectionUtils.isEmpty(preClassGroupStudents) || CollectionUtils.isEmpty(backClassGroupStudents)) {
-                            continue;
+                    } else if (existCourseScheduleIds.contains(backCourseSchedule.getId())) {
+                        IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
+                        if (Objects.nonNull(integerAndIntegerListDto)) {
+                            backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                         }
-                        //当前课程所在班级的学生编号列表
-                        List<Integer> preClassGroupStudentIds = preClassGroupStudents.stream()
-                                .map(ClassGroupStudentMapper::getUserId)
-                                .collect(Collectors.toList());
-                        //后面一节课程所在班级的学生编号列表
-                        List<Integer> backClassGroupStudentIds = backClassGroupStudents.stream()
-                                .map(ClassGroupStudentMapper::getUserId)
-                                .collect(Collectors.toList());
-                        List<Integer> repeatStudentIds = preClassGroupStudentIds.stream()
-                                .filter(backClassGroupStudentIds::contains)
+                    }
+                    if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
+                            && !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
+                        List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()
+                                .stream().filter(backCourseSchedule.getTeachingTeacherIdList()::contains)
                                 .collect(Collectors.toList());
-                        if (!CollectionUtils.isEmpty(repeatStudentIds)) {
-                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
+                        if (!CollectionUtils.isEmpty(repeatIds)) {
+                            throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 2));
                         }
-                    } else {
-                        repeatTimes = j;
-                        break;
+                    }
+                    //学生冲突检测
+                    if (preCourseSchedule.getClassGroupId().equals(backCourseSchedule.getClassGroupId())) {
+                        //如果班级相同,则学生肯定存在冲突
+                        throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
+                    }
+                    //如果班级不同,则需要检测两个班级是否存在重复的学生
+                    List<ClassGroupStudentMapper> preClassGroupStudents = classGroupStudentsMap.get(preCourseSchedule.getClassGroupId());
+                    List<ClassGroupStudentMapper> backClassGroupStudents = classGroupStudentsMap.get(backCourseSchedule.getClassGroupId());
+                    //如果有一个存在没有学生的班级则不存在冲突
+                    if (CollectionUtils.isEmpty(preClassGroupStudents) || CollectionUtils.isEmpty(backClassGroupStudents)) {
+                        continue;
+                    }
+                    //当前课程所在班级的学生编号列表
+                    List<Integer> preClassGroupStudentIds = preClassGroupStudents.stream()
+                            .map(ClassGroupStudentMapper::getUserId)
+                            .collect(Collectors.toList());
+                    //后面一节课程所在班级的学生编号列表
+                    List<Integer> backClassGroupStudentIds = backClassGroupStudents.stream()
+                            .map(ClassGroupStudentMapper::getUserId)
+                            .collect(Collectors.toList());
+                    List<Integer> repeatStudentIds = preClassGroupStudentIds.stream()
+                            .filter(backClassGroupStudentIds::contains)
+                            .collect(Collectors.toList());
+                    if (!CollectionUtils.isEmpty(repeatStudentIds)) {
+                        throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 3));
                     }
                 }
             }
@@ -2382,9 +2533,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         oldCourseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(),practiceCourseMinutes));
         List<CourseSchedule> courseSchedules=new ArrayList<>();
         courseSchedules.add(oldCourseSchedule);
-        courseSchedules.forEach(e->{
-            e.setId(null);
-        });
+//        courseSchedules.forEach(e->{
+//            e.setId(null);
+//        });
         checkNewCourseSchedules(courseSchedules,false);
         oldCourseSchedule.setId(courseSchedule.getId());
         courseScheduleDao.update(oldCourseSchedule);

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -71,7 +71,11 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public int update(StudentCourseHomework bean) {
+		if(Objects.isNull(bean)){
+			throw new BizException("作业不存在");
+		}
 		super.update(bean);
 		bean=studentCourseHomeworkDao.get(bean.getId());
 		CourseSchedule courseSchedule = courseScheduleDao.get(bean.getCourseScheduleId());
@@ -86,6 +90,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 
 	@Override
 	public CourseHomeworkStudentDetailDto findCourseHomeworkStudentDetail(Long courseScheduleID, Long userId) {
+		if(Objects.isNull(courseScheduleID)){
+			throw new BizException("作业不存在");
+		}
 		return studentCourseHomeworkDao.findCourseHomeworkStudentDetail(courseScheduleID, userId);
 	}
 

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1698,6 +1698,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		studentPauseInfoDao.update(studentPauseInfo);
         vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
         vipGroupDao.update(vipGroup);
+        classGroup.setTotalClassTimes(courseScheduleDao.countClassGroupCourses(classGroup.getId()));
+        classGroupDao.update(classGroup);
 		courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroup.getId().intValue(),1,vipGroup.getStatus());
 	}
 

+ 12 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -1648,10 +1648,10 @@
     </select>
     <select id="countClassGroupCourseTimes" resultType="map">
         SELECT
-            class_group_id_ AS 'key',
-            COUNT(id_) AS 'value'
+        class_group_id_ AS 'key',
+        COUNT(id_) AS 'value'
         FROM
-            course_schedule
+        course_schedule
         <where>
             <if test="classGroupIds!=null">
                 class_group_id_ IN
@@ -1664,6 +1664,14 @@
 
         GROUP BY class_group_id_
     </select>
+    <select id="countClassGroupCourses" resultType="int">
+        SELECT
+            COUNT(1)
+        FROM
+            course_schedule
+        WHERE class_group_id_ = #{classGroupId}
+          AND (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
+    </select>
     <select id="findMusicGroupCourseSchedules" resultMap="CourseSchedule">
         SELECT
             cs.*
@@ -2278,7 +2286,7 @@
             AND cgtm.`teacher_role_` = 'BISHOP'
             LEFT JOIN `course_schedule` cs ON cs.`class_group_id_` = cg.`id_`
         WHERE
-            cgtm.user_id_=#{userId}
+            cgsm.user_id_=#{userId}
             AND cgtm.teacher_role_='BISHOP'
             AND cgsm.status_ = 'NORMAL'
             AND cg.`type_` IN ( 'NORMAL', 'HIGH', 'VIP' )