Explorar el Código

提高班添加跳过节假日

周箭河 hace 5 años
padre
commit
c0bcb7b61b

+ 22 - 19
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -32,6 +32,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
 
     /**
      * 删除学生对应的课程
+     *
      * @param userId
      * @param courseScheduleList
      * @return
@@ -39,73 +40,75 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     int deleteStudentCourseSchedule(@Param("userId") Integer userId, @Param("courseScheduleList") List<CourseSchedule> courseScheduleList);
 
     /**
+     * @param courseScheduleIds: 课程编号列表
+     * @return int
      * @describe 批量删除课程对应的学生缴费记录
      * @author Joburgess
      * @date 2019/10/31
-     * @param courseScheduleIds: 课程编号列表
-     * @return int
      */
     int deleteByCourseSchedule(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
     /**
+     * @param params: 班级编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentAttendanceStatisticsResp>
      * @describe 获取指定班级中的学生
      * @author Joburgess
      * @date 2019/10/28
-     * @param params: 班级编号
-     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentAttendanceStatisticsResp>
      */
-    List<StudentAttendanceStatisticsResponse> findStudentByClassGroup(Map<String,Object> params);
-    int countStudentByClassGroup(Map<String,Object> params);
+    List<StudentAttendanceStatisticsResponse> findStudentByClassGroup(Map<String, Object> params);
+
+    int countStudentByClassGroup(Map<String, Object> params);
 
     /**
+     * @param classGroupId: 班级编号
+     * @param userId:       学生编号
+     * @return java.math.BigDecimal
      * @describe 统计学生剩余课时的费用
      * @author Joburgess
      * @date 2019/11/15
-     * @param classGroupId: 班级编号
-     * @param userId: 学生编号
-     * @return java.math.BigDecimal
      */
     BigDecimal countSurplusCourseFee(@Param("classGroupId") Integer classGroupId,
                                      @Param("userId") Integer userId);
 
     /**
+     * @param classGroupId: 班级编号
+     * @return java.math.BigDecimal
      * @describe 统计所有课时的购买费用
      * @author Joburgess
      * @date 2019/11/27
-     * @param classGroupId: 班级编号
-     * @return java.math.BigDecimal
      */
     BigDecimal countAllCourseFee(@Param("classGroupId") Integer classGroupId);
 
     /**
+     * @param ids: 学生课程缴费信息编号
+     * @return int
      * @describe 删除用户在指定班级上的课程
      * @author Joburgess
      * @date 2019/12/3
-     * @param ids: 学生课程缴费信息编号
-     * @return int
      */
     int batchDeleteWithID(@Param("ids") List<Integer> ids);
 
     /**
-     * @describe 获取用户在指定班级上缴费记录编号
-     * @author Joburgess
-     * @date 2019/12/3
      * @param classGroupId:
      * @param userId:
      * @return java.util.List<java.lang.Integer>
+     * @describe 获取用户在指定班级上缴费记录编号
+     * @author Joburgess
+     * @date 2019/12/3
      */
     List<Integer> findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(@Param("classGroupId") Integer classGroupId,
                                                                               @Param("userId") Integer userId);
 
     /**
+     * @param vipGroupId: 小课编号
+     * @param teachMode:  教学形式
+     * @return java.math.BigDecimal
      * @describe 获取小课指定形式下最后一节课的课程单价
      * @author Joburgess
      * @date 2019/12/5
-     * @param vipGroupId: 小课编号
-     * @param teachMode: 教学形式
-     * @return java.math.BigDecimal
      */
     BigDecimal findVipGroupCoursePrice(@Param("vipGroupId") Integer vipGroupId,
                                        @Param("teachMode") String teachMode);
 
+    int deleteStudentCourseScheduleByUserId(@Param("courseScheduleId") Long courseScheduleId, @Param("userIdList") List<Integer> userIdList);
 }

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

@@ -684,7 +684,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		//学生冲突删除学生课程
 		if(courseScheduleStudents.size()>0){
-			courseScheduleStudentPaymentDao.deleteByCourseSchedule(courseScheduleIds);
+			for (CourseScheduleStudentDto courseScheduleStudent : courseScheduleStudents) {
+				courseScheduleStudentPaymentDao.deleteStudentCourseScheduleByUserId(courseScheduleStudent.getId(),courseScheduleStudent.getStudentIds());
+			}
 		}
 		return courseScheduleIds;
 	}

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

@@ -198,4 +198,10 @@
 			#{id}
 		</foreach>
     </delete>
+	<delete id="deleteStudentCourseScheduleByUserId">
+		DELETE FROM course_schedule_student_payment WHERE course_schedule_id_ = #{courseScheduleId} AND user_id_  IN
+		<foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
+			#{userId}
+		</foreach>
+	</delete>
 </mapper>