From 2105746b5d013cd60c468f58c60a836dacb7f4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B8=85?= Date: Mon, 22 Sep 2025 15:55:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=94=A8=E6=88=B7=E5=8D=8F=E8=AE=AE=E3=80=81?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=94=BF=E7=AD=96=202.=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=80=83=E8=AF=95=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hezhi/api/kaoshi/ApiConfigController.java | 33 ++++++++++++++++ .../api/kaoshi/ApiMemberUserController.java | 2 + .../hezhi/domain/TbExamSimulateInfo.java | 4 ++ .../impl/TbExamSimulateInfoServiceImpl.java | 6 ++- .../TbMemberExamSimulateAllServiceImpl.java | 19 ++++++++-- .../mapper/hezhi/TbExamNoticeMapper.xml | 38 +++---------------- .../mapper/hezhi/TbExamRegistrationMapper.xml | 5 +++ .../mapper/hezhi/TbExamSimulateInfoMapper.xml | 4 +- .../mapper/system/SysConfigMapper.xml | 32 ++++++++-------- 9 files changed, 89 insertions(+), 54 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiConfigController.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiConfigController.java new file mode 100644 index 0000000..d985c2d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiConfigController.java @@ -0,0 +1,33 @@ +package com.ruoyi.hezhi.api.kaoshi; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.hezhi.mapper.TbConfigMapper; +import com.ruoyi.system.service.ISysConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 参数配置 信息操作处理 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/api/config") +public class ApiConfigController +{ + @Autowired + private TbConfigMapper configService; + + /** + * 根据参数键名查询参数值 + */ + @GetMapping(value = "/configKey/{configKey}") + public AjaxResult getConfigKey(@PathVariable String configKey) + { + return AjaxResult.success(configService.selectTbConfigByIdentifying(configKey)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java index 85f363d..e2eaffd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java @@ -350,6 +350,7 @@ public class ApiMemberUserController extends BaseController { * @param pageSize 每页数据量 * @param params memberUserId 用户ID * examStatus(1-已报名,2-待开考,3-开考中,4-已结束,5-领取证书) + * passStatus 通过状态(0-无,1-通过,2-未通过) * @return success */ @GetMapping("/getMemberExamList") @@ -401,6 +402,7 @@ public class ApiMemberUserController extends BaseController { numFour = examRegistrationService.getMemberExamList(hashMap).size(); hashMap.put("examStatus", 5); + hashMap.put("passStatus", 1); numFive = examRegistrationService.getMemberExamList(hashMap).size(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbExamSimulateInfo.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbExamSimulateInfo.java index 2047940..6f03e39 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbExamSimulateInfo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/domain/TbExamSimulateInfo.java @@ -30,6 +30,10 @@ public class TbExamSimulateInfo extends BaseEntity @Excel(name = "考台编号") private String examPlatformNumber; + /** 考试批次序号 */ + @Excel(name = "考试批次序号") + private Integer examBatchIndex; + /** 用户ID */ @Excel(name = "用户ID") private Long memberUserId; 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 a42b60f..8203e99 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 @@ -385,6 +385,8 @@ public class TbExamSimulateInfoServiceImpl implements ITbExamSimulateInfoService public Map getFormalSubjectAllInfo(Map params) { long memberUserId = Long.parseLong(params.get("memberUserId").toString()); long examId = Long.parseLong(params.get("examId").toString()); + int examBatchIndex = Integer.parseInt(params.get("examBatchIndex").toString()); + Map formalSubjectAllInfo = tbExamSimulateInfoMapper.getFormalSubjectAllInfo(params); @@ -393,6 +395,7 @@ public class TbExamSimulateInfoServiceImpl implements ITbExamSimulateInfoService TbExamSimulateInfo examSimulateInfo = new TbExamSimulateInfo(); Integer platformNumber = tbExamSimulateInfoMapper.selectMaxExamPlatformNumber(examId); examSimulateInfo.setExamPlatformNumber(String.valueOf(platformNumber + 1)); + examSimulateInfo.setExamBatchIndex(examBatchIndex); examSimulateInfo.setMemberUserId(memberUserId); examSimulateInfo.setExamId(examId); examSimulateInfo.setExamType(1); @@ -442,10 +445,10 @@ public class TbExamSimulateInfoServiceImpl implements ITbExamSimulateInfoService } TbExam tbExam = examMapper.selectTbExamByExamId(examId); + TbExamRegistration tbExamRegistration = tbExamRegistrationMapper.selectTbExamRegistrationByUserIdExamId(memberUserId, examId); if (tbExam != null) { Integer isAgain = MapUtils.getInteger(formalSubjectAllInfo, "isAgain"); if (isAgain == 0){ - TbExamRegistration tbExamRegistration = tbExamRegistrationMapper.selectTbExamRegistrationByUserIdExamId(memberUserId, examId); List enableByExamId = tbExamBatchMapper.getEnableByExamId(examId, tbExam.getExamBatchEarly()); if (!enableByExamId.isEmpty()){ List collect = enableByExamId.stream().filter(item -> item.getBatchIndex() > tbExamRegistration.getExamBatchIndex()).collect(Collectors.toList()); @@ -477,6 +480,7 @@ public class TbExamSimulateInfoServiceImpl implements ITbExamSimulateInfoService TbExamSimulateInfo examSimulateInfo = new TbExamSimulateInfo(); Integer platformNumber = tbExamSimulateInfoMapper.selectMaxExamPlatformNumber(examId); examSimulateInfo.setExamPlatformNumber(String.valueOf(platformNumber + 1)); + examSimulateInfo.setExamBatchIndex(tbExamRegistration.getExamBatchIndex()); examSimulateInfo.setMemberUserId(memberUserId); examSimulateInfo.setExamId(examId); examSimulateInfo.setExamType(1); diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMemberExamSimulateAllServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMemberExamSimulateAllServiceImpl.java index 8d73c80..836b0a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMemberExamSimulateAllServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMemberExamSimulateAllServiceImpl.java @@ -366,9 +366,7 @@ public class TbMemberExamSimulateAllServiceImpl implements ITbMemberExamSimulate e.printStackTrace(); } - HashMap params = new HashMap<>(); - params.put("memberUserId", memberUserId); - params.put("examSubjectId", examSubjectId); + // 正确答案 String answer = tbExamSubject.getAnswer(); @@ -393,6 +391,16 @@ public class TbMemberExamSimulateAllServiceImpl implements ITbMemberExamSimulate score = exam.getDiscussScore(); } + /* 根据考试、人员、题目ID查询该题是否存在 */ + TbMemberExamSimulateAll examSimulateAll = new TbMemberExamSimulateAll(); + examSimulateAll.setExamSimulateInfoId(examSimulateInfoId); + examSimulateAll.setExamSubjectId(examSubjectId); + examSimulateAll.setMemberUserId(memberUserId); + List examSimulateAllList = tbMemberExamSimulateAllMapper.selectTbMemberExamSimulateAllList(examSimulateAll); + if (!examSimulateAllList.isEmpty()) { + + } + TbMemberExamSimulateAll memberExamSimulateAll = new TbMemberExamSimulateAll(); memberExamSimulateAll.setExamSimulateInfoId(examSimulateInfoId); memberExamSimulateAll.setExamSubjectId(examSubjectId); @@ -422,9 +430,12 @@ public class TbMemberExamSimulateAllServiceImpl implements ITbMemberExamSimulate memberExamSimulateAll.setStatus(3); } + HashMap params = new HashMap<>(); + params.put("memberUserId", memberUserId); + params.put("examSubjectId", examSubjectId); params.put("examSimulateInfoId", examSimulateInfoId); params.put("examType", 1); - params.put("location", location); +// params.put("location", location); TbMemberExamSimulateAll simulateAll = tbMemberExamSimulateAllMapper.queryMemberExamSimulateAllByParam(params); if (ObjectUtils.isEmpty(simulateAll)) { tbMemberExamSimulateAllMapper.insertTbMemberExamSimulateAll(memberExamSimulateAll); diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml index aa7edc0..c1febe4 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamNoticeMapper.xml @@ -248,40 +248,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 1 ELSE 0 END isJoin, CASE - WHEN #{memberUserId} = 0 - THEN - - 1 + WHEN #{memberUserId} = 0 THEN - 1 WHEN #{memberUserId} != 0 - AND ( - SELECT - tesn.pass_status - FROM - tb_exam_simulate_info tesn - WHERE - tesn.member_user_id = #{memberUserId} - - AND tesn.exam_id = te.exam_id - AND tesn.exam_type = 1 - ORDER BY - tesn.create_time DESC - LIMIT 1 - ) IS NULL THEN - 0 + AND (SELECT tesn.pass_status FROM tb_exam_simulate_info tesn WHERE tesn.member_user_id = #{memberUserId} AND tesn.exam_id = te.exam_id AND tesn.exam_type = 1 + ORDER BY tesn.create_time DESC LIMIT 1 ) IS NULL + THEN 0 WHEN #{memberUserId} != 0 - THEN - ( - SELECT - tesn.pass_status - FROM - tb_exam_simulate_info tesn - WHERE - tesn.member_user_id = #{memberUserId} - AND tesn.exam_id = te.exam_id - AND tesn.exam_type = 1 - ORDER BY - tesn.create_time DESC - LIMIT 1 - ) ELSE 0 + THEN (SELECT tesn.pass_status FROM tb_exam_simulate_info tesn WHERE tesn.member_user_id = #{memberUserId} AND tesn.exam_id = te.exam_id AND tesn.exam_type = 1 + ORDER BY tesn.create_time DESC LIMIT 1) ELSE 0 END passStatus, (SELECT tesn.is_again FROM tb_exam_simulate_info tesn WHERE tesn.member_user_id = #{memberUserId} AND tesn.exam_id = te.exam_id AND tesn.exam_type = 1 ORDER BY tesn.create_time DESC LIMIT 1) is_again, CASE diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml index 5d50180..b384491 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml @@ -914,6 +914,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ten.exam_notice_id examNoticeId, ter.course_id courseId, tc.course_name courseName, + tesi.pass_status AS passStatus, (SELECT COUNT(*) FROM tb_member_subject_collect tsc WHERE tsc.member_user_id = ter.member_user_id @@ -938,6 +939,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 left join tb_exam_batch teb on teb.exam_id = ter.exam_id and teb.batch_index = ter.exam_batch_index + LEFT JOIN tb_exam_simulate_info tesi ON ter.exam_id = tesi.exam_id AND ter.member_user_id = tesi.member_user_id AND ter.exam_batch_index = tesi.exam_batch_index and ter.member_user_id = 0 and ter.member_user_id = #{memberUserId} @@ -974,6 +976,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ter.is_pay = #{isPay} + + and tesi.pass_status = #{passStatus} + diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamSimulateInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamSimulateInfoMapper.xml index d05a80c..c4cef24 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbExamSimulateInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbExamSimulateInfoMapper.xml @@ -91,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" exam_platform_number, member_user_id, exam_id, + exam_batch_index, subject_warehouse_class_id, exam_type, exam_minute, @@ -128,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{examPlatformNumber}, #{memberUserId}, #{examId}, + #{examBatchIndex}, #{subjectWarehouseClassId}, #{examType}, #{examMinute}, @@ -320,7 +322,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tesi.exam_simulate_info_id = #{examSimulateInfoId} and tesi.member_user_id = #{memberUserId} and tesi.exam_id = #{examId} - and tesi.exam_platform_number = #{examBatchIndex} + and tesi.exam_batch_index = #{examBatchIndex} and tesi.status = 0 and tesi.del_flag = 0 and tesi.exam_type = 1 diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml index a5ff114..1bf537f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -15,12 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config - + @@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + - + - + - + insert into sys_config ( config_name, @@ -88,9 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sysdate() ) - + - update sys_config + update sys_config config_name = #{configName}, config_key = #{configKey}, @@ -102,16 +102,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where config_id = #{configId} - + delete from sys_config where config_id = #{configId} - + - delete from sys_config where config_id in + delete from sys_config where config_id in #{configId} - - \ No newline at end of file + + -- 2.22.0