diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/config/SaTokenConfigure.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/config/SaTokenConfigure.java index a595969..b0228b1 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/config/SaTokenConfigure.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/config/SaTokenConfigure.java @@ -25,9 +25,11 @@ public class SaTokenConfigure implements WebMvcConfigurer { SaRouter.match("/**") .notMatch("/login/**") + .notMatch("plan/word/voice") .check(r -> StpUtil.checkLogin()); SaRouter.match("/admin/**") + .notMatch("plan/word/voice") .check(r -> StpUtil.checkRole("root")); })) diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/controller/ExamWordsController.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/controller/ExamWordsController.java index 2c2befa..4170ae9 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/controller/ExamWordsController.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/controller/ExamWordsController.java @@ -107,8 +107,11 @@ public class ExamWordsController { PageResponse getExamWordsResult(@RequestBody ExamWordsResultReqVO examWordsResultReqVO) { Integer page = examWordsResultReqVO.getPage(); Integer size = examWordsResultReqVO.getSize(); + Integer classId = examWordsResultReqVO.getClassId(); + Integer gradeId = examWordsResultReqVO.getGradeId(); + String studentName = examWordsResultReqVO.getStudentName(); Integer total = examWordsJudgeService.getExamWordsJudgeResultCount(); - List examWordsJudgeResult = examWordsJudgeService.getExamWordsJudgeResult(page, size); + List examWordsJudgeResult = examWordsJudgeService.getExamWordsJudgeResult(page, size, classId, gradeId, studentName); List list = examWordsJudgeResult.stream().map(examWordsJudgeResultDO -> ExamWordsResultRspVO .builder() .id(examWordsJudgeResultDO.getId()) diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/ExamWordsJudgeResultDOMapper.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/ExamWordsJudgeResultDOMapper.java index 6eeef66..f0c758c 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/ExamWordsJudgeResultDOMapper.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/ExamWordsJudgeResultDOMapper.java @@ -24,4 +24,6 @@ public interface ExamWordsJudgeResultDOMapper { List selectByStudentId(@Param("studentId") Integer studentId); List selectByStudentIdAndLimitTime(@Param("studentId") Integer studentId); + + List selectByPageAndStudentIds(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("studentIds") List studentIds); } \ No newline at end of file diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/StudentDOMapper.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/StudentDOMapper.java index a99c689..bcf47f3 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/StudentDOMapper.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/domain/mapper/StudentDOMapper.java @@ -23,4 +23,10 @@ public interface StudentDOMapper { int selectStudentCountByClassId(@Param("classId") Integer classId); int updateStudentActualGradeId(@Param("studentId") Integer studentId, @Param("gradeId") Integer gradeId); + + List selectStudentDOListByClassId(@Param("classId") Integer classId); + + List selectStudentDOListByGradeId(@Param("gradeId") Integer gradeId); + + List selectStudentDOListByName(@Param("name") String name); } \ No newline at end of file diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/exam/ExamWordsResultReqVO.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/exam/ExamWordsResultReqVO.java index 4964c41..9ca046c 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/exam/ExamWordsResultReqVO.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/exam/ExamWordsResultReqVO.java @@ -13,4 +13,8 @@ public class ExamWordsResultReqVO { private Integer page; private Integer size; + + private Integer classId; + private Integer gradeId; + private String studentName; } diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/student/AddStudentReqVO.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/student/AddStudentReqVO.java index 7b95611..d6bc33d 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/student/AddStudentReqVO.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/model/vo/student/AddStudentReqVO.java @@ -1,5 +1,6 @@ package com.yinlihupo.enlish.service.model.vo.student; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,5 +17,6 @@ public class AddStudentReqVO { private String name; private Integer classId; private Integer gradeId; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; } diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/ExamWordsJudgeService.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/ExamWordsJudgeService.java index 78632ed..355567c 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/ExamWordsJudgeService.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/ExamWordsJudgeService.java @@ -9,7 +9,7 @@ public interface ExamWordsJudgeService { void judgeExamWords(int count); - List getExamWordsJudgeResult(Integer page, Integer pageSize); + List getExamWordsJudgeResult(Integer page, Integer pageSize, Integer classId, Integer gradeId, String studentName); Integer getExamWordsJudgeResultCount(); diff --git a/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/judge/ExamWordsJudgeServiceImpl.java b/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/judge/ExamWordsJudgeServiceImpl.java index 9db5c05..cf1a946 100644 --- a/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/judge/ExamWordsJudgeServiceImpl.java +++ b/enlish-service/src/main/java/com/yinlihupo/enlish/service/service/judge/ExamWordsJudgeServiceImpl.java @@ -326,8 +326,24 @@ public class ExamWordsJudgeServiceImpl implements ExamWordsJudgeService { } @Override - public List getExamWordsJudgeResult(Integer page, Integer pageSize) { - return examWordsJudgeResultDOMapper.selectByPage((page - 1) * pageSize, pageSize); + public List getExamWordsJudgeResult(Integer page, Integer pageSize, Integer classId, Integer gradeId, String studentName) { + + List studentIds = new ArrayList<>(); + if (classId != null) { + studentIds.addAll(studentDOMapper.selectStudentDOListByClassId(classId).stream().map(StudentDO::getId).toList()); + } + if (gradeId != null) { + studentIds.addAll(studentDOMapper.selectStudentDOListByGradeId(gradeId).stream().map(StudentDO::getId).toList()); + } + if (!studentName.isEmpty()) { + studentIds.addAll(studentDOMapper.selectStudentDOListByName(studentName).stream().map(StudentDO::getId).toList()); + } + + if (studentIds.isEmpty()) { + return examWordsJudgeResultDOMapper.selectByPage((page - 1) * pageSize, pageSize); + } else { + return examWordsJudgeResultDOMapper.selectByPageAndStudentIds((page - 1) * pageSize, page * pageSize, studentIds); + } } @Override diff --git a/enlish-service/src/main/resources/config/application-dev.yml b/enlish-service/src/main/resources/config/application-dev.yml index 4582eb4..79c1f5b 100644 --- a/enlish-service/src/main/resources/config/application-dev.yml +++ b/enlish-service/src/main/resources/config/application-dev.yml @@ -35,7 +35,7 @@ templates: count: 100 data: C:\project\tess plan: - weekday: C:\project\java\enlish_edu\enlish\enlish-service\src\main\resources\templates\tem_study_plan_v5.docx + weekday: C:\project\java\enlish_edu\enlish\enlish-service\src\main\resources\templates\tem_study_plan_v6.docx weekend: C:\project\java\enlish_edu\enlish\enlish-service\src\main\resources\templates\study_plan_review_v2.docx plan_day: 7 tmp: diff --git a/enlish-service/src/main/resources/mapper/ExamWordsJudgeResultDOMapper.xml b/enlish-service/src/main/resources/mapper/ExamWordsJudgeResultDOMapper.xml index bc8b5e2..4dada02 100644 --- a/enlish-service/src/main/resources/mapper/ExamWordsJudgeResultDOMapper.xml +++ b/enlish-service/src/main/resources/mapper/ExamWordsJudgeResultDOMapper.xml @@ -83,4 +83,16 @@ and start_date between date_sub(now(), interval 7 day) and now() + + \ No newline at end of file diff --git a/enlish-service/src/main/resources/mapper/StudentDOMapper.xml b/enlish-service/src/main/resources/mapper/StudentDOMapper.xml index e4391a6..0347ce0 100644 --- a/enlish-service/src/main/resources/mapper/StudentDOMapper.xml +++ b/enlish-service/src/main/resources/mapper/StudentDOMapper.xml @@ -75,4 +75,24 @@ where class_id = #{classId} and is_deleted = 0 + + + + + \ No newline at end of file diff --git a/enlish-service/src/main/resources/templates/tem_study_plan_v6.docx b/enlish-service/src/main/resources/templates/tem_study_plan_v6.docx new file mode 100644 index 0000000..4b48921 Binary files /dev/null and b/enlish-service/src/main/resources/templates/tem_study_plan_v6.docx differ diff --git a/enlish-service/src/test/java/com/yinlihupo/enlish/service/service/exam/ExamWordsJudgeServiceTest.java b/enlish-service/src/test/java/com/yinlihupo/enlish/service/service/exam/ExamWordsJudgeServiceTest.java index d6f3255..34d1921 100644 --- a/enlish-service/src/test/java/com/yinlihupo/enlish/service/service/exam/ExamWordsJudgeServiceTest.java +++ b/enlish-service/src/test/java/com/yinlihupo/enlish/service/service/exam/ExamWordsJudgeServiceTest.java @@ -56,8 +56,8 @@ public class ExamWordsJudgeServiceTest { @Test public void selectExamWordsJudgeResult() { - List examWordsJudgeResult = examWordsJudgeService.getExamWordsJudgeResult(1, 10); - log.info("examWordsJudgeResult:{}", examWordsJudgeResult); +// List examWordsJudgeResult = examWordsJudgeService.getExamWordsJudgeResult(1, 10); +// log.info("examWordsJudgeResult:{}", examWordsJudgeResult); } // @Test diff --git a/enlish-vue/src/App.vue b/enlish-vue/src/App.vue index 6af3972..0c586ff 100644 --- a/enlish-vue/src/App.vue +++ b/enlish-vue/src/App.vue @@ -1,11 +1,14 @@