|
@@ -700,20 +700,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
throw new BizException("未找到用户分部属性");
|
|
|
}
|
|
|
|
|
|
- //如果是广州分部的,并且声部满足条件的需要特殊处理
|
|
|
- if (sysUser.getOrganId().equals(GUANGZHOU_ORGAN_ID) && GUANGZHOU_SUBJECTIDS.contains(subjectId)) {
|
|
|
- List<MusicGroup> userMusicGroups = musicGroupDao.findUserMusicGroups(userId);
|
|
|
- if (!CollectionUtils.isEmpty(userMusicGroups)) {
|
|
|
- Collections.shuffle(userMusicGroups);
|
|
|
- Integer schoolId = userMusicGroups.get(0).getSchoolId();
|
|
|
- if (schoolSubjectTeachersMap.containsKey(schoolId)) {
|
|
|
- List<Integer> teacherIds = schoolSubjectTeachersMap.get(schoolId).get(subjectId);
|
|
|
- if (!CollectionUtils.isEmpty(teacherIds)) {
|
|
|
- return teacherDao.findSimpleTeachers(teacherIds);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (sysUser.getOrganId().equals(DALIAN_ORGAN_ID)) {
|
|
|
+ if (sysUser.getOrganId().equals(DALIAN_ORGAN_ID)) {
|
|
|
sysUser.setOrganId(SHENYANG_ORGAN_ID);
|
|
|
}
|
|
|
|
|
@@ -1808,7 +1795,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
|
|
|
Subject subject = subjectDao.get(practiceGroup.getSubjectId());
|
|
|
if (Objects.isNull(subject)) {
|
|
|
- result.put("status", "DISABLE_SUBJECT");
|
|
|
+ result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
result.put("info", "预约失败,声部选择错误,请重试。");
|
|
|
return result;
|
|
|
}
|
|
@@ -1817,28 +1804,36 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date sunday1 = DateUtil.getWeekDayWithDate(allCourseDates.get(0), Calendar.SUNDAY);
|
|
|
int tp1 = courseScheduleDao.countTeacherPracticeCourse(practiceGroup.getUserId(), monday1, sunday1);
|
|
|
if(tp1>=80){
|
|
|
- throw new BizException("该老师的课程已预约满");
|
|
|
+ result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
+ result.put("info", "抱歉啦,当前所选时段组合,「" + teacher.getRealName() +"」老师已被预约,请重新选择时段或更换老师后重试。");
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
Date monday2 = DateUtil.getWeekDayWithDate(allCourseDates.get(1), Calendar.MONDAY);
|
|
|
Date sunday2 = DateUtil.getWeekDayWithDate(allCourseDates.get(1), Calendar.SUNDAY);
|
|
|
int tp2 = courseScheduleDao.countTeacherPracticeCourse(practiceGroup.getUserId(), monday2, sunday2);
|
|
|
if(tp2>=80){
|
|
|
- throw new BizException("该老师的课程已预约满");
|
|
|
+ result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
+ result.put("info", "抱歉啦,当前所选时段组合,「" + teacher.getRealName() +"」老师已被预约,请重新选择时段或更换老师后重试。");
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
Date monday3 = DateUtil.getWeekDayWithDate(allCourseDates.get(2), Calendar.MONDAY);
|
|
|
Date sunday3 = DateUtil.getWeekDayWithDate(allCourseDates.get(2), Calendar.SUNDAY);
|
|
|
int tp3 = courseScheduleDao.countTeacherPracticeCourse(practiceGroup.getUserId(), monday3, sunday3);
|
|
|
if(tp3>=80){
|
|
|
- throw new BizException("该老师的课程已预约满");
|
|
|
+ result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
+ result.put("info", "抱歉啦,当前所选时段组合,「" + teacher.getRealName() +"」老师已被预约,请重新选择时段或更换老师后重试。");
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
Date monday4 = DateUtil.getWeekDayWithDate(allCourseDates.get(3), Calendar.MONDAY);
|
|
|
Date sunday4 = DateUtil.getWeekDayWithDate(allCourseDates.get(3), Calendar.SUNDAY);
|
|
|
int tp4 = courseScheduleDao.countTeacherPracticeCourse(practiceGroup.getUserId(), monday4, sunday4);
|
|
|
if(tp4>=80){
|
|
|
- throw new BizException("该老师的课程已预约满");
|
|
|
+ result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
+ result.put("info", "抱歉啦,当前所选时段组合,「" + teacher.getRealName() +"」老师已被预约,请重新选择时段或更换老师后重试。");
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
List<CourseSchedule> courseSchedules6 = courseScheduleDao.findTeacherCoursesWithIncludeDateRange(practiceGroup.getUserId(), allCourseDates.get(0), DateUtil.addMinutes(allCourseDates.get(0), practiceCourseMinutes));
|