Skip to content

Commit

Permalink
Merge pull request #97 from NJUPT-SAST/dev-Aiden
Browse files Browse the repository at this point in the history
fix 修复当带时间查询活动列表(筛选)的接口时,返回的不是该日期之后的活动的问题
  • Loading branch information
Aiden2014 authored Dec 9, 2023
2 parents 6d20739 + 80abbcd commit 45b3af6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/sast/evento/service/impl/EventServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,11 @@ private void addEventStateSchedule(Event event) {
public List<EventModel> postForEvents(List<Integer> typeId, List<Integer> departmentId, String time) {
String today = timeUtil.getTime();
List<Date> date = timeUtil.getDateOfMonday(today);
// 如果time不为空,则将date起始日期改为time所设置的日期
// 如果time不为空,则将date起始日期改为time所设置的日期,结束日期设为无限大,获取的不是Date最大时间而是MySQL中datetime最大时间
if (!time.isEmpty()) {
date.set(0,timeUtil.validTime(time).getTime());
final Date FINAL_DATE = timeUtil.validTime("9999-12-31").getTime();
date.set(1,FINAL_DATE);
}
if (typeId.isEmpty()) {
if (departmentId.isEmpty()) {
Expand Down

0 comments on commit 45b3af6

Please sign in to comment.