Explorar o código

fix:1、作业改造

Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
7715494109

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -97,6 +97,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
     List<StudentServeCourseDto> getServeStudentCourseStartTimes(@Param("monday") String monday);
 
+    List<StudentServeCourseDto> getStudentFutureCourseInfo(@Param("monday") String monday);
+
     /**
      * @param monday:
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServeDto>

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

@@ -17,6 +17,9 @@ public class StudentAttendanceDto {
 
     private Long courseScheduleId;
 
+    @ApiModelProperty(value = "签退附件")
+    private String signOutAttachments;
+
     @ApiModelProperty(value = "备注",required = false)
     private String remark;
 
@@ -61,4 +64,12 @@ public class StudentAttendanceDto {
     public void setStudentAttendances(List<StudentAttendance> studentAttendances) {
         this.studentAttendances = studentAttendances;
     }
+
+    public String getSignOutAttachments() {
+        return signOutAttachments;
+    }
+
+    public void setSignOutAttachments(String signOutAttachments) {
+        this.signOutAttachments = signOutAttachments;
+    }
 }

+ 68 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentServeCourseDto.java

@@ -1,5 +1,9 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+
 import java.util.Date;
 
 /**
@@ -10,10 +14,38 @@ public class StudentServeCourseDto {
 
     private Integer studentId;
 
+    private Long courseScheduleId;
+
+    private GroupType groupType;
+
+    private String musicGroupId;
+
+    private CourseSchedule.CourseScheduleType type;
+
+    private Integer actualTeacherId;
+
     private Date courseStartTime;
 
     private Date serviceTagUpdateTime;
 
+    private TeachModeEnum teachMode;
+
+    public TeachModeEnum getTeachMode() {
+        return teachMode;
+    }
+
+    public void setTeachMode(TeachModeEnum teachMode) {
+        this.teachMode = teachMode;
+    }
+
+    public Date getCourseStartTime() {
+        return courseStartTime;
+    }
+
+    public void setCourseStartTime(Date courseStartTime) {
+        this.courseStartTime = courseStartTime;
+    }
+
     public Date getServiceTagUpdateTime() {
         return serviceTagUpdateTime;
     }
@@ -30,11 +62,43 @@ public class StudentServeCourseDto {
         this.studentId = studentId;
     }
 
-    public Date getCourseStartTime() {
-        return courseStartTime;
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
     }
 
-    public void setCourseStartTime(Date courseStartTime) {
-        this.courseStartTime = courseStartTime;
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public CourseSchedule.CourseScheduleType getType() {
+        return type;
+    }
+
+    public void setType(CourseSchedule.CourseScheduleType type) {
+        this.type = type;
+    }
+
+    public Integer getActualTeacherId() {
+        return actualTeacherId;
+    }
+
+    public void setActualTeacherId(Integer actualTeacherId) {
+        this.actualTeacherId = actualTeacherId;
     }
 }

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentExtracurricularExercisesSituation.java

@@ -52,6 +52,34 @@ public class StudentExtracurricularExercisesSituation {
 
 	private String serveType;
 
+	private String courseIds;
+
+	public StudentExtracurricularExercisesSituation() {
+	}
+
+	public StudentExtracurricularExercisesSituation(Integer studentId, Integer teacherId, Integer weekOfYear, Date monday, Date sunday,  String serveType, String courseIds) {
+		this.studentId = studentId;
+		this.weekOfYear = weekOfYear;
+		this.monday = monday;
+		this.sunday = sunday;
+		this.teacherId = teacherId;
+		this.serveType = serveType;
+		this.courseIds = courseIds;
+		this.expectExercisesNum = 1;
+		this.actualExercisesNum = 0;
+		this.exercisesReplyNum = 0;
+		this.exercisesMessageNum = 0;
+		this.exercisesMessageTimelyNum = 0;
+	}
+
+	public String getCourseIds() {
+		return courseIds;
+	}
+
+	public void setCourseIds(String courseIds) {
+		this.courseIds = courseIds;
+	}
+
 	public String getServeType() {
 		return serveType;
 	}

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java

@@ -185,4 +185,22 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherAttendanceDto>
      */
     List<TeacherAttendancesDto> getCourseTeachers(Long courseScheduleId);
