Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 năm trước cách đây
mục cha
commit
c89628c692

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1089,7 +1089,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         errInfo.append(courseSchedule.getName());
         errInfo.append("(");
         errInfo.append(courseSchedule.getId());
-        errInfo.append(")");
+        errInfo.append(")");
 
         errInfo.append("类型为:");
         switch (type) {

+ 16 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -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();