feat(plan): 添加学生学案查看及下载功能
- 在学生列表表格中新增“查看学案”按钮,支持查看对应学生的学案列表 - 新增StudentPlanListDialog组件,实现学案列表展示和学案文件下载 - 后端新增查询学生学案接口,支持按学生ID获取未完成学案列表 - 后端数据层和服务层添加按学生ID查询学案的方法 - 调整计划生成相关逻辑,优化学案数据字段命名 - Vue前端调用新增接口,实现学生学案列表动态加载与下载操作 - 完善学案状态显示和列表交互体验
This commit is contained in:
@@ -8,6 +8,7 @@ import com.yinlihupo.enlish.service.service.LessonPlansService;
|
||||
import com.yinlihupo.enlish.service.utils.TTSUtil;
|
||||
import com.yinlihupo.enlish.service.utils.WordExportUtil;
|
||||
import com.yinlihupo.framework.biz.operationlog.aspect.ApiOperationLog;
|
||||
import com.yinlihupo.framework.common.response.PageResponse;
|
||||
import com.yinlihupo.framework.common.response.Response;
|
||||
import com.yinlihupo.framework.common.util.JsonUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -116,5 +117,19 @@ public class LessonPlanController {
|
||||
return Response.success("学案生成完成");
|
||||
}
|
||||
|
||||
@PostMapping("student/list")
|
||||
@ApiOperationLog(description = "查询学生学案")
|
||||
public Response<FindPlanStudentListRspVO> findStudentPlans(@RequestBody FindPlanStudentReqVO findPlanStudentReqVO) {
|
||||
List<LessonPlansDO> lessonPlansDOS = lessonPlanService.findLessonPlansByStudentId(findPlanStudentReqVO.getStudentId());
|
||||
List<LessonPlanItem> list = lessonPlansDOS.stream().map(lessonPlansDO -> LessonPlanItem
|
||||
.builder()
|
||||
.id(lessonPlansDO.getId())
|
||||
.isFinished(0)
|
||||
.title(lessonPlansDO.getTitle())
|
||||
.build())
|
||||
.toList();
|
||||
|
||||
return Response.success(FindPlanStudentListRspVO.builder().lessonPlanItems(list).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ public interface LessonPlansDOMapper {
|
||||
List<LessonPlansDO> findLessonPlansByStudentId(@Param("ids") List<Integer> ids);
|
||||
|
||||
LessonPlansDO selectByLessonId(@Param("lessonId") Integer lessonId);
|
||||
|
||||
List<LessonPlansDO> selectByStudentId(@Param("studentId") Integer studentId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yinlihupo.enlish.service.model.vo.plan;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public class FindPlanStudentListRspVO {
|
||||
|
||||
List<LessonPlanItem> lessonPlanItems;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yinlihupo.enlish.service.model.vo.plan;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public class FindPlanStudentReqVO {
|
||||
private Integer studentId;
|
||||
}
|
||||
@@ -10,4 +10,6 @@ public interface LessonPlansService {
|
||||
List<LessonPlansDO> findLessonPlans(List<Integer> ids);
|
||||
|
||||
LessonPlansDO findLessonPlanById(Integer id);
|
||||
|
||||
List<LessonPlansDO> findLessonPlansByStudentId(Integer studentId);
|
||||
}
|
||||
|
||||
@@ -192,6 +192,11 @@ public class LessonPlansServiceImpl implements LessonPlansService {
|
||||
return lessonPlansDOMapper.selectByLessonId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LessonPlansDO> findLessonPlansByStudentId(Integer studentId) {
|
||||
return lessonPlansDOMapper.selectByStudentId(studentId);
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> generateWeekendPlans(List<VocabularyBankDO> words,
|
||||
int day,
|
||||
@@ -218,7 +223,7 @@ public class LessonPlansServiceImpl implements LessonPlansService {
|
||||
data.put("studentId", studentId);
|
||||
data.put("studentStr", studentDO.getName());
|
||||
data.put("examStr", ExamTitle);
|
||||
data.put("words", words);
|
||||
data.put("checkList", words);
|
||||
// LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
// Configure config = Configure.builder()
|
||||
// .bind("checkList", policy)
|
||||
|
||||
@@ -39,4 +39,15 @@
|
||||
where id = #{lessonId}
|
||||
</select>
|
||||
|
||||
<select id="selectByStudentId" resultMap="BaseResultMap">
|
||||
select *
|
||||
from lesson_plans
|
||||
where id in (
|
||||
select student_lesson_plans.plan_id
|
||||
from student_lesson_plans
|
||||
where student_id = #{studentId}
|
||||
and is_finished = 0
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user