学年
This commit is contained in:
@@ -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("获取学年失败,当前时间不在当学年时间范围"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user