فهرست منبع

增加乐器采购清单确认接口

周箭河 5 سال پیش
والد
کامیت
0989e97c3e

+ 17 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -364,42 +364,53 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 根据合奏班id获取子班及老师
+     *
      * @param mixClassGroupId
      * @return
      */
     List<ClassGroupTeachersDto> findClassGroupByMixClassGroupId(@Param("mixClassGroupId") Integer mixClassGroupId);
 
     /**
+     * @param classGroups: 班级编号列表
+     * @return java.util.List<java.lang.String>
      * @describe 根据班级编号列表获取班级名称列表
      * @author Joburgess
      * @date 2019/10/31
-     * @param classGroups: 班级编号列表
-     * @return java.util.List<java.lang.String>
      */
     List<String> findClassGroupNamesByClassGroups(@Param("classGroups") List<Integer> classGroups);
 
     /**
      * 获取当前班级相关的老师列表
+     *
      * @param groupId
      * @return
      */
     List<ImUserModel> findGroupTeacher(Integer groupId);
 
     /**
+     * @param courseScheduleId: 课程编号
+     * @return com.ym.mec.biz.dal.entity.ClassGroup
      * @describe 根据课程获取班级信息
      * @author Joburgess
      * @date 2019/11/4
-     * @param courseScheduleId: 课程编号
-     * @return com.ym.mec.biz.dal.entity.ClassGroup
      */
     ClassGroup findByCourseSchedule(Integer courseScheduleId);
 
     /**
+     * @param maxCourseScheduleId: 合奏班编号
+     * @return java.util.List<java.lang.Integer>
      * @describe 获取合奏班下所有子班级
      * @author Joburgess
      * @date 2019/11/5
-     * @param maxCourseScheduleId: 合奏班编号
-     * @return java.util.List<java.lang.Integer>
      */
     List<ClassGroup> findClassGroupsByMixClassGroup(Integer maxCourseScheduleId);
+
+    /**
+     * 根据乐团跟声部获取提高班列表
+     *
+     * @param musicGroupId
+     * @param subjectId
+     * @return
+     */
+    List<HighClassGroupDto> findClassGroupByMusicGroupIdAndSubjectId(@Param("musicGroupId") String musicGroupId, @Param("subjectId") Integer subjectId);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -112,9 +112,19 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
     /**
      * 查询班级某状态下所有的学生
+     *
      * @param classGroupId
      * @param status
      * @return
      */
     List<StudentRegistration> findClassStudentList(@Param("classGroupId") Integer classGroupId, @Param("status") ClassGroupStudentStatusEnum status);
+
+    /**
+     * 查询学生是否已报小班课
+     *
+     * @param musicGroupId
+     * @param userId
+     * @return
+     */
+    List<ClassGroupStudentMapper> findHighClassGroupHasUser(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
 }

+ 525 - 512
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -16,519 +16,532 @@ import java.util.Map;
 
 public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
 
