|
@@ -577,8 +577,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
Map<String, String> vipStuNames = MapUtil.convertIntegerMap(classGroupDao.findVipStuNames(StringUtils.join(vipIds, ",")));
|
|
|
//获取学员的乐团列表详情
|
|
|
List<CourseListDto> musicCourse = classGroupDao.queryStudentMusicGroupCourses(StringUtils.join(musicGroupIds, ","), userId);
|
|
|
+ //获取学员购买的陪练课列表
|
|
|
+ List<CourseListDto> practiceCourse = classGroupDao.queryStudentPracticeCourses(StringUtils.join(musicGroupIds, ","));
|
|
|
+
|
|
|
Set<String> musicGroupId = musicCourse.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
Set<String> vipGroupId = vipCourses.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
+ Set<String> practiceGroupId = practiceCourse.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
+
|
|
|
Map<String,Long> musicCourseNumMap = new HashMap<>();
|
|
|
if(musicGroupId != null && musicGroupId.size() > 0){
|
|
|
musicCourseNumMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.findStudentCourseNum(musicGroupId,userId,"MUSIC"));
|
|
@@ -587,8 +592,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
if(vipGroupId != null && vipGroupId.size() > 0){
|
|
|
vipCourseNumMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.findStudentCourseNum(vipGroupId,userId,"VIP"));
|
|
|
}
|
|
|
+ Map<String,Long> practiceCourseNumMap = new HashMap<>();
|
|
|
+ if(vipGroupId != null && vipGroupId.size() > 0){
|
|
|
+ practiceCourseNumMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.findStudentCourseNum(practiceGroupId,userId,"PRACTICE"));
|
|
|
+ }
|
|
|
courseListDtos.addAll(musicCourse);
|
|
|
courseListDtos.addAll(vipCourses);
|
|
|
+ courseListDtos.addAll(practiceCourse);
|
|
|
//检测对应乐团是否已申请退费
|
|
|
List<Map<String, Integer>> isApplyMaps;
|
|
|
if (musicGroupIds != null && musicGroupIds.size() > 0) {
|
|
@@ -603,13 +613,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
|
|
|
Long classTimes = null;
|
|
|
for (CourseListDto e:courseListDtos) {
|
|
|
- if(StringUtils.isEmpty(e.getMusicId())){
|
|
|
- classTimes = vipCourseNumMap.get(e.getVipId());
|
|
|
- e.setSurplusClassTimes(classTimes == null?0:classTimes.intValue());
|
|
|
- }else {
|
|
|
+ if(StringUtils.isNotEmpty(e.getMusicId())){
|
|
|
classTimes = musicCourseNumMap.get(e.getMusicId());
|
|
|
- e.setSurplusClassTimes(classTimes == null?0:classTimes.intValue());
|
|
|
+ }else if(StringUtils.isNotEmpty(e.getVipId())){
|
|
|
+ classTimes = vipCourseNumMap.get(e.getVipId());
|
|
|
+ }else if(StringUtils.isNotEmpty(e.getPracticeId())){
|
|
|
+ classTimes = practiceCourseNumMap.get(e.getPracticeId());
|
|
|
}
|
|
|
+ e.setSurplusClassTimes(classTimes == null?0:classTimes.intValue());
|
|
|
+
|
|
|
e.setAddress(schoolNames.get(e.getTeacherSchoolId()));
|
|
|
e.setIsApply(isApplyMap.get(e.getMusicGroupId()));
|
|
|
if (ClassGroupTypeEnum.VIP == e.getType()) {
|
|
@@ -860,6 +872,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
case "MUSIC_GROUP":
|
|
|
teacherMusicClassGroup = classGroupDao.findTeacherMusicClassGroup(user.getId().longValue());
|
|
|
break;
|
|
|
+ case "PRACTICE":
|
|
|
+ teacherMusicClassGroup = classGroupDao.findTeacherPracticeClassGroup(user.getId().longValue());
|
|
|
+ break;
|
|
|
default:
|
|
|
throw new BizException("课程类型错误");
|
|
|
}
|