|
@@ -1387,6 +1387,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
studentPauseInfo.setMusicGroupId(vipGroup.getId().intValue());
|
|
|
studentPauseInfo.setClassGroupId(classGroup.getId());
|
|
|
studentPauseInfo.setCoursesJson(JSON.toJSONString(pauseInfos));
|
|
|
+ studentPauseInfo.setSurplusCourseNum(userSurplusCourseInfoByGroup.size());
|
|
|
|
|
|
studentPauseInfoDao.insert(studentPauseInfo);
|
|
|
|
|
@@ -1462,7 +1463,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Collections.reverse(coursePrices);
|
|
|
|
|
|
if(vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)){
|
|
|
- studentRecoverInfo.setCourseCount(teachModeSequence.length);
|
|
|
+ List<StudentPauseInfo> studentPauseInfos=studentPauseInfoDao.findByGroup(GroupType.VIP, vipGroup.getId().toString());
|
|
|
+ StudentPauseInfo studentPauseInfo1 = studentPauseInfos.stream().min(Comparator.comparing(StudentPauseInfo::getSurplusCourseNum)).get();
|
|
|
+ Map<String, Object> courseInfo1 = JSON.parseObject(studentPauseInfo1.getCoursesJson(), Map.class);
|
|
|
+ Integer[] teachModeSequence1=JSON.parseArray(courseInfo1.get("teaChModeSequence").toString(), Integer.class).stream().toArray(Integer[]::new);
|
|
|
+ studentRecoverInfo.setCourseCount(teachModeSequence1.length);
|
|
|
List<CourseSchedule> newCourseSchedules = courseScheduleService.createCourses(studentRecoverInfo);
|
|
|
for(int i=0;i<newCourseSchedules.size();i++){
|
|
|
newCourseSchedules.get(i).setGroupType(GroupType.VIP);
|
|
@@ -1473,7 +1478,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
newCourseSchedules.get(i).setActualTeacherId(vipGroup.getUserId());
|
|
|
newCourseSchedules.get(i).setTeacherId(vipGroup.getUserId());
|
|
|
newCourseSchedules.get(i).setType(CourseSchedule.CourseScheduleType.VIP);
|
|
|
- newCourseSchedules.get(i).setTeachMode(teachModeSequence[i]==0?TeachModeEnum.OFFLINE:TeachModeEnum.ONLINE);
|
|
|
+ newCourseSchedules.get(i).setTeachMode(teachModeSequence1[i]==0?TeachModeEnum.OFFLINE:TeachModeEnum.ONLINE);
|
|
|
}
|
|
|
courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
|
|
|
|