-	/**
-	 * 根据教师ID获取当前课程信息
-	 *
-	 * @param courseID
-	 * @return
-	 */
-	TeacherAttendanceDto getCurrentCourseDetail(@Param("courseID") Long courseID);
-
-	/**
-	 * @param startTime:
-	 * @param endTime:
-	 * @param teacherId:
-	 * @return com.ym.mec.biz.dal.dto.TeacherAttendanceDto
-	 * @describe 根据时间区间获取教师上课的课程
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	TeacherAttendanceDto getTeacherCourseByDateSpeed(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("teacherId") Long teacherId);
-
-	int batchAddCourseSchedules(List<CourseSchedule> courseSchedules);
-
-	/**
-	 * @describe 修改课程的状态
-	 * @author Joburgess
-	 * @date 2019/11/4
-	 * @param courseScheduleId: 课程编号
-	 * @param status: 状态
-	 * @return int
-	 */
-	int updateCourscheduleStatus(@Param("courseScheduleId") Integer courseScheduleId,
-								 @Param("status") String status);
-
-	/**
-	 * @describe 批量删除课程计划
-	 * @author Joburgess
-	 * @date 2019/10/31
-	 * @param courseScheduleIds: 课程编号列表
-	 * @return int
-	 */
-	int batchDeleteCourseSchedules(@Param("courseScheduleIds") List<Long> courseScheduleIds);
-
-	/**
-	 * @describe 统计教师再指定时间区段内存在冲突的课程数量
-	 * @author Joburgess
-	 * @date 2019/10/28
-	 * @param teacherId: 教师编号
-	 * @param classDate: 上课日期
-	 * @param startTime: 开始时间
-	 * @param endTime: 结束时间
-	 * @return int
-	 */
-	int countExistRepeatInDateZone(@Param("teacherId") Integer teacherId, @Param("classDate") Date classDate, @Param("startTime") Date startTime,
-			@Param("endTime") Date endTime);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 统计学生所属班级数量
-	 */
-	Integer[] countStudentInClass(List<Integer> classGroupIDs);
-
-	/**
-	 * @describe 根据课程编号列表获取课程列表
-	 * @author Joburgess
-	 * @date 2019/10/22
-	 * @param courseScheduleIds: 课程编号列表
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 */
-	List<CourseSchedule> findByCourseScheduleIds(@Param("courseScheduleIds") List<Long> courseScheduleIds);
-
-	/**
-	 * @describe 根据课程编号列表获取助教列表
-	 * @author Joburgess
-	 * @date 2019/10/23
-	 * @param courseScheduleIds: 课程编号列表
-	 * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
-	 */
-	List<CourseScheduleTeacherSalary> findTeachingTeachers(@Param("courseScheduleIds") List<Long> courseScheduleIds);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据日期获取当日排课信息
-	 */
-	List<CourseScheduleDto> getCourseSchedulesWithDate(@Param("classDate") Date classDate);
-
-	/**
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 * @Author: Joburgess
-	 * @Date: 2019/10/14
-	 * @params [classDates, classGroupId]
-	 * @describe 根据班级和上课日期获取课程计划
-	 */
-	List<CourseSchedule> findByClassGroupAndDate(@Param("classDates") List<Date> classDates, @Param("classGroupId") Long classGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据日期获取学生当日排课信息
-	 */
-	List<CourseScheduleDto> getStudentCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("studentId") Long studentId);
-
-	/**
-	 * @return java.util.List<java.lang.String>
-	 * @Author: Joburgess
-	 * @Date: 2019/10/11
-	 * @params [courseScheduleId]
-	 * @describe 获取课程签到学生姓名
-	 */
-	List<String> findStudentNamesByCourseSchedule(Long courseScheduleId);
-
-	/**
-	 * @param classDate: 上课日期
-	 * @param teacherId: 教师编号
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
-	 * @describe 根据日期获取老师当日排课信息
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<CourseScheduleDto> getTeacherCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("teacherId") Long teacherId, @Param("type") String type);
-
-	/**
-	 * @param params:
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
-	 * @describe 根据日期获取排课
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<CourseScheduleDto> getCourseSchedulesWithDate(Map<String, Object> params);
-
-	int countCourseSchedulesWithDate(Map<String, Object> params);
-
-	/**
-	 * @param musicGroupID: 乐团编号
-	 * @return int
-	 * @describe 根据乐团ID删除排课
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	int deleteCourseSchedulesByMusicGroupID(@Param("musicGroupID") Long musicGroupID);
-
-	/**
-	 * @param musicGroupID: 乐团编号
-	 * @param month:        月份
-	 * @return java.util.List<java.util.Date>
-	 * @describe 根据月份获取乐团在该月有课的日期
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<Date> getCourseScheduleDateByMonth(@Param("musicGroupID") Long musicGroupID, @Param("month") Date month);
-
-	/**
-	 * @param studentId:
-	 * @param month:
-	 * @param isAttend:
-	 * @return java.util.List<java.util.Date>
-	 * @describe 获取学生有课日期
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<Date> getStudentCourseScheduleDate(@Param("studentId") Long studentId, @Param("month") Date month, @Param("isAttend") Integer isAttend);
-
-	/**
-	 * @param teacherId:
-	 * @param month:
-	 * @return java.util.List<java.util.Date>
-	 * @describe 获取教师有课日期
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<Date> getTeacherCourseScheduleDate(@Param("teacherId") Long teacherId, @Param("month") Date month, @Param("type") String type);
-
-	/**
-	 * @param month:
-	 * @param organId:
-	 * @return java.util.List<java.util.Date>
-	 * @describe 获取当月有课的日期
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<Date> getCourseScheduleDate(@Param("month") Date month, @Param("organId") Long organId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/23
-	 * 统计教师在一天内有时间重复的课数
-	 */
-	int countTeacherCourseInOnDayRepeats(CourseSchedule courseSchedule);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据日期获取对应老师的课程
-	 */
-	List<CourseSchedule> findTeacherCoursesInDates(@Param("dates") List<Date> dates, @Param("teacherId") Long teacherId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据日期获取课程
-	 */
-	List<CourseSchedule> findCoursesByDates(@Param("dates") List<Date> dates);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 获取在指定时间段内存在重复的课程
-	 */
-	List<CourseSchedule> findOverLapCoursesInDay(@Param("dates") List<Date> dates, @Param("startClassTime") Date startClassTime,
-			@Param("endClassTime") Date endClassTime);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/29
-	 * 获取班级的声部
-	 */
-	String[] findClassSubjects(List<Integer> ids);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据id批量获取课程
-	 */
-	List<CourseSchedule> findCourseSchedulesByIds(@Param("ids") Long[] ids);
-
-	/**
-	 * 获取班级未开始的课程计划
-	 *
-	 * @param classGroupTeacherMapperList
-	 * @return
-	 */
-	List<CourseSchedule> findClassGroupNoStartCourseSchedules(@Param("classGroupTeacherMapperList") List<ClassGroupTeacherMapper> classGroupTeacherMapperList);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 获取学生上课记录
-	 */
-	List<StudentCourseScheduleRecordDto> findStudentCourseScheduleRecords(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 统计学生上课记录
-	 */
-	int countStudentCourseScheduleRecords(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 获取学生未上课记录
-	 */
-	List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId, @Param("date") Date date);
-
-	/**
-	 * @return int
-	 * @Author: Joburgess
-	 * @Date: 2019/10/8
-	 * @params [classGroupId]
-	 * @describe 统计已上课次
-	 */
-	int countClassTimes(@Param("classGroupId") Long classGroupId, @Param("startClassTime") Date startClassTime);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 获取课程信息
-	 */
-	CourseScheduleDto getCourseSchedules(@Param("courseScheduleId") Long courseScheduleId);
-
-	/**
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 * @Author: Joburgess
-	 * @Date: 2019/10/14
-	 * @params [vipGroupId]
-	 * @describe 获取vip课排课计划
-	 */
-	List<CourseSchedule> findVipGroupCourseSchedules(@Param("vipGroupId") Long vipGroupId);
-
-	/**
-	 * @return java.lang.String
-	 * @Author: Joburgess
-	 * @Date: 2019/10/16
-	 * @params [courseScheduleId]
-	 * @describe 获取课程关联班级类型
-	 */
-	String findClassTypeByCourse(@Param("courseScheduleId") Long courseScheduleId);
-
-	/**
-	 * 根据课程状态查询老师指定月份的VIP课程记录数
-	 *
-	 * @param monthDate 指定月份
-	 * @param status    课程状态
-	 * @return
-	 */
-	List<Map<Integer, Integer>> queryVipGroupTeachereClassTimesByMonth(@Param("monthDate") Date monthDate, @Param("status") CourseStatusEnum status);
-
-	/**
-	 * 查询已完成未更新状态的课程列表
-	 *
-	 * @return
-	 */
-	List<CourseSchedule> queryFinishedWithNoUpdateStatus();
-
-	int batchUpdate(List<CourseSchedule> courseScheduleList);
-
-	/**
-	 * 查询提前指定分钟数还未签到的用户
-	 *
-	 * @param minutes 分钟数
-	 * @return
-	 */
-	List<CourseSchedule> queryNoSignInListByBeforeMinutes(Integer minutes);
-
-	/**
-	 * @param params: 参数
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto>
-	 * @describe 查询老师指定班级的排课信息
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<TeacherClassCourseSchudeleDto> queryTeacherClassCourseSchedule(Map<String, Object> params);
-
-	/**
-	 * @param params:
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto>
-	 * @describe 查询老师指定班级历史排课信息
-	 * @author Joburgess
-	 * @date 2019/10/19
-	 */
-	List<TeacherClassCourseSchudeleDto> queryTeacherHistoryClassCourseSchedule(Map<String, Object> params);
-
-	/**
-	 * @param params: 参数
-	 * @return int
-	 * @describe 统计老师指定班级的排课数量
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	int countTeacherClassCourseSchedule(Map<String, Object> params);
-
-	/**
-	 * @param params:
-	 * @return int
-	 * @describe 统计历史老师指定班级的排课数量
-	 * @author Joburgess
-	 * @date 2019/10/19
-	 */
-	int countTeacherHistoryClassCourseSchedule(Map<String, Object> params);
-
-	/**
-	 * @param musicGroupId: 乐团编号
-	 * @return java.util.List<java.util.Map < java.lang.Long, java.lang.Integer>>
-	 * @describe 统计乐团下班级的排课数
-	 * @author Joburgess
-	 * @date 2019/10/18
-	 */
-	List<Map<Integer, Long>> countClassCourseNumByMusicGroup(String musicGroupId);
-
-	/**
-	 * @param courseSchedules: 课程计划编号列表
-	 * @return java.util.List<java.util.Map < java.lang.Integer, java.lang.Integer>>
-	 * @describe 根据课程计划获取对应课次
-	 * @author Joburgess
-	 * @date 2019/10/20
-	 */
-	List<Map<Integer, Integer>> findCourseScheduleCurrentTimes(List<Integer> courseSchedules);
-
-	/**
-	 * 根据乐团编号修改课程教学点
-	 *
-	 * @param musicGroupId
-	 * @param schoolId
-	 */
-	void updateByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("schoolId") Integer schoolId);
-
-
-
-	/**
-	 * 获取班级某时间后相应节数的课程
-	 *
-	 * @param classGroupId
-	 * @param startDate
-	 * @param times
-	 * @return
-	 */
-	List<CourseSchedule> findCourseScheduleByClassGroupIdAndDate(@Param("classGroupId") Integer classGroupId, @Param("startDate") String startDate,
-			@Param("times") int times);
-
-	/**
-	 * 根据时间范围查询老师指定类型的课程列表
-	 * @param teacherId 老师编号
-	 * @param type 课程类型 (如果为null,查询所有类型)
-	 * @param startTime 开始时间
-	 * @param endTime 结束时间
-	 * @return
-	 */
-	List<CourseSchedule> queryTeacherCourseScheduleListByTimeRangeAndType(@Param("teacherId") Integer teacherId, @Param("type") CourseScheduleType type,
-			@Param("startTime") Date startTime, @Param("endTime") Date endTime);
-
-	/**
-	 * 查询班级未开始的课程
-	 *
-	 * @param classGroupId
-	 * @return
-	 */
-	List<CourseSchedule> findNoStartCoursesByClassGroupId(@Param("classGroupId") Integer classGroupId);
-
-	/**
-	 * @describe 获取点名详情头部信息
-	 * @author Joburgess
-	 * @date 2019/10/24
-	 * @param courseScheduleId: 课程编号
-	 * @return com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto
-	 */
-	CourseAttendanceDetailHeadInfoDto findByCourse(Long courseScheduleId);
-
-	/**
-	 * 获取学员购买的所有乐团和vip编号分页列表
-	 * @param params
-	 * @return
-	 */
-	List<String> queryMusicGroupIds(Map<String, Object> params);
-
-	/**
-	 * @describe 获取时间段内的课程
-	 * @author Joburgess
-	 * @date 2019/10/31
-	 * @param startTime: 开始时间
-	 * @param endTime: 结束时间
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 */
-	List<CourseSchedule> findByDateZone(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
-
-	/**
-	 * 查询学生明天的课程数
-	 * @return
-	 */
-	List<Mapper> queryStudentCoursesTimesOfTomorrow();
-
-	/**
-	 * 查询学生90分钟内未上的课程
-	 * @return
-	 */
-	List<Mapper> queryStudentNotStartCourseScheduleIn90Mins();
-	
-	/**
-	 * 查询老师明天的课程数
-	 * @return
-	 */
-	List<Mapper> queryTeacherCoursesTimesOfTomorrow();
-
-	/**
-	 * 查询老师30分钟内未上的课程
-	 * @return
-	 */
-	List<Mapper> queryTeacherNotStartCourseScheduleIn30Mins();
-
-	/**
-	 * @describe 获取课程编号和与之对应教师编号列表
-	 * @author Joburgess
-	 * @date 2019/11/2
-	 * @param courseScheduleIds: 课程编号列表
-	 * @param teacherRole: 教师角色
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto>
-	 */
-	List<IntegerAndIntegerListDto> findCourseScheduleIdAndUserIdsMap(@Param("courseScheduleIds") List<Long> courseScheduleIds,
-																	 @Param("teacherRole") String teacherRole);
-
-	/**
-	 * @describe 获取班级编号和与之对应的教师编号列表
-	 * @author Joburgess
-	 * @date 2019/11/3
-	 * @param classGroup: 班级编号列表
-	 * @param teacherRole: 教师角色
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto>
-	 */
-	List<IntegerAndIntegerListDto> findClassGroupAndUserIdsMap(@Param("classGroupIds") List<Integer> classGroup,
-															   @Param("teacherRole") String teacherRole);
-
-	/**
-	 * @describe 获取指定日期的课程
-	 * @author Joburgess
-	 * @date 2019/11/3
-	 * @param date: 日期
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 */
-	List<CourseSchedule> findCourseScheduleWithDate(@Param("date") Date date);
-
-	/**
-	 * @describe 根据班级获取课程计划
-	 * @author Joburgess
-	 * @date 2019/11/5
-	 * @param classGroupId: 班级编号
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 */
-	List<CourseSchedule> findByClassGroup(@Param("classGroupId") Integer classGroupId);
-
-	/**
-	 * @describe 根据班级获取课程计划
-	 * @author Joburgess
-	 * @date 2019/11/5
-	 * @param classGroupIds: 班级编号
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 */
-	List<CourseSchedule> findByClassGroups(@Param("classGroupIds") List<Integer> classGroupIds);
-
-	/**
-	 * 获取当前课程所有学员列表
-	 * @param courseScheduleId
-	 * @return
-	 */
+    /**
+     * 根据教师ID获取当前课程信息
+     *
+     * @param courseID
+     * @return
+     */
+    TeacherAttendanceDto getCurrentCourseDetail(@Param("courseID") Long courseID);
+
+    /**
+     * @param startTime:
+     * @param endTime:
+     * @param teacherId:
+     * @return com.ym.mec.biz.dal.dto.TeacherAttendanceDto
+     * @describe 根据时间区间获取教师上课的课程
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    TeacherAttendanceDto getTeacherCourseByDateSpeed(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("teacherId") Long teacherId);
+
+    int batchAddCourseSchedules(List<CourseSchedule> courseSchedules);
+
+    /**
+     * @param courseScheduleId: 课程编号
+     * @param status:           状态
+     * @return int
+     * @describe 修改课程的状态
+     * @author Joburgess
+     * @date 2019/11/4
+     */
+    int updateCourscheduleStatus(@Param("courseScheduleId") Integer courseScheduleId,
+                                 @Param("status") String status);
+
+    /**
+     * @param courseScheduleIds: 课程编号列表
+     * @return int
+     * @describe 批量删除课程计划
+     * @author Joburgess
+     * @date 2019/10/31
+     */
+    int batchDeleteCourseSchedules(@Param("courseScheduleIds") List<Long> courseScheduleIds);
+
+    /**
+     * @param teacherId: 教师编号
+     * @param classDate: 上课日期
+     * @param startTime: 开始时间
+     * @param endTime:   结束时间
+     * @return int
+     * @describe 统计教师再指定时间区段内存在冲突的课程数量
+     * @author Joburgess
+     * @date 2019/10/28
+     */
+    int countExistRepeatInDateZone(@Param("teacherId") Integer teacherId, @Param("classDate") Date classDate, @Param("startTime") Date startTime,
+                                   @Param("endTime") Date endTime);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 统计学生所属班级数量
+     */
+    Integer[] countStudentInClass(List<Integer> classGroupIDs);
+
+    /**
+     * @param courseScheduleIds: 课程编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 根据课程编号列表获取课程列表
+     * @author Joburgess
+     * @date 2019/10/22
+     */
+    List<CourseSchedule> findByCourseScheduleIds(@Param("courseScheduleIds") List<Long> courseScheduleIds);
+
+    /**
+     * @param courseScheduleIds: 课程编号列表
+     * @return java.util.List<java.util.Map < java.lang.Integer, java.lang.Integer>>
+     * @describe 根据课程编号列表获取助教列表
+     * @author Joburgess
+     * @date 2019/10/23
+     */
+    List<CourseScheduleTeacherSalary> findTeachingTeachers(@Param("courseScheduleIds") List<Long> courseScheduleIds);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据日期获取当日排课信息
+     */
+    List<CourseScheduleDto> getCourseSchedulesWithDate(@Param("classDate") Date classDate);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @Author: Joburgess
+     * @Date: 2019/10/14
+     * @params [classDates, classGroupId]
+     * @describe 根据班级和上课日期获取课程计划
+     */
+    List<CourseSchedule> findByClassGroupAndDate(@Param("classDates") List<Date> classDates, @Param("classGroupId") Long classGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据日期获取学生当日排课信息
+     */
+    List<CourseScheduleDto> getStudentCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("studentId") Long studentId);
+
+    /**
+     * @return java.util.List<java.lang.String>
+     * @Author: Joburgess
+     * @Date: 2019/10/11
+     * @params [courseScheduleId]
+     * @describe 获取课程签到学生姓名
+     */
+    List<String> findStudentNamesByCourseSchedule(Long courseScheduleId);
+
+    /**
+     * @param classDate: 上课日期
+     * @param teacherId: 教师编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
+     * @describe 根据日期获取老师当日排课信息
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<CourseScheduleDto> getTeacherCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("teacherId") Long teacherId, @Param("type") String type);
+
+    /**
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
+     * @describe 根据日期获取排课
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<CourseScheduleDto> getCourseSchedulesWithDate(Map<String, Object> params);
+
+    int countCourseSchedulesWithDate(Map<String, Object> params);
+
+    /**
+     * @param musicGroupID: 乐团编号
+     * @return int
+     * @describe 根据乐团ID删除排课
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    int deleteCourseSchedulesByMusicGroupID(@Param("musicGroupID") Long musicGroupID);
+
+    /**
+     * @param musicGroupID: 乐团编号
+     * @param month:        月份
+     * @return java.util.List<java.util.Date>
+     * @describe 根据月份获取乐团在该月有课的日期
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<Date> getCourseScheduleDateByMonth(@Param("musicGroupID") Long musicGroupID, @Param("month") Date month);
+
+    /**
+     * @param studentId:
+     * @param month:
+     * @param isAttend:
+     * @return java.util.List<java.util.Date>
+     * @describe 获取学生有课日期
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<Date> getStudentCourseScheduleDate(@Param("studentId") Long studentId, @Param("month") Date month, @Param("isAttend") Integer isAttend);
+
+    /**
+     * @param teacherId:
+     * @param month:
+     * @return java.util.List<java.util.Date>
+     * @describe 获取教师有课日期
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<Date> getTeacherCourseScheduleDate(@Param("teacherId") Long teacherId, @Param("month") Date month, @Param("type") String type);
+
+    /**
+     * @param month:
+     * @param organId:
+     * @return java.util.List<java.util.Date>
+     * @describe 获取当月有课的日期
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<Date> getCourseScheduleDate(@Param("month") Date month, @Param("organId") Long organId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/23
+     * 统计教师在一天内有时间重复的课数
+     */
+    int countTeacherCourseInOnDayRepeats(CourseSchedule courseSchedule);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据日期获取对应老师的课程
+     */
+    List<CourseSchedule> findTeacherCoursesInDates(@Param("dates") List<Date> dates, @Param("teacherId") Long teacherId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据日期获取课程
+     */
+    List<CourseSchedule> findCoursesByDates(@Param("dates") List<Date> dates);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 获取在指定时间段内存在重复的课程
+     */
+    List<CourseSchedule> findOverLapCoursesInDay(@Param("dates") List<Date> dates, @Param("startClassTime") Date startClassTime,
+                                                 @Param("endClassTime") Date endClassTime);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/29
+     * 获取班级的声部
+     */
+    String[] findClassSubjects(List<Integer> ids);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据id批量获取课程
+     */
+    List<CourseSchedule> findCourseSchedulesByIds(@Param("ids") Long[] ids);
+
+    /**
+     * 获取班级未开始的课程计划
+     *
+     * @param classGroupTeacherMapperList
+     * @return
+     */
+    List<CourseSchedule> findClassGroupNoStartCourseSchedules(@Param("classGroupTeacherMapperList") List<ClassGroupTeacherMapper> classGroupTeacherMapperList);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleRecords(Map<String, Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 统计学生上课记录
+     */
+    int countStudentCourseScheduleRecords(Map<String, Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生未上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId, @Param("date") Date date);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [classGroupId]
+     * @describe 统计已上课次
+     */
+    int countClassTimes(@Param("classGroupId") Long classGroupId, @Param("startClassTime") Date startClassTime);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 获取课程信息
+     */
+    CourseScheduleDto getCourseSchedules(@Param("courseScheduleId") Long courseScheduleId);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @Author: Joburgess
+     * @Date: 2019/10/14
+     * @params [vipGroupId]
+     * @describe 获取vip课排课计划
+     */
+    List<CourseSchedule> findVipGroupCourseSchedules(@Param("vipGroupId") Long vipGroupId);
+
+    /**
+     * @return java.lang.String
+     * @Author: Joburgess
+     * @Date: 2019/10/16
+     * @params [courseScheduleId]
+     * @describe 获取课程关联班级类型
+     */
+    String findClassTypeByCourse(@Param("courseScheduleId") Long courseScheduleId);
+
+    /**
+     * 根据课程状态查询老师指定月份的VIP课程记录数
+     *
+     * @param monthDate 指定月份
+     * @param status    课程状态
+     * @return
+     */
+    List<Map<Integer, Integer>> queryVipGroupTeachereClassTimesByMonth(@Param("monthDate") Date monthDate, @Param("status") CourseStatusEnum status);
+
+    /**
+     * 查询已完成未更新状态的课程列表
+     *
+     * @return
+     */
+    List<CourseSchedule> queryFinishedWithNoUpdateStatus();
+
+    int batchUpdate(List<CourseSchedule> courseScheduleList);
+
+    /**
+     * 查询提前指定分钟数还未签到的用户
+     *
+     * @param minutes 分钟数
+     * @return
+     */
+    List<CourseSchedule> queryNoSignInListByBeforeMinutes(Integer minutes);
+
+    /**
+     * @param params: 参数
+     * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto>
+     * @describe 查询老师指定班级的排课信息
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<TeacherClassCourseSchudeleDto> queryTeacherClassCourseSchedule(Map<String, Object> params);
+
+    /**
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto>
+     * @describe 查询老师指定班级历史排课信息
+     * @author Joburgess
+     * @date 2019/10/19
+     */
+    List<TeacherClassCourseSchudeleDto> queryTeacherHistoryClassCourseSchedule(Map<String, Object> params);
+
+    /**
+     * @param params: 参数
+     * @return int
+     * @describe 统计老师指定班级的排课数量
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    int countTeacherClassCourseSchedule(Map<String, Object> params);
+
+    /**
+     * @param params:
+     * @return int
+     * @describe 统计历史老师指定班级的排课数量
+     * @author Joburgess
+     * @date 2019/10/19
+     */
+    int countTeacherHistoryClassCourseSchedule(Map<String, Object> params);
+
+    /**
+     * @param musicGroupId: 乐团编号
+     * @return java.util.List<java.util.Map < java.lang.Long, java.lang.Integer>>
+     * @describe 统计乐团下班级的排课数
+     * @author Joburgess
+     * @date 2019/10/18
+     */
+    List<Map<Integer, Long>> countClassCourseNumByMusicGroup(String musicGroupId);
+
+    /**
+     * @param courseSchedules: 课程计划编号列表
+     * @return java.util.List<java.util.Map < java.lang.Integer, java.lang.Integer>>
+     * @describe 根据课程计划获取对应课次
+     * @author Joburgess
+     * @date 2019/10/20
+     */
+    List<Map<Integer, Integer>> findCourseScheduleCurrentTimes(List<Integer> courseSchedules);
+
+    /**
+     * 根据乐团编号修改课程教学点
+     *
+     * @param musicGroupId
+     * @param schoolId
+     */
+    void updateByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("schoolId") Integer schoolId);
+
+
+    /**
+     * 获取班级某时间后相应节数的课程
+     *
+     * @param classGroupId
+     * @param startDate
+     * @param times
+     * @return
+     */
+    List<CourseSchedule> findCourseScheduleByClassGroupIdAndDate(@Param("classGroupId") Integer classGroupId, @Param("startDate") String startDate,
+                                                                 @Param("times") int times);
+
+    /**
+     * 根据时间范围查询老师指定类型的课程列表
+     *
+     * @param teacherId 老师编号
+     * @param type      课程类型 (如果为null,查询所有类型)
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    List<CourseSchedule> queryTeacherCourseScheduleListByTimeRangeAndType(@Param("teacherId") Integer teacherId, @Param("type") CourseScheduleType type,
+                                                                          @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    /**
+     * 查询班级未开始的课程
+     *
+     * @param classGroupId
+     * @return
+     */
+    List<CourseSchedule> findNoStartCoursesByClassGroupId(@Param("classGroupId") Integer classGroupId);
+
+    /**
+     * @param courseScheduleId: 课程编号
+     * @return com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto
+     * @describe 获取点名详情头部信息
+     * @author Joburgess
+     * @date 2019/10/24
+     */
+    CourseAttendanceDetailHeadInfoDto findByCourse(Long courseScheduleId);
+
+    /**
+     * 获取学员购买的所有乐团和vip编号分页列表
+     *
+     * @param params
+     * @return
+     */
+    List<String> queryMusicGroupIds(Map<String, Object> params);
+
+    /**
+     * @param startTime: 开始时间
+     * @param endTime:   结束时间
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 获取时间段内的课程
+     * @author Joburgess
+     * @date 2019/10/31
+     */
+    List<CourseSchedule> findByDateZone(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    /**
+     * 查询学生明天的课程数
+     *
+     * @return
+     */
+    List<Mapper> queryStudentCoursesTimesOfTomorrow();
+
+    /**
+     * 查询学生90分钟内未上的课程
+     *
+     * @return
+     */
+    List<Mapper> queryStudentNotStartCourseScheduleIn90Mins();
+
+    /**
+     * 查询老师明天的课程数
+     *
+     * @return
+     */
+    List<Mapper> queryTeacherCoursesTimesOfTomorrow();
+
+    /**
+     * 查询老师30分钟内未上的课程
+     *
+     * @return
+     */
+    List<Mapper> queryTeacherNotStartCourseScheduleIn30Mins();
+
+    /**
+     * @param courseScheduleIds: 课程编号列表
+     * @param teacherRole:       教师角色
+     * @return java.util.List<com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto>
+     * @describe 获取课程编号和与之对应教师编号列表
+     * @author Joburgess
+     * @date 2019/11/2
+     */
+    List<IntegerAndIntegerListDto> findCourseScheduleIdAndUserIdsMap(@Param("courseScheduleIds") List<Long> courseScheduleIds,
+                                                                     @Param("teacherRole") String teacherRole);
+
+    /**
+     * @param classGroup:  班级编号列表
+     * @param teacherRole: 教师角色
+     * @return java.util.List<com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto>
+     * @describe 获取班级编号和与之对应的教师编号列表
+     * @author Joburgess
+     * @date 2019/11/3
+     */
+    List<IntegerAndIntegerListDto> findClassGroupAndUserIdsMap(@Param("classGroupIds") List<Integer> classGroup,
+                                                               @Param("teacherRole") String teacherRole);
+
+    /**
+     * @param date: 日期
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 获取指定日期的课程
+     * @author Joburgess
+     * @date 2019/11/3
+     */
+    List<CourseSchedule> findCourseScheduleWithDate(@Param("date") Date date);
+
+    /**
+     * @param classGroupId: 班级编号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 根据班级获取课程计划
+     * @author Joburgess
+     * @date 2019/11/5
+     */
+    List<CourseSchedule> findByClassGroup(@Param("classGroupId") Integer classGroupId);
+
+    /**
+     * @param classGroupIds: 班级编号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 根据班级获取课程计划
+     * @author Joburgess
+     * @date 2019/11/5
+     */
+    List<CourseSchedule> findByClassGroups(@Param("classGroupIds") List<Integer> classGroupIds);
+
+    /**
+     * 获取当前课程所有学员列表
+     *
+     * @param courseScheduleId
+     * @return
+     */
     List<Map<Integer, String>> findStudentMap(Integer courseScheduleId);
 
     List<CourseSchedule> findAllCourseSches();
+
+    /**
+     * 获取一节班级的课程
+     * @param classGroupId
+     * @return
+     */
+    CourseSchedule findOneCourseScheduleByClassGroupId(@Param("classGroupId") Integer classGroupId);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/HighClassGroupDto.java

@@ -17,6 +17,9 @@ public class HighClassGroupDto extends ClassGroup {
 	@ApiModelProperty(value = "教师user_id",required = true)
 	private Integer userId;
 
+	@ApiModelProperty(value = "教师名字",required = true)
+	private String teacherName;
+
 	@ApiModelProperty(value = "星期几",required = true)
 	private Integer dayOfWeek;
 
@@ -84,4 +87,12 @@ public class HighClassGroupDto extends ClassGroup {
 	public void setStartDate(String startDate) {
 		this.startDate = startDate;
 	}
+
+	public String getTeacherName() {
+		return teacherName;
+	}
+
+	public void setTeacherName(String teacherName) {
+		this.teacherName = teacherName;
+	}
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -12,6 +12,7 @@ import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
 import org.snaker.engine.access.Page;
 
 import java.util.List;
@@ -292,4 +293,14 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     List<ClassGroupTeachersDto> classGroupAndTeacher(Integer classGroupId);
+
+
+    /**
+     * 根据乐团跟声部获取提高班列表
+     *
+     * @param musicGroupId
+     * @param subjectId
+     * @return
+     */
+    List<HighClassGroupDto> findClassGroupByMusicGroupIdAndSubjectId(String musicGroupId,Integer subjectId);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -62,4 +62,7 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 	 * @return
 	 */
 	List<StudentPaymentOrder> findOrdersOverTime(List<String> orderNoList, DealStatusEnum status, Date beforeTime);
+
+	void queryOrderStatus() throws Exception;
+
 }

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

@@ -502,7 +502,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         courseListDtos.addAll(vipCourses);
         //检测对应乐团是否已申请退费
         List<Map<String, Integer>> isApplyMaps = studentApplyRefundsDao.checkIsApplyRefund(musicGroupIds, userId);
-        Map<String, Integer> isApplyMap= MapUtil.convertMybatisMap(isApplyMaps);
+        Map<String, Integer> isApplyMap = MapUtil.convertMybatisMap(isApplyMaps);
         //获取所有教学点名称列表
         Set<Integer> schoolIds = courseListDtos.stream().map(CourseListDto::getTeacherSchoolId).collect(Collectors.toSet());
         Map<Integer, String> schoolNames = MapUtil.convertMybatisMap(schoolDao.queryNameByIds(StringUtils.join(schoolIds, ",")));
@@ -1620,4 +1620,23 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
         return classGroups;
     }
+
+    @Override
+    public List<HighClassGroupDto> findClassGroupByMusicGroupIdAndSubjectId(String musicGroupId, Integer subjectId) {
+        List<HighClassGroupDto> highClassGroupList = classGroupDao.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId, subjectId);
+        for (HighClassGroupDto highClassGroup : highClassGroupList) {
+            ClassGroupTeacherMapper bishopTeacher = classGroupTeacherMapperDao.findByClassGroupAndRole(highClassGroup.getId().longValue(), TeachTypeEnum.BISHOP);
+            highClassGroup.setTeacherName(bishopTeacher.getUserName());
+            CourseSchedule courseSchedule = courseScheduleDao.findOneCourseScheduleByClassGroupId(highClassGroup.getId());
+            highClassGroup.setStartClassTime(DateUtil.format(courseSchedule.getStartClassTime(),"HH:mm:ss"));
+            highClassGroup.setEndClassTime(DateUtil.format(courseSchedule.getEndClassTime(),"HH:mm:ss"));
+
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(courseSchedule.getClassDate());
+            int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+            highClassGroup.setDayOfWeek(dayOfWeek-1);
+
+        }
+        return  highClassGroupList;
+    }
 }

+ 148 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1,24 +1,44 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.huifu.adapay.model.payment.Payment;
 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.adapay.Pay;
+import com.ym.mec.thirdparty.yqpay.Msg;
+import com.ym.mec.thirdparty.yqpay.RsqMsg;
+import com.ym.mec.thirdparty.yqpay.YqPayFeignService;
+import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrder> implements StudentPaymentOrderService {
 
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
+    @Autowired
+    private YqPayFeignService yqPayFeignService;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private VipGroupService vipGroupService;
+    @Autowired
+    private MusicGroupService musicGroupService;
 
     @Override
     public BaseDAO<Long, StudentPaymentOrder> getDAO() {
@@ -54,4 +74,130 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     public List<StudentPaymentOrder> findOrdersOverTime(List<String> orderNoList, DealStatusEnum status, Date beforeTime) {
         return studentPaymentOrderDao.findOrdersOverTime(orderNoList,status,beforeTime);
     }
+
+    @Override
+    public void queryOrderStatus() throws Exception {
+           yqPayQuery();
+           adaPayQuery();
+    }
+
+    private void yqPayQuery() throws Exception {
+        List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
+
+        if(payingOrders.size() ==0){
+            return;
+        }
+        List<String> orderNoList = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.toList());
+        String merOrderNos = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.joining(","));
+
+        String notifyUrl = ""; //回调地址
+        Map<String, Object> resultMap = new LinkedHashMap<>();
+        resultMap.put("merOrderNoList", merOrderNos);
+        Map<String, Object> requestMap = YqPayUtil.getRequestMap(notifyUrl, resultMap);
+
+        RsqMsg rsqMsg = new RsqMsg(requestMap);
+
+        Msg queryRs = yqPayFeignService.orderQuery(rsqMsg);
+
+        if (queryRs.getCode().equals("88")) {
+            //更新订单状态
+            String[] statusArr = {"0", "1", "7"};
+            String responseParameters = queryRs.getResponseParameters();
+            List<Map<String, String>> responseList = JSON.parseObject(responseParameters, List.class);
+            for (Map<String, String> response : responseList) {
+                Map<String, String> rpMap = response;
+                String channelType = rpMap.get("channelType").equals("1") ? "WXPay" : (rpMap.get("channelType").equals("2") ? "Alipay" : "quickPay");
+                rpMap.put("channelType", channelType);
+
+                if (Arrays.asList(statusArr).contains(rpMap.get("tradeState"))) {
+                    updateOrder(rpMap); //更新订单
+                }
+                if (orderNoList.contains(rpMap.get("merOrderNo"))) {
+                    orderNoList.remove(rpMap.get("merOrderNo"));
+                }
+            }
+            closeOrders(orderNoList); //关闭订单
+        }
+    }
+
+    private void adaPayQuery() throws Exception {
+        List<StudentPaymentOrder> payingOrders = findOrdersByStatus(DealStatusEnum.ING, "ADAPAY");
+        if(payingOrders.size()==0){
+            return;
+        }
+
+        List<String> orderNoList = new ArrayList<String>();
+
+        for (StudentPaymentOrder payingOrder : payingOrders) {
+            if (payingOrder.getTransNo() == null) {
+                orderNoList.add(payingOrder.getOrderNo());
+                continue;
+            }
+            Payment payment = new Pay().queryPayment(payingOrder.getTransNo());
+            Map<String, String> rpMap = new HashMap<>();
+            rpMap.put("merOrderNo", payingOrder.getOrderNo());
+            rpMap.put("remarks", payment.getReason());
+            rpMap.put("orderNo", payment.getId());
+            rpMap.put("channelType", payment.getPayChannel());
+            if (payment.getStatus().equals("succeeded")) {
+                rpMap.put("tradeState", "1");
+            }
+            if (payment.getStatus().equals("failed")) {
+                rpMap.put("tradeState", "0");
+            }
+            if (payment.getStatus().equals("pending")) {
+                orderNoList.add(payingOrder.getOrderNo());
+            }
+        }
+        closeOrders(orderNoList);
+    }
+
+    private void updateOrder(Map<String, String> rpMap) throws Exception {
+        DealStatusEnum status = rpMap.get("tradeState").equals("1") ? DealStatusEnum.SUCCESS : DealStatusEnum.FAilED;
+        StudentPaymentOrder order = findOrderByOrderNo(rpMap.get("merOrderNo"));
+        if (order == null || !order.getStatus().equals(DealStatusEnum.ING)) {
+            return;
+        }
+
+        if (status.equals(DealStatusEnum.SUCCESS)) {
+            order.setPayTime(new Date());
+        } else {
+            order.setMemo(rpMap.get("remarks"));
+        }
+        order.setStatus(status);
+        order.setTransNo(rpMap.get("orderNo"));
+        order.setPaymentBusinessChannel(rpMap.get("channelType"));
+
+        if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
+            studentRegistrationService.updateApplyOrder(order);
+        } else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)) {
+            vipGroupService.orderCallback(order);
+        } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
+            musicGroupService.renewForCallback(order);
+        }
+    }
+
+    private void closeOrders(List<String> orderNoList) throws Exception {
+        if (orderNoList.size() == 0) {
+            return;
+        }
+
+        Calendar beforeTime = Calendar.getInstance();
+        beforeTime.add(Calendar.MINUTE, -30);// 30分钟之前的时间
+        Date beforeDate = beforeTime.getTime();
+
+        List<StudentPaymentOrder> ordersOverTime = findOrdersOverTime(orderNoList, DealStatusEnum.ING, beforeDate);
+        for (StudentPaymentOrder order : ordersOverTime) {
+            order.setStatus(DealStatusEnum.FAilED);
+            order.setMemo("超时未支付关闭");
+            if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
+                studentRegistrationService.updateApplyOrder(order);
+            } else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)) {
+                vipGroupService.orderCallback(order);
+            } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
+                musicGroupService.renewForCallback(order);
+            }
+        }
+
+    }
 }

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -691,4 +691,27 @@
         LEFT JOIN class_group cg ON cgr.sub_class_group_id_=cg.id_
         WHERE cgr.class_group_id_=#{maxCourseScheduleId} AND cg.del_flag_ = 0
     </select>
