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