From a20a57b5c0cd030c8c1ed1895b92cf8e69647604 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 20 Oct 2022 09:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=95=E5=8D=B7=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/services/paper/PaperUserCreateService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java b/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java index 22ca796e3..2124b20b0 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java @@ -64,7 +64,9 @@ public class PaperUserCreateService { PaperExceptionAssert.PcExisted.assertNotNull(composition, "创建试卷的试卷定义不存在,pcId = " + pcId); PaperExceptionAssert.PcCanCreatePu.assertTrue(!PaperCompositionState.Editing.equals(PaperCompositionState.getItem(composition.getState())), "编辑中的试卷定义无法用于生成用户试卷,pcId = " + pcId); LocalDateTime now = LocalDateTime.now(); - PaperExceptionAssert.PcCanCreatePu.assertTrue(now.isAfter(composition.getStartTime()) && now.isBefore(composition.getEndTime()), "当前时间未在试卷启用时间内,不能创建试卷"); + if (null != composition.getStartTime() && null != composition.getEndTime()) { + PaperExceptionAssert.PcCanCreatePu.assertTrue(now.isAfter(composition.getStartTime()) && now.isBefore(composition.getEndTime()), "当前时间未在试卷启用时间内,不能创建试卷"); + } // 试卷蓝图规则 List ruleList = compositionService.findRuleByPcId(pcId); PaperExceptionAssert.PcHavePr.assertCollectionNotEmpty(ruleList, "试卷定义没有规则定义,无法生成用户试卷,pcId = " + pcId);