+
+    <!-- 根据乐团id和声部id查提高班 -->
+    <resultMap type="com.ym.mec.biz.dal.dto.HighClassGroupDto" id="HighClassGroup">
+        <result column="id_" property="id"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="subject_id_list_" property="subjectIdList"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result column="expect_student_num_" property="expectStudentNum"/>
+        <result column="name_" property="name"/>
+        <result column="student_num_" property="studentNum"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="total_class_times_" property="totalClassTimes"/>
+        <result column="img_" property="img"/>
+        <result column="current_class_times_" property="currentClassTimes"/>
+    </resultMap>
+    <select id="findClassGroupByMusicGroupIdAndSubjectId" resultMap="HighClassGroup">
+        SELECT * FROM class_group WHERE music_group_id_=#{musicGroupId} AND FIND_IN_SET(#{subjectId},subject_id_list_)
+        AND type_='HIGH' AND del_flag_='0';
+    </select>
+
 </mapper>

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

@@ -160,4 +160,10 @@
         LEFT JOIN student_registration sr ON (sr.user_id_ = cgsm.user_id_ AND sr.music_group_id_ = cgsm.music_group_id_)
         WHERE cgsm.class_group_id_ = #{classGroupId} AND cgsm.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
     </select>
+
+    <select id="findHighClassGroupHasUser" resultMap="ClassGroupStudentMapper">
+        SELECT cgsm.* FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        WHERE cgsm.music_group_id_ = #{musicGroupId} AND cgsm.user_id_=#{userId} AND cg.type_ ='HIGH' AND cgsm.status_='NORMAL'
+    </select>
 </mapper>

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