+
+    /**
+     * @describe 工资奖金标记
+     * @author Joburgess
+     * @date 2020/12/25 0025
+     * @return void
+     */
+    void salaryMark();
+
+    /**
+     * @describe 组合工资,使其最接近给定的金额
+     * @author Joburgess
+     * @date 2020/12/25 0025
+     * @param salaries:
+     * @param targetSalary:
+     * @return void
+     */
+    List<BigDecimal> salaryComposition(List<BigDecimal> salaries, BigDecimal targetSalary);
 }

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

@@ -16,6 +16,8 @@ public interface ExtracurricularExercisesMessageService extends BaseService<Long
      */
     void addStudentExtraExerciseComment(ExtracurricularExercisesMessage extracurricularExercisesMessage);
 
+
+
     /**
      * @describe 获取学生课外作业评论列表
      * @author Joburgess

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

@@ -17,6 +17,8 @@ public interface StudentServeService {
      */
     void exercisesSituationStatistics(String monday);
 
+    void exercisesSituationStatistics2(String monday);
+
     /**
      * @describe
      * @author Joburgess

+ 48 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -1298,4 +1298,52 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         }
         return result;
     }
+
+    @Override
+    public void salaryMark() {
+
+    }
+
+    @Override
+    public List<BigDecimal> salaryComposition(List<BigDecimal> salaries, BigDecimal targetSalary) {
+        int target = targetSalary.intValue();
+        BigDecimal zero = new BigDecimal(0);
+
+        List<List<List<BigDecimal>>> result = new LinkedList<>();
+        for(int j=0;j<2;j++){
+            result.add(new ArrayList<>());
+            for(int i=0;i<target+1;i++){
+                List<List<BigDecimal>> t=new ArrayList<>();
+                List<BigDecimal> b = new ArrayList<BigDecimal>();
+                b.add(zero);
+                t.add(b);
+                result.get(j).addAll(t);
+            }
+        }
+
+        int salary_index_pre = 0;
+        int salary_index_cur = 1;
+
+        for(int i=1;i<salaries.size()+1;i++){
+            for(int j = 1;j<target+1;j++){
+                if(j<salaries.get(i-1).intValue()){
+                    result.get(salary_index_cur).get(j).clear();
+                    result.get(salary_index_cur).get(j).addAll(result.get(salary_index_pre).get(j));
+                }else{
+                    BigDecimal pre = result.get(salary_index_pre).get(j).stream().reduce(BigDecimal.ZERO, BigDecimal::add);
+                    BigDecimal t = result.get(salary_index_pre).get(j-salaries.get(i-1).intValue()).stream().reduce(BigDecimal.ZERO, BigDecimal::add).add(salaries.get(i-1));
+                    if(t.compareTo(pre)>0){
+                        result.get(salary_index_cur).get(j).clear();
+                        result.get(salary_index_cur).get(j).addAll(result.get(salary_index_pre).get(j-salaries.get(i-1).intValue()));
+                        result.get(salary_index_cur).get(j).add(salaries.get(i-1));
+                    }else{
+                        result.get(salary_index_cur).get(j).clear();
+                        result.get(salary_index_cur).get(j).addAll(result.get(salary_index_pre).get(j));
+                    }
+                }
+            }
+            Collections.swap(result, 0, 1);
+        }
+        return result.get(0).get(target);
+    }
 }

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

@@ -278,6 +278,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
         teacherAttendance.setSignOutStatus(isInScore?YesOrNoEnum.YES:YesOrNoEnum.NO);
         teacherAttendance.setCurrentClassTimes(classTimes + 1);
         teacherAttendance.setRemark(studentAttendanceInfos.getRemark());
+        teacherAttendance.setSignOutAttachments(studentAttendanceInfos.getSignOutAttachments());
         if (Objects.nonNull(teacherAttendance.getId())) {
             teacherAttendanceDao.update(teacherAttendance);
         } else {

+ 136 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -288,6 +288,142 @@ public class StudentServeServiceImpl implements StudentServeService {
     }
 
     @Override
+    public void exercisesSituationStatistics2(String monday) {
+        LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
+        LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+        LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+        Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
+
+        List<StudentServeCourseDto> studentFutureCourseInfo = studentDao.getStudentFutureCourseInfo(monDayDate.toString());
+        Map<Integer, List<StudentServeCourseDto>> studentCourseMap = studentFutureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
+
+        List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
+
+        for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
+            Map<CourseSchedule.CourseScheduleType, List<StudentServeCourseDto>> typeCourseMap = studentCourseMapEntry.getValue().stream().collect(Collectors.groupingBy(StudentServeCourseDto::getType));
+
+            if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.SINGLE)){
+                List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE);
+                List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
+                if(CollectionUtils.isEmpty(weekCourseInfo)){
+                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                            "EXERCISE", null);
+                    results.add(studentExtracurricularExercisesSituation);
+                }else{
+                    Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
+                    Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
+                    for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                        StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
+                        if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
+                            teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
+                        }
+                        teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
+                    }
+                    for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
+                        studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
+                }
+            }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.VIP)){
+                List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP);
+                List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP).stream().filter(c -> TeachModeEnum.ONLINE.equals(c.getTeachMode()) && c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
+                if(CollectionUtils.isEmpty(weekCourseInfo)){
+                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                            "EXERCISE", null);
+                    results.add(studentExtracurricularExercisesSituation);
+                }else{
+                    Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
+                    Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
+                    for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                        StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
+                        if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
+                            teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
+                        }else{
+                            continue;
+                        }
+                        teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
+                    }
+                    for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
+                        studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
+                }
+            }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.MIX)){
+                List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.MIX);
+                List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.MIX).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
+                if(CollectionUtils.isEmpty(weekCourseInfo)){
+                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                            "EXERCISE", null);
+                    results.add(studentExtracurricularExercisesSituation);
+                }else{
+                    Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
+                    Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
+                    for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                        StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
+                        if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
+                            teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
+                        }
+                        teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
+                    }
+                    for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
+                        studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
+                }
+            }else if(typeCourseMap.containsKey(CourseSchedule.CourseScheduleType.PRACTICE)){
+                List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE);
+                List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
+                if(CollectionUtils.isEmpty(weekCourseInfo)){
+                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                            "EXERCISE", null);
+                    results.add(studentExtracurricularExercisesSituation);
+                }else{
+                    Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
+                    Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
+                    for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                        StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
+                        if(!teacherServiceCourseIdMap.containsKey(courseInfo.getActualTeacherId())){
+                            teacherServiceCourseIdMap.put(courseInfo.getActualTeacherId(), new HashSet<>());
+                        }
+                        teacherServiceCourseIdMap.get(courseInfo.getActualTeacherId()).add(courseInfo.getCourseScheduleId());
+                    }
+                    for (Map.Entry<Integer, Set<Long>> teacherServiceCourseIdMapEntry : teacherServiceCourseIdMap.entrySet()) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherServiceCourseIdMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", StringUtils.join(teacherServiceCourseIdMapEntry.getValue(), ","));
+                        studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherServiceCourseIdMapEntry.getValue().size());
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
+                }
+            }else{
+                continue;
+            }
+        }
+
+    }
+
+    @Override
     public Map<String, Object> checkeIsAssignHomework(Long courseScheduleId, String studentIdsStr) {
         Map<String, Object> result=new HashMap<>();
         if(Objects.isNull(courseScheduleId)&&Objects.isNull(studentIdsStr)){

+ 17 - 4
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -22,6 +22,7 @@
 		<result column="update_time_" property="updateTime" />
 		<result column="last_submit_time_" property="lastSubmitTime"/>
 		<result column="serve_type_" property="serveType"/>
+		<result column="course_ids_" property="courseIds"/>
 	</resultMap>
 
 	<resultMap id="StudentExercisesSituationDto" type="com.ym.mec.biz.dal.dto.StudentExercisesSituationDto" extends="StudentExtracurricularExercisesSituation">
@@ -48,15 +49,24 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO student_extracurricular_exercises_situation_ (id_,student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,actual_exercises_num_,exercises_reply_num_,exercises_message_num_,exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,serve_type_)
-		VALUES(#{id},#{studentId},#{weekOfYear},#{monday},#{sunday},#{teacherId},#{expectExercisesNum},#{actualExercisesNum},#{exercisesReplyNum},#{exercisesMessageNum},#{exercisesMessageTimelyNum},NOW(),NOW(),#{lastSubmitTime},#{serveType})
+		INSERT INTO student_extracurricular_exercises_situation_ (id_,student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,
+		                                                          actual_exercises_num_,exercises_reply_num_,exercises_message_num_,
+		                                                          exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,
+		                                                          serve_type_,course_ids_)
+		VALUES(#{id},#{studentId},#{weekOfYear},#{monday},#{sunday},#{teacherId},#{expectExercisesNum},#{actualExercisesNum},#{exercisesReplyNum},
+		       #{exercisesMessageNum},#{exercisesMessageTimelyNum},NOW(),NOW(),#{lastSubmitTime},#{serveType},#{courseIds})
 	</insert>
 
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO student_extracurricular_exercises_situation_ (student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,actual_exercises_num_,exercises_reply_num_,exercises_message_num_,exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,serve_type_)
+		INSERT INTO student_extracurricular_exercises_situation_ (student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,
+		                                                          actual_exercises_num_,exercises_reply_num_,exercises_message_num_,
+		                                                          exercises_message_timely_num_,create_time_,update_time_,last_submit_time_,
+		                                                          serve_type_,course_ids_)
 		VALUES
 		<foreach collection="situations" item="situation" separator=",">
-			(#{situation.studentId},#{situation.weekOfYear},#{situation.monday},#{situation.sunday},#{situation.teacherId},#{situation.expectExercisesNum},#{situation.actualExercisesNum},#{situation.exercisesReplyNum},#{situation.exercisesMessageNum},#{situation.exercisesMessageTimelyNum},NOW(),NOW(),#{situation.lastSubmitTime},#{situation.serveType})
+			(#{situation.studentId},#{situation.weekOfYear},#{situation.monday},#{situation.sunday},#{situation.teacherId},#{situation.expectExercisesNum},
+			#{situation.actualExercisesNum},#{situation.exercisesReplyNum},#{situation.exercisesMessageNum},#{situation.exercisesMessageTimelyNum},
+			NOW(),NOW(),#{situation.lastSubmitTime},#{situation.serveType},#{situation.courseIds})
 		</foreach>
 	</insert>
 
@@ -106,6 +116,9 @@
 			<if test="serveType!=null">
 				serve_type_=#{serveType},
 			</if>
+			<if test="courseIds!=null and courseIds!=''">
+				course_ids_=#{courseIds},
+			</if>
 			update_time_ = #{updateTime}
 		</set> WHERE id_ = #{id}
 	</update>

+ 28 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -471,6 +471,34 @@
         WHERE stu.service_tag_=1 AND class_date_&gt;=#{monday}
     </select>
 
+    <resultMap id="StudentServeCourseDto" type="com.ym.mec.biz.dal.dto.StudentServeCourseDto">
+        <result column="student_id_" property="studentId"/>
+        <result column="course_schedule_id_" property="courseScheduleId"/>
+        <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="actual_teacher_id_" property="actualTeacherId"/>
+        <result column="course_start_time_" property="courseStartTime"/>
+        <result column="" property="teachMode"/>
+    </resultMap>
+
+    <select id="getStudentFutureCourseInfo" resultMap="StudentServeCourseDto">
+        SELECT
+            cssp.user_id_ student_id_,
+            cs.id_ course_schedule_id_,
+            cs.group_type_,
+            cs.music_group_id_,
+            cs.type_,
+            cs.actual_teacher_id_,
+            CONCAT(cs.class_date_, ' ', cs.start_class_time_) course_start_time_,
+            cs.teach_mode_
+        FROM course_schedule_student_payment cssp
+                 LEFT JOIN course_schedule cs ON cssp.course_schedule_id_=cs.id_
+        WHERE cs.class_date_&gt;=#{monday}
+          AND cs.type_ IN ('SINGLE','VIP','MIX','PRACTICE')
+        ORDER BY cssp.user_id_,start_class_time_
+    </select>
+
     <select id="getStudentNames" resultType="string">
         SELECT username_ FROM sys_user WHERE id_ IN
         <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">