From df86f4250bbba42a0d1ff89f9fdd52b0aad04424 Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Fri, 25 Nov 2022 23:20:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A2=98=E7=9B=AE=E5=88=86?= =?UTF-8?q?=E6=95=B0=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/mysql/tianze-pro-update.sql | 1 - .../ibeetl/jlw/dao/GeneralQuestionLogDao.java | 7 ++ .../GeneralQuestionLogScoreDetailsInfo.java | 64 +++++++++++++++++++ .../service/GeneralQuestionLogService.java | 9 ++- .../jlw/web/GeneralQuestionLogController.java | 20 +++--- ...eacherOpenCourseQuestionLogController.java | 2 +- ...neralQuestionLogScoreDetailsInfoQuery.java | 2 +- .../resources/sql/jlw/generalQuestionLog.md | 42 ++++++++++++ 8 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLogScoreDetailsInfo.java diff --git a/doc/sql/mysql/tianze-pro-update.sql b/doc/sql/mysql/tianze-pro-update.sql index b594d0bd..b55362e5 100644 --- a/doc/sql/mysql/tianze-pro-update.sql +++ b/doc/sql/mysql/tianze-pro-update.sql @@ -442,7 +442,6 @@ CREATE TABLE `general_question_log` ( `question_analysis` varchar(1000) DEFAULT NULL COMMENT '解析', `is_tuck` int(2) DEFAULT NULL COMMENT '是否收藏夹', `is_error_favorite` int(2) DEFAULT NULL COMMENT '是否错题库', - `general_question_log_create_time` datetime COMMENT '创建时间', `general_question_log_update_time` datetime COMMENT '修改时间', `general_question_log_finish_time` int(10) default 1 COMMENT '总用时(分钟)', `general_question_log_reply` varchar(300) default 1 COMMENT '评语', diff --git a/web/src/main/java/com/ibeetl/jlw/dao/GeneralQuestionLogDao.java b/web/src/main/java/com/ibeetl/jlw/dao/GeneralQuestionLogDao.java index c9f1eeed..6b6cb7ab 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/GeneralQuestionLogDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/GeneralQuestionLogDao.java @@ -1,6 +1,7 @@ package com.ibeetl.jlw.dao; import com.ibeetl.jlw.entity.GeneralQuestionLog; +import com.ibeetl.jlw.entity.GeneralQuestionLogScoreDetailsInfo; import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog; import com.ibeetl.jlw.web.query.GeneralQuestionLogQuery; import org.beetl.sql.core.engine.PageQuery; @@ -48,5 +49,11 @@ public interface GeneralQuestionLogDao extends BaseMapper { PageQuery studentScoreList(PageQuery query); + /** + * 查询分数详细信息 + * @param query 题目分数查询实体 + * @return + */ + PageQuery getQuestionLogScoreDetailsInfo(PageQuery query); } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLogScoreDetailsInfo.java b/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLogScoreDetailsInfo.java new file mode 100644 index 00000000..27a88580 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/GeneralQuestionLogScoreDetailsInfo.java @@ -0,0 +1,64 @@ +package com.ibeetl.jlw.entity; + +import com.ibeetl.admin.core.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * (系统)题目日志 详细得分信息 非教师开课的 + * @author lx + */ +@Data +@EqualsAndHashCode(callSuper=false) +public class GeneralQuestionLogScoreDetailsInfo extends BaseEntity { + + /** + * 学生ID + */ + private Long studentId ; + /** + * 学生姓名 + */ + private String studentName ; + /** + * 学生编号 + */ + private String studentSn ; + /** + * 班级ID + */ + private Long classId; + /** + * 班级名称 + */ + private Long className; + /** + * 题目总数 + */ + private Long questionCount; + /** + * 完成数量 + */ + private Long finishCount; + /** + * 正确数量 + */ + private Long successCount; + /** + * 错误数量 + */ + private Long errorCount; + /** + * 正确率(最大100) + */ + private Float successRate; + /** + * 学生得分 + */ + private Float studentScore; + /** + * 完成进度 + */ + private Float finishProgress; + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java b/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java index bb310ff2..689633fb 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/GeneralQuestionLogService.java @@ -723,5 +723,12 @@ public class GeneralQuestionLogService extends CoreBaseService getQuestionLogScoreDetailsInfo(PageQuery query) { + return generalQuestionLogDao.getQuestionLogScoreDetailsInfo(query); + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/GeneralQuestionLogController.java b/web/src/main/java/com/ibeetl/jlw/web/GeneralQuestionLogController.java index e8446db7..a30e4e6a 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/GeneralQuestionLogController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/GeneralQuestionLogController.java @@ -20,6 +20,7 @@ import com.ibeetl.jlw.entity.GeneralQuestionLog; import com.ibeetl.jlw.entity.Student; import com.ibeetl.jlw.service.GeneralQuestionLogService; import com.ibeetl.jlw.web.query.GeneralQuestionLogQuery; +import com.ibeetl.jlw.web.query.GeneralQuestionLogScoreDetailsInfoQuery; import lombok.SneakyThrows; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -226,16 +227,15 @@ public class GeneralQuestionLogController{ return JsonResult.success(); } -// /** -// * 查询分数详细信息 -// * @param query 题目分数查询实体 -// * @return -// */ -// @PostMapping(API + "/scoreDetailInfo.do") -// public JsonResult scoreDetailInfo(GeneralQuestionLogScoreDetailsInfoQuery query) { -// generalQuestionLogService.getQuestionLogScoreDetailsInfo(query.getPageQuery()); -// return JsonResult.success(); -// } + /** + * 查询分数详细信息(系统,非教师开课) + * @param query 题目分数查询实体 + * @return + */ + @PostMapping(API + "/scoreDetailInfo.do") + public JsonResult scoreDetailInfo(@Validated GeneralQuestionLogScoreDetailsInfoQuery query) { + return JsonResult.success(generalQuestionLogService.getQuestionLogScoreDetailsInfo(query.getPageQuery())); + } /** * 查询错题集(错题库) diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java index 19ba2827..4aec2d99 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseQuestionLogController.java @@ -236,7 +236,7 @@ public class TeacherOpenCourseQuestionLogController { * @return */ @PostMapping(API + "/scoreDetailInfo.do") - public JsonResult scoreDetailInfo(TeacherOpenCourseQuestionLogScoreDetailsInfoQuery query) { + public JsonResult scoreDetailInfo(@Validated TeacherOpenCourseQuestionLogScoreDetailsInfoQuery query) { teacherOpenCourseQuestionLogService.getQuestionLogScoreDetailsInfo(query.getPageQuery()); return JsonResult.success(); } diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/GeneralQuestionLogScoreDetailsInfoQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/GeneralQuestionLogScoreDetailsInfoQuery.java index a430ae03..dff2b0dd 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/query/GeneralQuestionLogScoreDetailsInfoQuery.java +++ b/web/src/main/java/com/ibeetl/jlw/web/query/GeneralQuestionLogScoreDetailsInfoQuery.java @@ -27,7 +27,7 @@ public class GeneralQuestionLogScoreDetailsInfoQuery extends PageParam { /** * 系统课程ID(非开课) */ - private Long generalMergeCourseInfoId; + private Long courseInfoId; /** * 系统题目配置ID(非开课) diff --git a/web/src/main/resources/sql/jlw/generalQuestionLog.md b/web/src/main/resources/sql/jlw/generalQuestionLog.md index 623448e2..fed170dd 100644 --- a/web/src/main/resources/sql/jlw/generalQuestionLog.md +++ b/web/src/main/resources/sql/jlw/generalQuestionLog.md @@ -1171,3 +1171,45 @@ studentScoreList ta.student_name, t.general_question_setting_id )tz + + +getQuestionLogScoreDetailsInfo +=== +* 查询学生详细得分信息,查询分数详细信息 + + select + t.student_id, + ta.student_name, + ta.student_sn, + ta.class_id, + tb.class_name, + count(distinct(t.general_resources_question_snapshot_id)) as question_count, + sum(case when t.general_question_log_update_time is not null then 1 else 0 end) as finish_count, + sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) as success_count, + sum(case when t.general_question_log_update_time is not null and t.question_score <> t.student_score then 1 else 0 end) as error_count, + sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) / IF(count(distinct(t.general_resources_question_snapshot_id)) = 0, 1, count(distinct(t.general_resources_question_snapshot_id))) * 100 as success_rate, + sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then t.question_score else ifnull(t.student_score, 0) end) as student_score, + sum(case when t.general_question_log_update_time is not null then 1 else 0 end) / IF(count(distinct(t.general_resources_question_snapshot_id)) = 0, 1, count(distinct(t.general_resources_question_snapshot_id))) finish_progress + from + general_question_log t + left join general_resources_question_snapshot tc on tc.general_resources_question_snapshot_id = t.general_resources_question_snapshot_id + left join student ta on ta.student_id = t.student_id and ta.student_status = 1 + left join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 + where + 1 = 1 + and t.general_question_setting_id = #generalQuestionSettingId# + @if(!isEmpty(courseInfoId)){ + and tc.business_course_info_id = #courseInfoId# + @} + @if(!isEmpty(studentOrName)){ + and (ta.student_name like #'%'+studentOrName+'%'# or ta.student_sn like #'%'+studentOrName+'%'#) + @} + @if(!isEmpty(classId)){ + and ta.class_id =#classId# + @} + GROUP BY + t.student_id, + ta.student_name, + ta.student_sn, + ta.class_id, + tb.class_name