This commit is contained in:
2026-08-25 12:05:38 +08:00
parent da148823a7
commit 503cbdf3f8
@@ -62,13 +62,10 @@ public class BaseYearTermService implements IBaseYearTermService {
public BaseYearTerm getNowYearTerm() {
Date now = new Date();
List<BaseYearTerm> yearTermList = getAllYearTerm();
if (yearTermList == null || yearTermList.isEmpty()) {
throw new DException("获取学年失败,当前时间不在当学年时间范围");
}
return yearTermList.stream()
.filter(s -> s.getYearStartDate().compareTo(now) <= 0 && s.getYearEndDate().compareTo(now) >= 0)
.findFirst()
.orElseThrow(() -> new DException("获取学年失败,当前时间不在当学年时间范围"));
.findFirst().orElse(null);
// .orElseThrow(() -> new DException("获取学年失败,当前时间不在当学年时间范围"));
}