|
@@ -496,6 +496,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("教学模式错误");
|
|
throw new BizException("教学模式错误");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
|
|
|
|
+ List<VipGroupCategory> vipGroupCategories = vipGroupCategoryDao.findAllByOrgan(vipGroup.getVipGroupApplyBaseInfo().getOrganId().toString());
|
|
|
|
+ VipGroupCategory vipGroupCategory = vipGroupCategories.stream().filter(v -> v.getName().equals("1v2")).findFirst().get();
|
|
|
|
+ vipGroup.getVipGroupApplyBaseInfo().setVipGroupCategoryId(vipGroupCategory.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
if((Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()!=0)
|
|
if((Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()!=0)
|
|
||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&(courseScheduleGroup.get(TeachModeEnum.OFFLINE).size()<vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()))){
|
|
||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&(courseScheduleGroup.get(TeachModeEnum.OFFLINE).size()<vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()))){
|
|
throw new BizException("线下课课时数量安排有误");
|
|
throw new BizException("线下课课时数量安排有误");
|
|
@@ -535,7 +541,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("{}暂无排课资格", studentInfo.getNickName());
|
|
throw new BizException("{}暂无排课资格", studentInfo.getNickName());
|
|
}
|
|
}
|
|
courseDetail.fluentPut(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType().getCode(), surplusTimes-1);
|
|
courseDetail.fluentPut(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType().getCode(), surplusTimes-1);
|
|
|
|
+ student.setActivityCourseDetail(courseDetail.toJSONString());
|
|
}
|
|
}
|
|
|
|
+ studentDao.batchUpdate(studentDetail);
|
|
|
|
|
|
Date now=new Date();
|
|
Date now=new Date();
|
|
|
|
|
|
@@ -560,6 +568,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("开课时间不能小于当前时间");
|
|
throw new BizException("开课时间不能小于当前时间");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ vipGroupApplyBaseInfoDto.setRegistrationStartTime(now);
|
|
|
|
+ vipGroupApplyBaseInfoDto.setPaymentExpireDate(now);
|
|
|
|
+
|
|
if(vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())){
|
|
if(vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())){
|
|
throw new BizException("报名开始时间必须在报名截至时间之前");
|
|
throw new BizException("报名开始时间必须在报名截至时间之前");
|
|
}
|
|
}
|
|
@@ -622,7 +633,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
//生成vip课信息
|
|
//生成vip课信息
|
|
List<String> bySubIds = subjectDao.findBySubIds(vipGroupApplyBaseInfoDto.getSubjectIdList());
|
|
List<String> bySubIds = subjectDao.findBySubIds(vipGroupApplyBaseInfoDto.getSubjectIdList());
|
|
StringBuffer className=new StringBuffer();
|
|
StringBuffer className=new StringBuffer();
|
|
- if(vipGroupApplyBaseInfoDto.getFreeCourse()){
|
|
|
|
|
|
+ if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
|
|
className.append("考前辅导课•");
|
|
className.append("考前辅导课•");
|
|
}else if(Objects.isNull(vipGroupCategory.getMusicTheory())||!vipGroupCategory.getMusicTheory()){
|
|
}else if(Objects.isNull(vipGroupCategory.getMusicTheory())||!vipGroupCategory.getMusicTheory()){
|
|
className.append(StringUtils.join(bySubIds,","));
|
|
className.append(StringUtils.join(bySubIds,","));
|
|
@@ -634,7 +645,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
vipGroupApplyBaseInfoDto.setName(className.toString());
|
|
vipGroupApplyBaseInfoDto.setName(className.toString());
|
|
|
|
|
|
|
|
|
|
- if(!vipGroupApplyBaseInfoDto.getFreeCourse()){
|
|
|
|
|
|
+ if(!ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
|
|
//计算课程相关费用信息
|
|
//计算课程相关费用信息
|
|
Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
|
|
Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
|
|
vipGroupApplyBaseInfoDto.getUserId(), null);
|
|
vipGroupApplyBaseInfoDto.getUserId(), null);
|
|
@@ -752,7 +763,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
List<CourseSchedule> courseSchedules = vipGroup.getCourseSchedules();
|
|
List<CourseSchedule> courseSchedules = vipGroup.getCourseSchedules();
|
|
courseScheduleService.batchAddCourseSchedule(courseSchedules);
|
|
courseScheduleService.batchAddCourseSchedule(courseSchedules);
|
|
//创建老师单节课课酬信息
|
|
//创建老师单节课课酬信息
|
|
- if(vipGroupApplyBaseInfoDto.getFreeCourse()){
|
|
|
|
|
|
+ if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
BigDecimal teacherDefaultSalary = new BigDecimal("16.67");
|
|
BigDecimal teacherDefaultSalary = new BigDecimal("16.67");
|
|
SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
|
|
SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
|
|
@@ -806,7 +817,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
userRoleMap.put(vipGroupApplyBaseInfoDto.getUserId(),"指导老师");
|
|
userRoleMap.put(vipGroupApplyBaseInfoDto.getUserId(),"指导老师");
|
|
//生成学生单课缴费信息
|
|
//生成学生单课缴费信息
|
|
for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
|
|
for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
|
|
- if(vipGroupApplyBaseInfoDto.getFreeCourse()){
|
|
|
|
|
|
+ if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
|
|
for (Integer studentId : studentIdList) {
|
|
for (Integer studentId : studentIdList) {
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
@@ -1029,7 +1040,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
vipGroupApplyBaseInfoDto.setOnlineClassesNum(onlineCourseNum);
|
|
vipGroupApplyBaseInfoDto.setOnlineClassesNum(onlineCourseNum);
|
|
vipGroupApplyBaseInfoDto.setOfflineClassesNum(offlineCourseNum);
|
|
vipGroupApplyBaseInfoDto.setOfflineClassesNum(offlineCourseNum);
|
|
vipGroupApplyBaseInfoDto.setVipGroupCategoryId(vipGroupCategory.getId());
|
|
vipGroupApplyBaseInfoDto.setVipGroupCategoryId(vipGroupCategory.getId());
|
|
- vipGroupApplyBaseInfoDto.setFreeCourse(freeCourse);
|
|
|
|
|
|
+ if(freeCourse){
|
|
|
|
+ vipGroupApplyBaseInfoDto.setActivityCourseType(ActivityCourseType.FREE_VIP);
|
|
|
|
+ }
|
|
if(Objects.nonNull(vipGroupActivity)){
|
|
if(Objects.nonNull(vipGroupActivity)){
|
|
vipGroupApplyBaseInfoDto.setVipGroupActivityId(vipGroupActivity.getId());
|
|
vipGroupApplyBaseInfoDto.setVipGroupActivityId(vipGroupActivity.getId());
|
|
}
|
|
}
|