feat(student): 新增分阶段学习评语功能
- 添加StudentStageLearningRemarkDO数据对象类 - 新增StudentStageLearningRemarkDOMapper接口及对应XML映射文件 - 修改generatorConfig.xml,增加student_stage_learning_remark表生成配置 - 在StudentServiceImpl中注入StudentStageLearningRemarkDOMapper - 学习分析结果保存时同时插入分阶段学习评语数据 - exam模块打印生成各类测试日志信息(摸底、期中、期末)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.yinlihupo.enlish.service.domain.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public class StudentStageLearningRemarkDO {
|
||||
private Integer id;
|
||||
|
||||
private Integer studentId;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String commentContent;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.yinlihupo.enlish.service.domain.mapper;
|
||||
|
||||
import com.yinlihupo.enlish.service.domain.dataobject.StudentStageLearningRemarkDO;
|
||||
|
||||
public interface StudentStageLearningRemarkDOMapper {
|
||||
|
||||
void insert(StudentStageLearningRemarkDO studentStageLearningRemarkDO);
|
||||
}
|
||||
@@ -54,8 +54,10 @@ public class ExamWordsServiceImpl implements ExamWordsService {
|
||||
log.info("生成摸底测试");
|
||||
examWordsDO = generateBaselineExamWords(studentId);
|
||||
} else if (type == ExamWordsConstant.EXAM_TYPE_MIDTERM) {
|
||||
log.info("生成期中测试");
|
||||
examWordsDO = generateMidtermExamWords(studentId);
|
||||
} else {
|
||||
log.info("生成期末测试");
|
||||
examWordsDO = generateFinalExamWords(studentId);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ public class StudentServiceImpl implements StudentService {
|
||||
private DifyArticleClient difyArticleClient;
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
@Resource
|
||||
private StudentStageLearningRemarkDOMapper studentStageLearningRemarkDOMapper;
|
||||
|
||||
@Override
|
||||
public List<StudentDO> getStudentsByClassIdAndGradeId(Integer classId, Integer gradeId, String name, Integer pageNo, Integer pageSize) {
|
||||
@@ -161,6 +163,13 @@ public class StudentServiceImpl implements StudentService {
|
||||
// 设置过期时间 3 天
|
||||
redisTemplate.opsForValue().set(key, analyze);
|
||||
redisTemplate.expire(key, 3, TimeUnit.DAYS);
|
||||
|
||||
studentStageLearningRemarkDOMapper.insert(StudentStageLearningRemarkDO.builder()
|
||||
.studentId(studentId)
|
||||
.commentContent(analyze)
|
||||
.createTime(LocalDateTime.now())
|
||||
.build());
|
||||
|
||||
return analyze;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
targetProject="src/main/java"/>
|
||||
|
||||
<!-- 需要生成的表-实体类 -->
|
||||
<table tableName="user_role_rel" domainObjectName="UserRoleRelDO"
|
||||
<table tableName="student_stage_learning_remark" domainObjectName="StudentStageLearningRemarkDO"
|
||||
enableCountByExample="false"
|
||||
enableUpdateByExample="false"
|
||||
enableDeleteByExample="false"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yinlihupo.enlish.service.domain.mapper.StudentStageLearningRemarkDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.StudentStageLearningRemarkDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="student_id" jdbcType="INTEGER" property="studentId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.StudentStageLearningRemarkDO">
|
||||
<result column="comment_content" jdbcType="LONGVARCHAR" property="commentContent" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert">
|
||||
insert into student_stage_learning_remark (student_id, create_time, comment_content)
|
||||
values (#{studentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{commentContent,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user