|
@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.TeachModeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.VipGroupActivityTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
|
|
@@ -165,13 +166,32 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
return;
|
|
|
}
|
|
|
studentsWithClassGroup.forEach(classGroupStudent->{
|
|
|
+ VipGroup vipGroup=null;
|
|
|
+ if(classGroupStudent.getGroupType().equals(GroupType.VIP)){
|
|
|
+ vipGroup=vipGroupDao.get(Long.valueOf(classGroupStudent.getMusicGroupId()));
|
|
|
+ }
|
|
|
for (CourseSchedule courseSchedule : courseSchedulesByClassGroup) {
|
|
|
int i = courseScheduleStudentPaymentDao.checkStudentHaveCourse(courseSchedule.getId(), classGroupStudent.getUserId());
|
|
|
if(i>0){
|
|
|
continue;
|
|
|
}
|
|
|
if(courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.VIP)){
|
|
|
-
|
|
|
+ CourseScheduleStudentPayment courseScheduleStudentPayment=new CourseScheduleStudentPayment(
|
|
|
+ courseSchedule.getId(),
|
|
|
+ classGroupStudent.getUserId(),
|
|
|
+ courseSchedule.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice(),
|
|
|
+ courseSchedule.getClassGroupId()
|
|
|
+ );
|
|
|
+ courseScheduleStudentPayment.setGroupType(classGroupStudent.getGroupType());
|
|
|
+ courseScheduleStudentPayment.setMusicGroupId(classGroupStudent.getMusicGroupId());
|
|
|
+ List<CourseScheduleStudentPayment> otherPayments = courseScheduleStudentPaymentDao.findByCourseSchedule(courseSchedule.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(otherPayments)){
|
|
|
+ courseScheduleStudentPayment.setExpectPrice(otherPayments.get(0).getExpectPrice());
|
|
|
+ }
|
|
|
+ if(Objects.isNull(courseScheduleStudentPayment.getExpectPrice())){
|
|
|
+ courseScheduleStudentPayment.setExpectPrice(zeroPrice);
|
|
|
+ }
|
|
|
+ courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
|
}else{
|
|
|
CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment(
|
|
|
courseSchedule.getId(),
|