Przeglądaj źródła

1、课程调整时排除自动补签记录
2、删除请假时班级学生状态更新代码
3、小课过期课程调整生成后加入学生缴费信息
4、vip课点名添加开课前时间限制
5、学生端可购买小课获取条件调整
6、学员请假课程调整限制
7、点名列表兼容sys_user无数据
8、兼容无教学点

Joburgess 5 lat temu
rodzic
commit
4e2f5430ca

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -178,7 +178,8 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      * @author Joburgess
      * @date 2019/11/21
      */
-    List<Map<Integer, Integer>> countClassGroupsStudentNum(@Param("classGroupIds") List<Integer> classGroupIds);
+    List<Map<Integer, Integer>> countClassGroupsStudentNum(@Param("classGroupIds") List<Integer> classGroupIds,
+                                                           @Param("status")ClassGroupStudentStatusEnum status);
 
     /**
      * @param classGroupId: 班级编号

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

@@ -32,6 +32,8 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      */
     public static final String ADVANCE_LEAVE_HOURS = "advance_leave_hours";
 
+   String ENABLE_TEACHER_COURSE_ADJUST_DEFAULT_HOURS = "enable_teacher_course_adjust_default_hours";
+
     /**
      * 单技课梯度结算规则设置
      */

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -885,7 +885,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 //        Map<Integer, ClassGroup> classGorupIdMap = byClassGroupIds.stream().collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
 
         //统计班级人数
-        List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds);
+        List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds,null);
         Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
         Map<Integer, Long> currentClassTimes = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupIds,user.getId()));
         teacherMusicClassGroup.forEach(teacherClassGroupDto -> {

+ 8 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -413,6 +413,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             return teacherCourseSchedulesWithDate;
         }
 
+        List<Integer> classGroupIds = teacherCourseSchedulesWithDate.stream().map(CourseScheduleDto::getClassGroupId).collect(Collectors.toList());
+        List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
+        Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
+
         SysConfig advanceLeaveHoursConfig = sysConfigService.findByParamName(SysConfigService.ADVANCE_LEAVE_HOURS);
         Integer advanceLeaveHours=advanceLeaveHoursConfig.getParanValue(Integer.class);
         List<Map<Long, Integer>> courseLeaveStudentNumMaps = studentAttendanceDao.countCourseLeaveStudentNumWithFourHoursAgo(allCourseScheduleIds, advanceLeaveHours);
@@ -438,8 +442,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 courseScheduleDto.setStudentNames(org.apache.commons.lang3.StringUtils.join(studentNames, ","));
             }
             courseScheduleDto.setSubjectName(subjectNameCourseMap.get(courseScheduleDto.getId()));
-            Long leaveStudentNum = courseLeaveStudentNumMap.get(courseScheduleDto.getId());
-            if(Objects.nonNull(leaveStudentNum)&&leaveStudentNum.intValue()==courseScheduleDto.getExpectStudentNum()){
+            Long leaveStudentNum = courseLeaveStudentNumMap.get(courseScheduleDto.getClassGroupId());
+            Long normalStudentNum = classGroupStudentNumMap.get(courseScheduleDto.getClassGroupId());
+            if(Objects.nonNull(leaveStudentNum)&&Objects.nonNull(normalStudentNum)&&leaveStudentNum.intValue()==normalStudentNum.intValue()){
                 courseScheduleDto.setEnableAdjustInToday(1);
             }
         }
@@ -1413,7 +1418,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         List<ClassGroup> classGroups = classGroupDao.findByClassGroupIds(classGroupIds);
         Map<Integer, ClassGroup> idClassGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
 
-        SysConfig advanceLeaveHoursConfig = sysConfigService.findByParamName(SysConfigService.ADVANCE_LEAVE_HOURS);
+        SysConfig advanceLeaveHoursConfig = sysConfigService.findByParamName(SysConfigService.ENABLE_TEACHER_COURSE_ADJUST_DEFAULT_HOURS);
         Integer advanceLeaveHours=advanceLeaveHoursConfig.getParanValue(Integer.class);
         List<Map<Long, Integer>> courseLeaveStudentNumMaps = studentAttendanceDao.countCourseLeaveStudentNumWithFourHoursAgo(newCourseScheduleIds, advanceLeaveHours);
         Map<Long,Long> courseLeaveStudentNumMap = MapUtil.convertIntegerMap((courseLeaveStudentNumMaps));

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -241,6 +241,9 @@
                 #{classGroupId}
             </foreach>
             AND status_!='QUIT'
+            <if test="status!=null">
+                AND status_=#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         GROUP BY
             class_group_id_
     </select>