Просмотр исходного кода

1、提交作业添加限制;
2、服务指标;
3、怎加课外训练待布置学员列表;
4、恢复网管课与乐团课的冲突检测逻辑

Joburgess 5 лет назад
Родитель
Сommit
70d592f155

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

@@ -4194,11 +4194,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			throw new BizException("课程有效时间不能早于开始时间");
 		}
 
-		LocalDate courseStartDay = LocalDateTime.ofInstant(practiceGroup.getCoursesStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
-		LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths()).plusDays(-1);
-		Date courseExpiredDateTemp=Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
-		if(coursesExpireDate.before(courseExpiredDateTemp)){
-			throw new BizException("课程结束时间不得早于,{}", DateUtil.dateToString(courseExpiredDateTemp, "yyyy年MM月dd日"));
+		if(Objects.nonNull(practiceGroup.getBuyMonths())){
+			LocalDate courseStartDay = LocalDateTime.ofInstant(practiceGroup.getCoursesStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
+			LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths()).plusDays(-1);
+			Date courseExpiredDateTemp=Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
+			if(coursesExpireDate.before(courseExpiredDateTemp)){
+				throw new BizException("课程结束时间不得早于,{}", DateUtil.dateToString(courseExpiredDateTemp, "yyyy年MM月dd日"));
+			}
 		}
 
 		practiceGroup.setCoursesExpireDate(DateUtil.addSeconds(DateUtil.addDays(coursesExpireDate, 1),-1));