@@ -1263,4 +1263,8 @@
             cs.schoole_id_
         from course_schedule cs
     </select>
+
+    <select id="findOneCourseScheduleByClassGroupId" resultMap="CourseSchedule">
+        SELECT * FROM course_schedule WHERE class_group_id_=#{classGroupId} LIMIT 1
+    </select>
 </mapper>

+ 30 - 1
mec-student/src/main/java/com/ym/mec/student/controller/ClassGroupController.java

@@ -3,11 +3,14 @@ package com.ym.mec.student.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dto.HighClassGroupDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.ClassGroupStudentMapperService;
+import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -15,11 +18,15 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RequestMapping("classGroup")
 @Api(tags = "班级服务")
@@ -33,11 +40,13 @@ public class ClassGroupController extends BaseController {
     private ClassGroupService classGroupService;
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
 
     @ApiOperation(value = "小班课报名")
     @PostMapping("/highReg")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
-    public HttpResponseResult highReg(int classGroupId){
+    public HttpResponseResult highReg(Integer classGroupId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         ClassGroup classGroup = classGroupService.get(classGroupId);
         if (classGroup == null || !classGroup.getType().equals(ClassGroupTypeEnum.HIGH) || classGroup.getDelFlag().equals(1)) {
@@ -53,4 +62,24 @@ public class ClassGroupController extends BaseController {
         classGroupService.addStudent(classGroup, sysUser.getId());
         return succeed("报名成功");
     }
+
+    @ApiOperation(value = "用户声部小班课列表")
+    @GetMapping("/highClassGroups")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+    public HttpResponseResult getHighClassGroup(String musicGroupId) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = 1102;
+        StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+        if (studentRegistration == null || studentRegistration.getActualSubjectId() == null) {
+            return failed("学生不在该乐团");
+        }
+        Map<String, Object> classGroupAndStatusMap = new HashMap<>();
+        List<HighClassGroupDto> highClassGroups = classGroupService.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId, studentRegistration.getActualSubjectId());
+        List<ClassGroupStudentMapper> ClassGroupStudentMapper = classGroupStudentMapperDao.findHighClassGroupHasUser(musicGroupId, userId);
+        classGroupAndStatusMap.put("highClassGroups", highClassGroups);
+        if (ClassGroupStudentMapper.size() > 0) {
+            classGroupAndStatusMap.put("hasReg", true);
+        }
+        return succeed(classGroupAndStatusMap);
+    }
 }

+ 5 - 12
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import static com.netflix.config.DeploymentContext.ContextKey.appId;
 
@@ -184,18 +185,12 @@ public class StudentOrderController extends BaseController {
     //@Scheduled(cron = "0/5 * * * * ?")
     public void getOrderStatus() throws Exception {
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
-        String merOrderNos = ""; //
-        List<String> orderNoList = new ArrayList<String>();
 
-        for (StudentPaymentOrder payingOrder : payingOrders) {
-            String orderNo = payingOrder.getOrderNo();
-            orderNoList.add(orderNo);
-            merOrderNos += orderNo + ",";
-        }
-        if (merOrderNos.isEmpty()) {
+        if(payingOrders.size() ==0){
             return;
         }
-        merOrderNos = merOrderNos.substring(0, merOrderNos.length() - 1);
+        List<String> orderNoList = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.toList());
+        String merOrderNos = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.joining(","));
 
         String notifyUrl = ""; //回调地址
         Map<String, Object> resultMap = new LinkedHashMap<>();
@@ -206,8 +201,6 @@ public class StudentOrderController extends BaseController {
 
         Msg queryRs = yqQueryService.orderQuery(rsqMsg);
 
-        logger.info("查询易乾结果" + queryRs.toString());
-        //logger.info("查询易乾结果" + queryRs.toString());
         if (queryRs.getCode().equals("88")) {
             //更新订单状态
             String[] statusArr = {"0", "1", "7"};
@@ -361,7 +354,7 @@ public class StudentOrderController extends BaseController {
 
     }
 
-    @Scheduled(cron = "0/30 * * * * ?")
+   // @Scheduled(cron = "0/30 * * * * ?")
     public void setSuccessStatus() throws Exception {
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
 

+ 10 - 7
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -1,17 +1,11 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.biz.service.CourseHomeworkService;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
-import com.ym.mec.biz.service.MusicGroupStudentFeeService;
-import com.ym.mec.biz.service.StudentCourseHomeworkService;
-import com.ym.mec.biz.service.TeacherAttendanceService;
-import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("task")
@@ -39,6 +33,9 @@ public class TaskController extends BaseController {
 	@Autowired
 	private CourseHomeworkService courseHomeworkService;
 
+	@Autowired
+	private StudentPaymentOrderService studentPaymentOrderService;
+
 	@GetMapping("/refreshPaymentFeeStatus")
 	// 刷新付费状态
 	public void refreshPaymentFeeStatus() {
@@ -105,4 +102,10 @@ public class TaskController extends BaseController {
 		courseHomeworkService.homeworkNoReplyRemind();
 	}
 
+	//查询订单状态
+	@GetMapping("/queryOrderStatus")
+	public void  queryOrderStatus() throws Exception {
+		studentPaymentOrderService.queryOrderStatus();
+	}
+
 }