|
@@ -2537,7 +2537,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Date now=new Date();
|
|
|
LocalDate courseStartDay=LocalDate.now();
|
|
|
if(practiceGroupBuyParams.isRenew()){
|
|
|
- PracticeGroup userLatestPracticeGroup = practiceGroupDao.findUserPracticeGroup(practiceGroupBuyParams.getUserId(),practiceGroupBuyParams.getGroupId());
|
|
|
+ if(Objects.isNull(practiceGroupBuyParams.getGroupId())){
|
|
|
+ return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择续费的课程");
|
|
|
+ }
|
|
|
+ PracticeGroup userLatestPracticeGroup = practiceGroupDao.findUserPracticeGroup(practiceGroupBuyParams.getStudentId(),practiceGroupBuyParams.getGroupId());
|
|
|
if(Objects.nonNull(userLatestPracticeGroup)){
|
|
|
LocalDate lastExpiredDay=LocalDateTime.ofInstant(userLatestPracticeGroup.getCoursesExpireDate().toInstant(),DateUtil.zoneId).toLocalDate();
|
|
|
if(Objects.nonNull(lastExpiredDay)&&lastExpiredDay.compareTo(courseStartDay)>=0){
|
|
@@ -2720,13 +2723,24 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
teacherAttendances.add(teacherAttendance);
|
|
|
}
|
|
|
courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
|
|
|
+ courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
|
|
|
teacherAttendanceDao.batchInsert(teacherAttendances);
|
|
|
|
|
|
try {
|
|
|
courseScheduleService.checkNewCourseSchedules(practiceCourses,false);
|
|
|
} catch (Exception e) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return BaseController.failed(HttpStatus.FOUND, e.getMessage());
|
|
|
+ String errMessage=new String();
|
|
|
+ if(e.getMessage().indexOf("主教冲突")!=-1){
|
|
|
+ errMessage="抱歉啦,当前所选时段组合,「" + teacher.getRealName() + "」老师已被预约,请重新选择时段或更换老师后重试。";
|
|
|
+ }else{
|
|
|
+ String courseName=e.getMessage().substring(e.getMessage().indexOf(")-")+2);
|
|
|
+ courseName = courseName.substring(0,courseName.indexOf("("));
|
|
|
+ errMessage="抱歉啦,当前所选时段组合,与您现有课程「";
|
|
|
+ errMessage+=courseName;
|
|
|
+ errMessage+="」时段冲突,请选择其他时段重试。";
|
|
|
+ }
|
|
|
+ return BaseController.failed(HttpStatus.FOUND, errMessage);
|
|
|
}
|
|
|
|
|
|
StudentPaymentOrder studentPaymentOrder=new StudentPaymentOrder();
|