diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java index 99e0ad1a..3429b8e2 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java @@ -1,6 +1,7 @@ package com.ibeetl.jlw.entity; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; import com.ibeetl.admin.core.annotation.Dict; import com.ibeetl.admin.core.annotation.DictDeep; import com.ibeetl.admin.core.entity.BaseEntity; @@ -100,6 +101,13 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ private String teacherOpenCourseScheduleSessionClassList; + + // 判断是否是多个教室 + @UpdateIgnore + @InsertIgnore + + private boolean teacherOpenCourseScheduleSessionClassIsMultiple; + //组织ID private Long orgId ; @@ -155,4 +163,12 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ } } + + public void setTeacherOpenCourseScheduleSessionClassList(String teacherOpenCourseScheduleSessionClassList) { + this.teacherOpenCourseScheduleSessionClassList = teacherOpenCourseScheduleSessionClassList; + // 不为空,且字符串是JSON数组 + if(ObjectUtil.isNotEmpty(teacherOpenCourseScheduleSessionClassList) && JSONUtil.isTypeJSONArray(teacherOpenCourseScheduleSessionClassList)) { + this.setTeacherOpenCourseScheduleSessionClassIsMultiple(JSONUtil.parseArray(teacherOpenCourseScheduleSessionClassList).size() > 1); + } + } }