Explorar o código

1、课外训练-教学

Joburgess %!s(int64=5) %!d(string=hai) anos
pai
achega
9714f10bee

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

@@ -245,4 +245,6 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return java.util.List<java.lang.Integer>
      */
     List<Integer> findNoPracticeStudentIdsAfterStartTime(@Param("date")String date);
+
+    Integer findNoPracticeStudentTeacherId(@Param("studentId") Integer studentId);
 }

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

@@ -198,6 +198,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 		for (Integer noPracticeStudentId : noPracticeStudentIds) {
 			StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation();
 			studentExtracurricularExercisesSituation.setStudentId(noPracticeStudentId);
+			studentExtracurricularExercisesSituation.setTeacherId(courseScheduleStudentPaymentDao.findNoPracticeStudentTeacherId(noPracticeStudentId));
 			studentExtracurricularExercisesSituation.setExpectExercisesNum(1);
 			studentExtracurricularExercisesSituation.setWeekOfYear(nowDate.get(DateUtil.weekFields.weekOfYear()));
 			studentExtracurricularExercisesSituation.setMonday(DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"));

+ 8 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -313,8 +313,15 @@
 		GROUP BY cssp.user_id_
 		HAVING MAX(cs.class_date_)&lt;#{date} ORDER BY cssp.user_id_
 	</select>
+	<select id="findNoPracticeStudentTeacherId" resultType="java.lang.Integer">
+		SELECT cs.actual_teacher_id_
+		FROM course_schedule_student_payment cssp
+		LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
+		WHERE cssp.user_id_=#{studentId}
+		ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) LIMIT 1;
+	</select>
 
-    <delete id="deleteStudentCourseSchedule">
+	<delete id="deleteStudentCourseSchedule">
 		DELETE FROM course_schedule_student_payment WHERE user_id_ = #{userId} AND course_schedule_id_ IN
 		<foreach collection="courseScheduleList" item="courseSchedule" index="index" open="(" close=")" separator=",">
 			#{courseSchedule.id}