Преглед на файлове

1、冲突检测bug修复
2、通过购买途径创建成功后更新班级信息

Joburgess преди 5 години
родител
ревизия
c234ab8acf

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

@@ -435,21 +435,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         System.out.println(DateUtil.dateToString(new Date(), "HH:mm:ss"));
 		if(allCourseSchedules.size()>1){
 		    //记录连续冲突的次数
-		    Integer repeatTimes=0;
+		    Integer repeatTimes=1;
 			for (int i=1;i<allCourseSchedules.size();i++){
-				for(int j=1;j<=repeatTimes+1&&j<=i;j++){
+				for(int j=repeatTimes;j>0;j--){
                     //当前课程
                     CourseSchedule preCourseSchedule = allCourseSchedules.get(i-j);
                     //后面一节课程
                     CourseSchedule backCourseSchedule = allCourseSchedules.get(i);
                     //判断前后两节课是否存在冲突
                     if(backCourseSchedule.getStartClassTime().before(preCourseSchedule.getEndClassTime())){
+                        if(j==repeatTimes){
+                            repeatTimes+=1;
+                        }
 						if(!checkExistCourseSchedule
 								&&courseScheduleIdsSet.contains(preCourseSchedule.getId())
 								&&courseScheduleIdsSet.contains(backCourseSchedule.getId())){
-							if(j==repeatTimes){
-								repeatTimes+=1;
-							}
 							continue;
 						}
 
@@ -518,9 +518,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                         if(!CollectionUtils.isEmpty(repeatStudentIds)){
                             throw new BizException(courseCheckInfo(preCourseSchedule,backCourseSchedule,existCourseScheduleIds,3));
                         }
-                        if(j==repeatTimes){
-                            repeatTimes+=1;
-                        }
+//                        if(j==repeatTimes){
+//                            repeatTimes+=1;
+//                        }
                     }else{
 						repeatTimes=j;
 						break;

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -890,6 +890,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			vipGroupDao.update(vipGroup);
 		}
 		if(num!=0||updateVipStatus){
+			int i = courseScheduleDao.countVipGroupCourses(vipGroupId.intValue());
+			classGroup.setTotalClassTimes(i);
 			classGroupDao.update(classGroup);
 		}
 	}