From 15805a0f74488cda6516a64880488b72b62ad89b Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Fri, 13 Jan 2023 23:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeacherOpenCourseHomeWorkLogPageDTO.java | 2 +- ...nCourseStudentSigninSettingController.java | 22 ++++++++++++++----- .../sql/jlw/teacherOpenCourseQuestionLog.md | 8 +++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseHomeWorkLogPageDTO.java b/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseHomeWorkLogPageDTO.java index a633be65..b81a014d 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseHomeWorkLogPageDTO.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/dto/TeacherOpenCourseHomeWorkLogPageDTO.java @@ -12,6 +12,6 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper=false) public class TeacherOpenCourseHomeWorkLogPageDTO extends PageParam { - private String questionSettingIdPlural; + private String teacherOpenCourseQuestionSettingId; } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java index f0722a1b..d5be5f4c 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java @@ -1,12 +1,16 @@ package com.ibeetl.jlw.web; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.jlw.Interceptor.SCoreUser; import cn.jlw.validate.ValidateConfig; import com.ibeetl.admin.core.annotation.Function; +import com.ibeetl.admin.core.entity.CoreDict; import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.file.FileService; +import com.ibeetl.admin.core.service.CoreDictService; import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting; import com.ibeetl.jlw.entity.vo.SigninSettingSummaryVO; @@ -26,8 +30,10 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.io.IOException; import java.util.List; +import java.util.Map; import static com.ibeetl.admin.core.util.ExcelUtil.write; +import static java.util.stream.Collectors.groupingBy; /** * 学生签到设置 教师-我的课程-开课-学生签到-配置 接口 @@ -44,6 +50,7 @@ public class TeacherOpenCourseStudentSigninSettingController{ @Autowired private TeacherOpenCourseStudentSigninSettingService teacherOpenCourseStudentSigninSettingService; + @Autowired private CoreDictService coreDictService; @Autowired FileService fileService; @@ -195,13 +202,18 @@ public class TeacherOpenCourseStudentSigninSettingController{ @GetMapping(MODEL + "/exportSummary.json") @ResponseBody public String exportSummary(TeacherOpenCourseStudentSigninSettingQuery condition, HttpServletResponse response) throws IOException { - PageQuery page = condition.getPageQuery(); - page.setPageSize(Integer.MAX_VALUE); - page.setPageNumber(1L); - teacherOpenCourseStudentSigninSettingService.queryByCondition(page); + List list = teacherOpenCourseStudentSigninSettingService.getValuesByQueryNotWithPermission(condition); + + Map> studentSigninTypeMap = coreDictService.findAllByType("student_signin_type").stream().collect(groupingBy(CoreDict::getValue)); + list.forEach(item -> { + CoreDict first = CollectionUtil.getFirst(studentSigninTypeMap.get(item.getTeacherOpenCourseStudentSigninSettingType())); + if (first != null) { + item.set("teacherOpenCourseStudentSigninSettingType", first.getValue()); + } + }); String filename = StrUtil.format("开课签到汇总导出{}.xlsx", DateUtil.now()); - write(response, filename,"Sheet1", SigninSettingSummaryVO.class, page.getList()); + write(response, filename,"Sheet1", SigninSettingSummaryVO.class, BeanUtil.copyToList(list, SigninSettingSummaryVO.class)); return null; } diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md index 3092e33f..52bcf5b7 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseQuestionLog.md @@ -1006,8 +1006,8 @@ getHomeWorkLogExportPageList 1 AND t.teacher_open_course_question_log_status = 1 AND t.student_score is not null - @if(isNotEmpty(questionSettingIdPlural)) { - and find_in_set(t.teacher_open_course_question_setting_id, #questionSettingIdPlural#) + @if(isNotEmpty(teacherOpenCourseQuestionSettingId)) { + and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# @} getHomeWorkLogExportList @@ -1032,7 +1032,7 @@ getHomeWorkLogExportList 1 AND t.teacher_open_course_question_log_status = 1 AND t.student_score is not null - @if(isNotEmpty(questionSettingIdPlural)) { - and find_in_set(t.teacher_open_course_question_setting_id, #questionSettingIdPlural#) + @if(isNotEmpty(teacherOpenCourseQuestionSettingId)) { + and t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId# @} \ No newline at end of file