diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiExamController.java index 0d6dab6e3454a0760bb15e4680aa0fba6f0c4a55..ac366a394f2b46da706b860a8e6399562b60a637 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiExamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiExamController.java @@ -644,12 +644,12 @@ public class ApiExamController { Date currentTime = new Date(); // 比较时间 - if (currentTime.after(examEndTime)) { - return AjaxResult.error("考试时间【" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamStartTime()) + "至" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamEndTime()) + "】,考试已结束"); - } - if (currentTime.before(examStartTime)) { - return AjaxResult.error("考试时间【" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamStartTime()) + "至" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamEndTime()) + "】,考试未开始"); - } +// if (currentTime.after(examEndTime)) { +// return AjaxResult.error("考试时间【" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamStartTime()) + "至" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamEndTime()) + "】,考试已结束"); +// } +// if (currentTime.before(examStartTime)) { +// return AjaxResult.error("考试时间【" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamStartTime()) + "至" + DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", tbExamBatch.getExamEndTime()) + "】,考试未开始"); +// } } // 正式考试考生及考试信息 Map simulateInfo = examSimulateInfoService.getFormalSubjectAllInfo(params); diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamSimulateInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamSimulateInfoServiceImpl.java index e5138f1d1a95cd0e9589cd0cd0a6734245e2a8c0..a42b60fc22284f2a77b2d410cc0b99fda66f7a26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamSimulateInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamSimulateInfoServiceImpl.java @@ -428,7 +428,7 @@ public class TbExamSimulateInfoServiceImpl implements ITbExamSimulateInfoService if (formalSubjectAllInfo == null) { return AjaxResult.error("未进行考试,不允许补考"); } - if (!"2".equals(formalSubjectAllInfo.get("passStatus").toString())) { + if (!"2".equals(formalSubjectAllInfo.get("passStatus").toString()) && !"0".equals(formalSubjectAllInfo.get("passStatus").toString())) { return AjaxResult.error("您已通过,无需补考"); } if ("1".equals(formalSubjectAllInfo.get("isAgain").toString())) { diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml index 185c28815b642dfb25772c9d295490d353aa81a5..aa7edc0be8da185d783cd16861a8414935434fe7 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml @@ -236,6 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CONVERT ( IFNULL( teb.exam_batch, '' ), CHAR ) AS examBatch, + CONVERT ( IFNULL( teb.batch_index, '' ), CHAR ) AS examBatchIndex, CASE WHEN DATE_FORMAT( teb.exam_start_time, '%Y-%m-%d %H:%i' ) > DATE_FORMAT( now(), '%Y-%m-%d %H:%i' ) THEN 0 diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml index cc8808f900b9d45f0cf2bc1e8e0622ec3d46af22..cc5892e2329d295a4e8d1a8c487f9a53b18d89c1 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml @@ -882,6 +882,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tmo.order_id as orderId, ter.exam_registration_id AS examRegistrationId, ter.exam_id AS examId, + MAX(ter.create_time) AS createTime, ter.exam_batch_index AS examBatchIndex, ter.member_user_id AS memberUserId, ter.is_pay AS isPay, @@ -918,7 +919,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE tsc.member_user_id = ter.member_user_id AND tsc.course_id = ter.course_id) AS total from tb_exam_registration ter - left join tb_course tc on tc.course_id = ter.course_id + INNER JOIN ( + SELECT exam_id, MAX(create_time) as create_time + FROM tb_exam_registration + WHERE STATUS = 0 AND del_flag = 0 + + and member_user_id = #{memberUserId} + + + and is_pay = #{isPay} + + GROUP BY exam_id + ) AS ter2 ON ter.create_time = ter2.create_time and ter.exam_id = ter2.exam_id + left join tb_course tc on tc.course_id = ter.course_id left join tb_member_order tmo on tmo.data_id = ter.exam_registration_id left join tb_exam te on ter.exam_id = te.exam_id left join tb_exam_notice ten on ten.exam_id = ter.exam_id @@ -954,11 +967,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ter.status = 0 and ter.del_flag = 0 - and ter.is_pay = 1 + and ter.is_pay = 1 + + + and ter.is_pay = #{isPay} GROUP BY - ter.exam_registration_id + ter.exam_id order by ter.create_time desc @@ -1031,11 +1047,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CONVERT(IFNULL(tc.course_name, ''), CHAR) AS courseName, CONVERT(IFNULL(tc.cover_image, ''), CHAR) AS coverImage, '15' AS courseSpeed - from tb_exam_registration ter left join tb_exam te on ter.exam_id = te.exam_id left join tb_course tc on ter.course_id = tc.course_id - + INNER JOIN ( + SELECT course_id, MAX(create_time) as max_create_time + FROM tb_exam_registration + WHERE STATUS = 0 AND del_flag = 0 AND is_pay = 1 + and member_user_id = #{memberUserId} + GROUP BY course_id + ) latest ON ter.course_id = latest.course_id AND ter.create_time = latest.max_create_time and ter.member_user_id = 0 and ter.member_user_id = #{memberUserId} @@ -1274,8 +1295,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"