From 158cdf0b79bfcc4ea6b776fc7d0057b43f8fa589 Mon Sep 17 00:00:00 2001 From: maLix Date: Thu, 22 Jun 2023 00:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=BA=AB=E4=BB=BD=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=8F=AD=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/web/TeacherOpenCourseChatLogController.java | 13 +++++++++++-- .../resources/sql/jlw/teacherOpenCourseChatLog.md | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseChatLogController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseChatLogController.java index 917dd48f..0eefc1c4 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseChatLogController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseChatLogController.java @@ -2,7 +2,6 @@ package com.ibeetl.jlw.web; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; @@ -41,9 +40,13 @@ import org.springframework.web.servlet.ModelAndView; import javax.validation.constraints.NotNull; import java.io.IOException; import java.math.BigDecimal; -import java.util.*; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; +import static cn.jlw.util.CacheUserUtil.getStudent; import static com.ibeetl.admin.core.util.ExcelUtil.convertData; import static com.ibeetl.admin.core.util.ExcelUtil.write; @@ -270,6 +273,12 @@ public class TeacherOpenCourseChatLogController extends BaseController { if (!coreUser.isAdmin()) { condition.setOrgId(coreUser.getOrgId()); } + + // 学生身份过滤班级 + if (coreUser.isStudent()) { + condition.setSchoolClassIds(getStudent().getClassId().toString()); + } + PageQuery page = condition.getPageQuery(); // 为空则查询顶级 condition.setTeacherOpenCourseChatLogParentId(ObjectUtil.defaultIfNull(condition.getTeacherOpenCourseChatLogParentId(), 0L)); diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md index 3b50e37b..f7378be9 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseChatLog.md @@ -33,7 +33,7 @@ queryByCondition and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(schoolClassIds)){ - and t.school_class_ids =#schoolClassIds# + and find_in_set(t.school_class_ids, #schoolClassIds#) @} @if(!isEmpty(teacherId)){ and t.teacher_id =#teacherId#