|
@@ -37,6 +37,7 @@ import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.event.source.CourseEventSource;
|
|
|
import org.apache.commons.collections.ListUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.tomcat.jni.Local;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -5250,6 +5251,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void courseMerge(CourseMergeDto courseMergeInfo) {
|
|
|
+ Date now = new Date();
|
|
|
+ Date thirdDay = Date.from(LocalDate.now().plusDays(3).atStartOfDay(DateUtil.zoneId).toInstant());
|
|
|
+
|
|
|
if(CollectionUtils.isEmpty(courseMergeInfo.getMergeCourseIds())){
|
|
|
throw new BizException("请选择需要合并的课程");
|
|
|
}
|
|
@@ -5265,7 +5269,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(courseTypeNum>1){
|
|
|
throw new BizException("课程合并仅支持同课程类型");
|
|
|
}
|
|
|
- Date now = new Date();
|
|
|
for (CourseSchedule courseSchedule : allCourses) {
|
|
|
if(Objects.nonNull(courseSchedule.getNewCourseId())){
|
|
|
throw new BizException("存在已合并课程");
|
|
@@ -5273,6 +5276,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(courseSchedule.getStartClassTime().compareTo(now)<=0){
|
|
|
throw new BizException("课程合并仅支持未开始的课程");
|
|
|
}
|
|
|
+ if(courseSchedule.getEndClassTime().compareTo(thirdDay)>0){
|
|
|
+ throw new BizException("仅支持合并三天以内的课程");
|
|
|
+ }
|
|
|
if(VIP.equals(courseSchedule.getGroupType())||PRACTICE.equals(courseSchedule.getGroupType())){
|
|
|
throw new BizException("VIP课、网管课暂不支持课程合并");
|
|
|
}
|