【修改】文字考点,

学生进入考试 不单独从缓存中获取
,推送试题中更新试题
This commit is contained in:
huababa1
2025-10-12 19:14:34 +08:00
parent 7442b18939
commit fa9601433e
9 changed files with 336 additions and 84 deletions

View File

@@ -143,7 +143,11 @@ public class MonitorServiceImpl implements MonitorService {
String key = "userCache:" + stuMonitorPaperVo.getTaskId() + ":" + stuMonitorPaperVo.getStuId();
MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key), MonitorDO.class);
if (info == null) {
return 0L;
info=monitorMapper.selectOne(
new QueryWrapper<MonitorDO>()
.eq("task_id", stuMonitorPaperVo.getTaskId())
.eq("stu_id", stuMonitorPaperVo.getStuId())
);
}
//获取属性 判断 专业/课程点位
Long loginTenantId = SecurityFrameworkUtils.getLoginTenantId();
@@ -266,7 +270,7 @@ public class MonitorServiceImpl implements MonitorService {
info.setTemporaryId(stuMonitorPaperVo.getTemporaryId());
info.setIp(stuMonitorPaperVo.getIp());
if (info.getRemainingTime() == null) {
stringRedisTemplate.opsForValue().set("userCache:" + stuMonitorPaperVo.getTaskId() + ":" + stuMonitorPaperVo.getStuId(), JsonUtils.toJsonString(info));
stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info));
monitorMapper.updateById(info);
return 24 * 60 * 60L; // 1天
} else {
@@ -320,6 +324,7 @@ public class MonitorServiceImpl implements MonitorService {
info.setEndTime(end.format(fmt));
// 判分后更新记录
monitorMapper.updateById(info);
stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info));
return finalRemaining;
} else {
return 0;
@@ -334,7 +339,7 @@ public class MonitorServiceImpl implements MonitorService {
LocalDateTime target = now.plusSeconds((long) examTime.toLocalTime().toSecondOfDay());
// 没有考场更新结束时间
info.setEndTime(target.format(fmt));
stringRedisTemplate.opsForValue().set("userCache:" + stuMonitorPaperVo.getTaskId() + ":" + stuMonitorPaperVo.getStuId(), JsonUtils.toJsonString(info));
stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info));
monitorMapper.updateById(info);
return (long) examTime.toLocalTime().toSecondOfDay();
}

View File

@@ -810,7 +810,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService {
// 批量插入
examQuestionMapper.insertExamPsKeywordList(psKeywords);
}
examQuestionMapper.updateBatch(examQuestion);
examQuestionMapper.updateById(examQuestion);
}
}
}

View File

@@ -139,7 +139,7 @@
<select id="getSchoolNameTotal" resultType="java.lang.Long">
SELECT count(*)
FROM system_tenant
WHERE id != 1 AND deleted = 0
WHERE deleted = 0
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>

View File

@@ -121,6 +121,8 @@
<select id="selectExamSpecialtyBySpId" parameterType="Long" resultMap="ExamSpecialtyResult">
<include refid="selectExamSpecialtyVo"/>
where sp_id = #{spId}
and status = 0
and deleted = 0
</select>
<select id="selectExamSpecialtyBySpNameOne" parameterType="String" resultType="ExamSpecialty">
@@ -147,6 +149,8 @@
SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time
from exam_specialty
where parent_id = #{parentId}
and status = 0
and deleted = 0
</select>
<select id="getRoleById" resultType="java.lang.String">
select roles