From c89a3707c556f97c4531f556e6c832cb6b5d2b43 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 31 十月 2024 17:53:19 +0800 Subject: [PATCH] 新建/修改考试时,校验试卷是否能成功生成 --- src/main/java/com/ycl/jxkg/service/impl/HomeServiceImpl.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/service/impl/HomeServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/HomeServiceImpl.java index ffa07ac..fe423ef 100644 --- a/src/main/java/com/ycl/jxkg/service/impl/HomeServiceImpl.java +++ b/src/main/java/com/ycl/jxkg/service/impl/HomeServiceImpl.java @@ -87,14 +87,16 @@ List<ExamVO> examList = new ArrayList<>(); if (!CollectionUtils.isEmpty(classes)) { LocalDate nowDate = LocalDate.now(); - // 璁$畻涓冨ぉ鍚庣殑鏃ユ湡 + // 璁$畻鍓嶅悗涓冨ぉ鐨勬棩鏈� LocalDate sevenDayLaterDate = nowDate.plusDays(7); LocalDateTime now = LocalDateTime.of(nowDate, LocalTime.MIN); LocalDateTime sevenDayLater = LocalDateTime.of(sevenDayLaterDate, LocalTime.MIN); + LocalDate sevenDayBeforeDate = nowDate.minusDays(7); + LocalDateTime sevenDayBefore = LocalDateTime.of(sevenDayBeforeDate, LocalTime.MIN); //鎴戠殑璇剧▼ QueryWrapper<Meet> meetQueryWrapper = new QueryWrapper<>(); meetQueryWrapper.in("classes_id",classes); - meetQueryWrapper.between("start_time", now,sevenDayLater); + meetQueryWrapper.between("start_time", sevenDayBefore,sevenDayLater); List<Meet> meets = meetMapper.selectList(meetQueryWrapper); for (Meet meet : meets) { MeetVO meetVO = new MeetVO(); @@ -104,7 +106,7 @@ //鎴戠殑鑰冭瘯 QueryWrapper<Exam> examQueryWrapper = new QueryWrapper<>(); examQueryWrapper.in("classes_id",classes); - examQueryWrapper.between("start_time", now,sevenDayLater); + examQueryWrapper.between("start_time", sevenDayBefore,sevenDayLater); List<Exam> exams = examMapper.selectList(examQueryWrapper); for (Exam exam : exams) { ExamVO examVO = new ExamVO(); -- Gitblit v1.8.0