From 7b1a4026a2bcae2b055972c2537b7ef702eb91fe Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Thu, 24 Apr 2025 13:34:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=91=A8=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E8=80=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/common/service/impl/ClassExamServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/peanut/modules/common/service/impl/ClassExamServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/ClassExamServiceImpl.java index ee250fd6..7eaad9d3 100644 --- a/src/main/java/com/peanut/modules/common/service/impl/ClassExamServiceImpl.java +++ b/src/main/java/com/peanut/modules/common/service/impl/ClassExamServiceImpl.java @@ -1,5 +1,6 @@ package com.peanut.modules.common.service.impl; +import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -154,6 +155,10 @@ public class ClassExamServiceImpl extends ServiceImpl i if ("1".equals(params.get("type").toString())){ ClassEntity classEntity = classEntityDao.selectById(params.get("relationId").toString()); ClassModel classModel = classModelDao.selectById(classEntity.getModelId()); + if ("3".equals(classEntity.getState())&& + DateUtils.addDateDays(classEntity.getStartTime(),classModel.getDays()+classModel.getExamDays()).getTime()>new Date().getTime()){ + return R.error("考试周已结束,等待结班"); + } examTime = classModel.getExamTime();//考试持续时间 MPJLambdaWrapper courseWrapper = new MPJLambdaWrapper<>(); courseWrapper.leftJoin(ClassModel.class,ClassModel::getId,ClassCourse::getModelId);