From c5723cdd7debc8e3ab1fd83b52025408f09d0bd5 Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Fri, 17 Feb 2023 23:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E8=AF=BE=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeacherOpenCourseScheduleSession.java | 8 ++--- ...acherOpenCourseScheduleSessionService.java | 8 ++--- ...rOpenCourseScheduleSessionSnapService.java | 34 +++++++++++++++++-- ...erOpenCourseScheduleSessionController.java | 12 ++++--- 4 files changed, 48 insertions(+), 14 deletions(-) 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); } }