feat(lessonplan): 实现基于AI的学案自动生成与管理功能
- 新增DifyArticleClient工具类,实现基于Dify API的对话与文本生成功能 - 创建LessonPlansService接口及其实现,实现学案按天生成及存储 - 设计LessonPlansDO和StudentLessonPlansDO数据对象及对应MyBatis映射和数据库操作 - 扩展VocabularyBankDO实体及Mapper,支持查询单元词汇和学生未掌握词汇 - 利用deepoove-poi模板技术生成Word格式的学习计划文档,包含词汇、复习和练习 - 开发StringToPlanMapUtil工具类,解析AI返回结果为结构化学案内容 - 新增JUnit测试用例验证AI对话功能及学案生成逻辑正确性 - 更新Spring Boot配置,添加AI接口地址及密钥等参数 - 在前端Vue项目中新建学案页面,路由配置及导航菜单支持学案访问
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<result column="definition" jdbcType="VARCHAR" property="definition" />
|
||||
<result column="pronunciation" jdbcType="VARCHAR" property="pronunciation" />
|
||||
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
|
||||
<result column="pos" jdbcType="VARCHAR" property="pos" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -28,6 +29,9 @@
|
||||
<if test="unitId != null">
|
||||
unit_id,
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
pos,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -45,6 +49,9 @@
|
||||
<if test="unitId != null">
|
||||
#{unitId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="pos != null">
|
||||
#{pos,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -69,4 +76,46 @@
|
||||
from vocabulary_bank
|
||||
</select>
|
||||
|
||||
<select id="selectVocabularyBankDOAllByUnitId" resultMap="BaseResultMap">
|
||||
select *
|
||||
from vocabulary_bank
|
||||
where unit_id = #{unitId}
|
||||
</select>
|
||||
|
||||
<select id="selectVocabularyBankListStudentNotMaster" resultMap="BaseResultMap">
|
||||
<![CDATA[
|
||||
select *
|
||||
from vocabulary_bank
|
||||
where unit_id in (
|
||||
select unit_id
|
||||
from grade_unit
|
||||
where grade_id = #{gradeId}
|
||||
)
|
||||
and id in (
|
||||
select word_id
|
||||
from word_mastery_log
|
||||
where memory_strength < 0
|
||||
and student_id = #{studentId}
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="selectVocabularyBankListSelfCheck" resultMap="BaseResultMap">
|
||||
select *
|
||||
from vocabulary_bank vb
|
||||
inner join grade_unit gu on vb.unit_id = gu.unit_id
|
||||
inner join word_mastery_log wml on vb.id = wml.word_id
|
||||
where gu.grade_id = #{gradeId}
|
||||
and wml.student_id = #{studentId}
|
||||
<!-- 修复not in的语法错误 + 空集合防护 -->
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
and vb.id not in (
|
||||
<foreach item="id" collection="ids" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
limit #{wordCount}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user