feat(enlish-service): 新增自动判卷功能及学生单词记忆管理模块

- 支持数据库多语句查询,修改数据源连接配置增加allowMultiQueries参数
- 添加定时任务AutoJudgeExamWordsTask,实现每5秒自动触发判卷
- 增加ExamWordsJudge接口及其实现类ExamWordsJudgeImpl,完成考试判卷逻辑
- 新增多张数据库映射文件及对应Mapper,如ExamWordsDOMapper、ExamWordsJudgeResultDOMapper、StudentExamWordsDOMapper和WordMasteryLogDOMapper,支持相关数据操作
- 扩展PngUtil工具类,支持从答题卡图片中解析学生考试信息和识别未记忆单词
- 修改数据库表结构映射,新增word_mastery_log表和相关字段,管理学生单词记忆强度及复习次数
- 配置@EnableScheduling以启用定时任务调度功能
- 增加测试用例包括ExamWordsJudgeTest和WordMasteryLogInsertTest,验证判卷和学生单词记忆初始化功能
- 重命名测试类TestInsert为TestVocabularyBankInsert,提升代码语义清晰度
This commit is contained in:
lbw
2025-12-14 11:30:26 +08:00
parent a5b23057d3
commit 1002eaf591
22 changed files with 320 additions and 18 deletions

View File

@@ -19,11 +19,36 @@
<result column="wrong_word_ids" jdbcType="LONGVARCHAR" property="wrongWordIds" typeHandler="com.yinlihupo.enlish.service.config.ListWordIdTypeHandler" />
</resultMap>
<insert id="insert" parameterType="com.yinlihupo.enlish.service.domain.dataobject.ExamWordsJudgeResultDO">
<insert id="insert">
insert into exam_words_judge_result
(ans_sheet_path, is_finished, start_date)
values (#{path}, 0, now())
</insert>
<select id="selectUnfinishedExamWordsJudgeResultDOList" resultMap="BaseResultMap">
select * from exam_words_judge_result
where is_finished = 0
limit #{count}
</select>
<update id="updateErrorMsg">
update exam_words_judge_result
set error_msg = #{errorMsg}
and is_finished = 2
where id = #{id}
</update>
<update id="updateExamWordsJudgeResultDO">
update exam_words_judge_result
set student_id = #{examWordsJudgeResultDO.studentId},
exam_words_id = #{examWordsJudgeResultDO.examWordsId},
correct_word_ids = #{examWordsJudgeResultDO.correctWordIds, typeHandler=com.yinlihupo.enlish.service.config.ListWordIdTypeHandler},
wrong_word_ids = #{examWordsJudgeResultDO.wrongWordIds, typeHandler=com.yinlihupo.enlish.service.config.ListWordIdTypeHandler},
correct_word_count = #{examWordsJudgeResultDO.correctWordCount},
wrong_word_count = #{examWordsJudgeResultDO.wrongWordCount},
is_finished = 1
where id = #{examWordsJudgeResultDO.id}
</update>
</mapper>