|
@@ -328,6 +328,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
|
|
|
|
|
|
for (Integer studentId : studentIds) {
|
|
|
+ List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetails = null;
|
|
|
for (int i = 0; i < courseSchedules.size(); i++) {
|
|
|
CourseSchedule courseSchedule = courseSchedules.get(i);
|
|
|
//优先处理之前的剩余课程
|
|
@@ -353,7 +354,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
}
|
|
|
}
|
|
|
//处理缴费的排课信息
|
|
|
- List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetails = musicGroupPaymentStudentCourseDetailDao.getUnUseWithStudentAndCourseTypeAndCourseMinutes(batchNo, studentId,courseSchedule.getType());
|
|
|
+ if(musicGroupPaymentStudentCourseDetails == null){
|
|
|
+ musicGroupPaymentStudentCourseDetails = musicGroupPaymentStudentCourseDetailDao.getUnUseWithStudentAndCourseTypeAndCourseMinutes(batchNo, studentId,courseSchedule.getType());
|
|
|
+ }
|
|
|
if(musicGroupPaymentStudentCourseDetails == null || musicGroupPaymentStudentCourseDetails.size() == 0){
|
|
|
throw new BizException("学员缴费详情获取失败");
|
|
|
}
|
|
@@ -388,9 +391,11 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
if(typeCourseDuration > musicGroupPaymentStudentCourseDetail.getTotalCourseMinutes()){
|
|
|
musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(musicGroupPaymentStudentCourseDetail.getTotalCourseMinutes());
|
|
|
}else{
|
|
|
- musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(typeCourseDuration);
|
|
|
+ musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(musicGroupPaymentStudentCourseDetail.getUsedCourseMinutes() + typeCourseDuration);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ if(musicGroupPaymentStudentCourseDetails != null && musicGroupPaymentStudentCourseDetails.size() > 0){
|
|
|
musicGroupPaymentStudentCourseDetailDao.batchUpdate(musicGroupPaymentStudentCourseDetails);
|
|
|
}
|
|
|
}
|