|
@@ -1718,6 +1718,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map practiceApply2(PracticeGroup practiceGroup) {
|
|
|
+ if(Objects.isNull(practiceGroup.getUserId())){
|
|
|
+ throw new BizException("请选择老师");
|
|
|
+ }
|
|
|
Map result = new HashMap();
|
|
|
SysConfig practiceSubjectIdListConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
|
|
|
if (!Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).contains(practiceGroup.getSubjectId().toString())) {
|
|
@@ -1774,6 +1777,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
allCourseDates.sort(Comparator.comparing(Date::getTime));
|
|
|
|
|
|
studentDao.lockUser(practiceGroup.getStudentId());
|
|
|
+ studentDao.lockUser(practiceGroup.getUserId());
|
|
|
|
|
|
Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(practiceGroup.getStudentId());
|
|
|
|
|
@@ -1938,28 +1942,24 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("status", "STUDENT_COURSE_REPEAT");
|
|
|
return result;
|
|
|
-// throw new BizException("您预约的时间端和您现有的课程冲突");
|
|
|
}
|
|
|
List<CourseSchedule> studentRepeatCourse2 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(1), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
|
|
|
if (CollectionUtils.isEmpty(studentRepeatCourse2)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("status", "STUDENT_COURSE_REPEAT");
|
|
|
return result;
|
|
|
-// throw new BizException("您预约的时间端和您现有的课程冲突");
|
|
|
}
|
|
|
List<CourseSchedule> studentRepeatCourse3 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(2), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
|
|
|
if (CollectionUtils.isEmpty(studentRepeatCourse3)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("status", "STUDENT_COURSE_REPEAT");
|
|
|
return result;
|
|
|
-// throw new BizException("您预约的时间端和您现有的课程冲突");
|
|
|
}
|
|
|
List<CourseSchedule> studentRepeatCourse4 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(3), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
|
|
|
if (CollectionUtils.isEmpty(studentRepeatCourse4)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("status", "STUDENT_COURSE_REPEAT");
|
|
|
return result;
|
|
|
-// throw new BizException("您预约的时间端和您现有的课程冲突");
|
|
|
}
|
|
|
|
|
|
//推送
|
|
@@ -1983,7 +1983,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
result.put("status", "TEACHER_PRACTICE_REPEAT");
|
|
|
return result;
|
|
|
-// throw new BizException("指派的老师存在课程冲突");
|
|
|
}
|
|
|
}
|
|
|
courseDates.add(DateUtil.dateToString(courseSchedules1.get(i).getStartClassTime(), "yyyy-MM-dd HH:mm:ss"));
|