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 c95a3199..bbb451d9 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java @@ -146,10 +146,10 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ private Long userId ; - @FetchSql("select t.* from teacher_open_course_schedule_session_snap t where t.teacher_open_course_schedule_session_snap_status = 1 " + - " and t.teacher_open_course_schedule_session_id = #teacherOpenCourseScheduleSessionId# " + - "and t.teacher_open_course_schedule_session_snap_status = 1 " + - "order by t.teacher_open_course_schedule_session_day_time asc " ) +// @FetchSql("select t.* from teacher_open_course_schedule_session_snap t where t.teacher_open_course_schedule_session_snap_status = 1 " + +// " and t.teacher_open_course_schedule_session_id = #teacherOpenCourseScheduleSessionId# " + +// "and t.teacher_open_course_schedule_session_snap_status = 1 " + +// "order by t.teacher_open_course_schedule_session_day_time asc " ) @UpdateIgnore @InsertIgnore @DictDeep diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java index df769dfd..b9abf36c 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java @@ -597,7 +597,7 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService list) { + String scheduleSessionIds = listJoin(list, TeacherOpenCourseScheduleSession::getTeacherOpenCourseScheduleSessionId); + + if (StrUtil.isNotBlank(scheduleSessionIds)) { + TeacherOpenCourseScheduleSessionSnapQuery query = new TeacherOpenCourseScheduleSessionSnapQuery(); + query.setTeacherOpenCourseScheduleSessionSnapStatus(1); + query.setTeacherOpenCourseScheduleSessionIdPlural(scheduleSessionIds); + List snapList = getValuesByQuery(query); + + // 根据排课ID分组 + Map> groupSortedMap = snapList.stream() + .sorted(Comparator.comparing(TeacherOpenCourseScheduleSessionSnap::getTeacherOpenCourseScheduleSessionDayTime)) + .collect(groupingBy(TeacherOpenCourseScheduleSessionSnap::getTeacherOpenCourseScheduleSessionId)); + + list.forEach(item -> { + final Long scheduleSessionId = item.getTeacherOpenCourseScheduleSessionId(); + List listOrDefault = groupSortedMap.getOrDefault(scheduleSessionId, Collections.emptyList()); + item.setSessionTagList(listOrDefault); + }); + } + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseScheduleSessionController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseScheduleSessionController.java index 5b244d0d..35897e49 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseScheduleSessionController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseScheduleSessionController.java @@ -12,10 +12,7 @@ import com.ibeetl.jlw.entity.Teacher; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSession; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionClass; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionOptions; -import com.ibeetl.jlw.service.TeacherOpenCourseScheduleSessionClassService; -import com.ibeetl.jlw.service.TeacherOpenCourseScheduleSessionService; -import com.ibeetl.jlw.service.TeacherOpenCourseScheduleSessionTagService; -import com.ibeetl.jlw.service.TeacherOpenCourseService; +import com.ibeetl.jlw.service.*; import com.ibeetl.jlw.web.query.TeacherOpenCourseQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionClassQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionQuery; @@ -53,6 +50,7 @@ public class TeacherOpenCourseScheduleSessionController{ @Autowired private TeacherOpenCourseScheduleSessionService teacherOpenCourseScheduleSessionService; @Autowired private TeacherOpenCourseScheduleSessionTagService teacherOpenCourseScheduleSessionTagService; @Autowired private TeacherOpenCourseScheduleSessionClassService teacherOpenCourseScheduleSessionClassService; + @Autowired private TeacherOpenCourseScheduleSessionSnapService teacherOpenCourseScheduleSessionSnapService; @Autowired private TeacherOpenCourseService teacherOpenCourseService; @Autowired @@ -71,6 +69,7 @@ public class TeacherOpenCourseScheduleSessionController{ } PageQuery page = condition.getPageQuery(); teacherOpenCourseScheduleSessionService.queryByConditionQuery(page); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(page.getList()); return JsonResult.success(page); } } @@ -98,6 +97,7 @@ public class TeacherOpenCourseScheduleSessionController{ condition.setOrgId(coreUser.getOrgId()); } Listlist = teacherOpenCourseScheduleSessionService.getValuesByQuery(condition); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(list); return JsonResult.success(list); } } @@ -201,6 +201,7 @@ public class TeacherOpenCourseScheduleSessionController{ } PageQuery page = condition.getPageQuery(); teacherOpenCourseScheduleSessionService.queryByConditionGroup(page); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(page.getList()); return JsonResult.success(page); } @@ -216,6 +217,7 @@ public class TeacherOpenCourseScheduleSessionController{ } PageQuery page = condition.getPageQuery(); teacherOpenCourseScheduleSessionService.queryByCondition(page); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(page.getList()); return JsonResult.success(page); } @@ -302,6 +304,7 @@ public class TeacherOpenCourseScheduleSessionController{ condition.setOrgId(coreUser.getOrgId()); } Listlist = teacherOpenCourseScheduleSessionService.getValuesByQuery(condition); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(list); return JsonResult.success(list); } @@ -366,6 +369,7 @@ public class TeacherOpenCourseScheduleSessionController{ condition.setOrgId(coreUser.getOrgId()); } teacherOpenCourseScheduleSessionService.queryByConditionGroup(page); + teacherOpenCourseScheduleSessionSnapService.fullSessionTagList(page.getList()); return JsonResult.success(page); } }