Browse Source

Merge remote-tracking branch 'origin/master_saas' into master_saas

zouxuan 2 năm trước cách đây
mục cha
commit
6d4ede69ee

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

@@ -3048,7 +3048,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		Map<Long, CourseSchedule> oldCourseScheduleMap = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
 
 		List<CourseSchedule> liveCourseSchedules = Lists.newArrayList();
-		BeanUtils.copyProperties(oldCourseScheduleList,liveCourseSchedules);
         for(CourseSchedule newCourseSchedule : newCourseSchedules){
 
         	//获取数据库中的记录
@@ -3104,6 +3103,17 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				}
 			}
 
+			// 直播课发送推送消息
+			if (LIVE.equals(oldCourseSchedule.getGroupType())) {
+				// 日期,时间,时长,主教老师不一致时,发送消息
+				if (newCourseSchedule.getClassDate() != oldCourseSchedule.getClassDate()
+						|| newCourseSchedule.getStartClassTime() != oldCourseSchedule.getStartClassTime()
+						|| newCourseSchedule.getEndClassTime() != oldCourseSchedule.getEndClassTime()
+						|| newCourseSchedule.getActualTeacherId() != oldCourseSchedule.getActualTeacherId().intValue()) {
+					liveCourseSchedules.add(oldCourseSchedule);
+				}
+			}
+
             if(!CollectionUtils.isEmpty(newCourseSchedule.getTeachingTeacherIdList())){
                 if (newCourseSchedule.getTeachingTeacherIdList().contains(newCourseSchedule.getActualTeacherId())){
                     throw new BizException("主教和助教不可重复");
@@ -6068,7 +6078,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
 			if(DateUtil.minutesBetween(new Date(),oldCourseSchedule.getStartClassTime()) < Integer.parseInt(startRemindTime)
 					&& DateUtil.minutesBetween(new Date(),oldCourseSchedule.getEndClassTime()) >= 0){
-				throw new BizException("直播课课程开始前{}分钟不允许调整",startRemindTime);
+				// TODO: 测试环境暂时注释
+				//throw new BizException("直播课课程开始前{}分钟不允许调整",startRemindTime);
 			}
 		}
 	}