Commit bb77f5d4 authored by 刘帅's avatar 刘帅

1.bug修复

parent e22c4a4e
......@@ -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<String, Object> simulateInfo = examSimulateInfoService.getFormalSubjectAllInfo(params);
......
......@@ -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())) {
......
......@@ -236,6 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</otherwise>
</choose>
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
......
......@@ -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
<if test="memberUserId != null and memberUserId != ''">
and member_user_id = #{memberUserId}
</if>
<if test="isPay != null and isPay != ''">
and is_pay = #{isPay}
</if>
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
<if test="examStatus != null and examStatus != '' and examStatus != 1">
and ter.is_pay = 1
and ter.is_pay = 1
</if>
<if test="isPay != null and isPay != ''">
and ter.is_pay = #{isPay}
</if>
</where>
GROUP BY
ter.exam_registration_id
ter.exam_id
order by ter.create_time desc
</select>
......@@ -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
<if test="memberUserId != null and memberUserId != ''">and member_user_id = #{memberUserId}</if>
GROUP BY course_id
) latest ON ter.course_id = latest.course_id AND ter.create_time = latest.max_create_time
<where>
<if test="memberUserId == null or memberUserId == ''"> and ter.member_user_id = 0</if>
<if test="memberUserId != null and memberUserId != ''"> and ter.member_user_id = #{memberUserId}</if>
......@@ -1274,8 +1295,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCourseIsPay" resultType="com.ruoyi.hezhi.domain.TbExamRegistration">
select ter.exam_registration_id as examRegistrationId, ter.course_id as courseId,ter.is_pay as isPay,
case when ter.is_pay = 1 then '已报名'
when ter.is_pay !=1 then '未报名'
ELSE '未报名' END isEnroll
when ter.is_pay = 0 then '未报名'
ELSE '已取消' END isEnroll
from tb_exam_registration ter
where ter.member_user_id = #{memberUserId} and ter.course_id in
<foreach item="item" collection="courseIdList" separator="," open="(" close=")" index="">
......
......@@ -320,6 +320,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="examSimulateInfoId != null and examSimulateInfoId != ''"> and tesi.exam_simulate_info_id = #{examSimulateInfoId}</if>
<if test="memberUserId != null and memberUserId != ''"> and tesi.member_user_id = #{memberUserId}</if>
<if test="examId != null and examId != '' "> and tesi.exam_id = #{examId}</if>
<if test="examBatchIndex != null and examBatchIndex != '' "> and tesi.exam_platform_number = #{examBatchIndex}</if>
and tesi.status = 0
and tesi.del_flag = 0
and tesi.exam_type = 1
......
......@@ -131,6 +131,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IF(count(ter.exam_registration_id)>0,1,0) as status
from
tb_exam_registration ter
INNER JOIN(
SELECT course_id, MAX(create_time) as max_create_time
FROM tb_exam_registration
WHERE member_user_id = #{memberUserId} AND is_pay = '1'
GROUP BY course_id
) latest ON ter.course_id = latest.course_id AND ter.create_time = latest.max_create_time
left join tb_course tc on tc.course_id = ter.course_id
<where>
and ter.member_user_id = #{memberUserId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment