From 7a2d8a04e109fbb893b86c886b9a4029e602c615 Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Fri, 28 Oct 2022 23:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeacherOpenCourseScheduleSession.http | 20 +++++----- httpTest/http-client.private.env.json | 2 +- .../TeacherOpenCourseScheduleSession.java | 7 ++++ ...acherOpenCourseScheduleSessionOptions.java | 1 + .../TeacherOpenCourseScheduleSessionSnap.java | 2 +- .../TeacherMergeApplicationService.java | 2 + .../TeacherOpenCourseMergeTeacherService.java | 2 + ...acherOpenCourseScheduleSessionService.java | 39 +++++++++++++++++-- .../resources/application-prod.properties | 2 +- web/src/main/resources/application.properties | 4 +- .../jlw/teacherOpenCourseScheduleSession.md | 1 + .../teacherOpenCourseScheduleSession/index.js | 14 ++++++- .../index.html | 11 +++--- 13 files changed, 81 insertions(+), 26 deletions(-) diff --git a/httpTest/TeacherOpenCourseScheduleSession.http b/httpTest/TeacherOpenCourseScheduleSession.http index 65b40cc7..37611bdd 100644 --- a/httpTest/TeacherOpenCourseScheduleSession.http +++ b/httpTest/TeacherOpenCourseScheduleSession.http @@ -4,7 +4,7 @@ Content-Type: application/json Cookie: JSESSIONID={{session}} { - "startTime": "2022-09-11", + "startTime": "2022-10-25", "weekNum": "3", "openOnHolidays": false, "weekDetail": [ @@ -14,24 +14,24 @@ Cookie: JSESSIONID={{session}} "T4", "T5" ], - "schoolClassIdPlural": "1,2", - "teacherId": "2", - "teacherOpenCourseId": "1569699665614643200", + "schoolClassIdPlural": "5,11,8", + "teacherId": "1", + "teacherOpenCourseId": "1569", "sessionClassList": { - "1568621132431663104": [ + "1568607566282530816": [ { "teacherOpenCourseScheduleSessionTagName": "第一节", "teacherOpenCourseScheduleSessionTagDuration": 20, "teacherOpenCourseScheduleSessionTagStartTime": "09:00", - "teacherOpenCourseScheduleSessionTagEndTime": "09:20", - "teacherOpenCourseScheduleSessionClassName": "教名称名称1/105" - }, + "teacherOpenCourseScheduleSessionTagEndTime": "09:20" + } + ], + "1568621132431663104": [ { "teacherOpenCourseScheduleSessionTagName": "第二节", "teacherOpenCourseScheduleSessionTagDuration": 60, "teacherOpenCourseScheduleSessionTagStartTime": "09:40", - "teacherOpenCourseScheduleSessionTagEndTime": "10:40", - "teacherOpenCourseScheduleSessionClassName": "教名称名称2/106" + "teacherOpenCourseScheduleSessionTagEndTime": "10:40" } ] } diff --git a/httpTest/http-client.private.env.json b/httpTest/http-client.private.env.json index b1eea78d..b445f79a 100644 --- a/httpTest/http-client.private.env.json +++ b/httpTest/http-client.private.env.json @@ -1,6 +1,6 @@ { "dev": { "baseURL": "http://localhost:9090/server/", - "session": "7375560290D5B4F661672990339E8898" + "session": "B9AC69C9E5EDEAF1E1D7A62D81BDA34B" } } \ No newline at end of file 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 99796046..9dd95db9 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java @@ -55,6 +55,12 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ private String schoolClassIds ; + + @FetchSql("select GROUP_CONCAT(t.class_name) from school_class t where FIND_IN_SET(t.class_id, #schoolClassIds#)") + @UpdateIgnore + @InsertIgnore + private String schoolClassIdsText ; + // 开始日期 private String teacherOpenCourseScheduleSessionStartDate; @@ -82,4 +88,5 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ @InsertIgnore private List sessionTagList; + } diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionOptions.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionOptions.java index 5821e715..a066e0b8 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionOptions.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionOptions.java @@ -42,6 +42,7 @@ public class TeacherOpenCourseScheduleSessionOptions { // private ClassRoomType classRoomType; /** * 开课节次List + * teacher_open_course_schedule_session_class 的session_class_id */ @NotEmpty(message = "开课节次不能为空", groups =ValidateConfig.ADD.class) private Map> sessionClassList; diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionSnap.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionSnap.java index d79f3cac..ded6518b 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionSnap.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSessionSnap.java @@ -72,7 +72,7 @@ public class TeacherOpenCourseScheduleSessionSnap extends BaseEntity{ private String teacherOpenCourseScheduleSessionTagEndTime ; - //教室名称 + //教室名称 (这里存teacherOpenCourseScheduleSessionClassId) private String teacherOpenCourseScheduleSessionClassName ; diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java index a158f27a..5298b480 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherMergeApplicationService.java @@ -23,6 +23,7 @@ import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotNull; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -93,6 +94,7 @@ public class TeacherMergeApplicationService extends CoreBaseService sc)); // 一个教室对应一个或多个开课节次 - options.getSessionClassList().forEach((schoolClassId ,sessionTag) -> { + options.getSessionClassList().forEach((sessionClassId ,sessionTag) -> { // 断言,确保开课节次不为空 Assert.notEmpty(sessionTag, "开课节次不能为空!"); List res = BeanUtil.copyToList(sessionTag, TeacherOpenCourseScheduleSessionSnap.class); res.forEach(item -> { - String className = Optional - .ofNullable(classIdMap.get(Long.parseLong(schoolClassId))).orElse(sessionClass) - .getTeacherOpenCourseScheduleSessionClassName(); + String className = getSessionClassFullName(Long.valueOf(sessionClassId), classIdMap); item.setTeacherOpenCourseScheduleSessionSnapAddTime(new Date()); item.setTeacherOpenCourseScheduleSessionSnapStatus(1); item.setTeacherOpenCourseScheduleSessionId(tocss.getTeacherOpenCourseScheduleSessionId()); @@ -290,4 +288,37 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService dataMap, String separator) { + TeacherOpenCourseScheduleSessionClass sessionClass = dataMap.get(sessionClassId); + if (sessionClass == null || sessionClass.getTeacherOpenCourseScheduleSessionClassParentId().equals(0)) { + return ""; + } + + Long parentId = sessionClass.getTeacherOpenCourseScheduleSessionClassParentId(); + return sessionClass.getTeacherOpenCourseScheduleSessionClassName().concat(separator).concat(getSessionClassFullName(parentId, dataMap, separator)); + } + + /** + * 通过排课班级ID,获取班级的全路径名 + * @param sessionClassId + * @param dataMap + * @return + */ + public String getSessionClassFullName(Long sessionClassId, Map dataMap) { + TeacherOpenCourseScheduleSessionClass sessionClass = dataMap.get(sessionClassId); + if (sessionClass == null || sessionClass.getTeacherOpenCourseScheduleSessionClassParentId().equals(0)) { + return ""; + } + + Long parentId = sessionClass.getTeacherOpenCourseScheduleSessionClassParentId(); + return getSessionClassFullName(parentId, dataMap, "/").concat(sessionClass.getTeacherOpenCourseScheduleSessionClassName()); + } } diff --git a/web/src/main/resources/application-prod.properties b/web/src/main/resources/application-prod.properties index 54a8e5e0..f059f06d 100644 --- a/web/src/main/resources/application-prod.properties +++ b/web/src/main/resources/application-prod.properties @@ -20,7 +20,7 @@ spring.datasource.dynamic.hikari.connection-test-query=SELECT 1 # master spring.datasource.dynamic.datasource.master.driverClassName=com.mysql.cj.jdbc.Driver -spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:3306/tianze-pro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true +spring.datasource.dynamic.datasource.master.url=jdbc:mysql://116.205.131.177:3306/tianze-pro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true spring.datasource.dynamic.datasource.master.username=tianze-pro spring.datasource.dynamic.datasource.master.password=xYR3A4EXCWxkHmNX spring.datasource.dynamic.datasource.master.hikari.max-lifetime=60000 diff --git a/web/src/main/resources/application.properties b/web/src/main/resources/application.properties index a691bf41..360b3645 100644 --- a/web/src/main/resources/application.properties +++ b/web/src/main/resources/application.properties @@ -1,6 +1,6 @@ -spring.profiles.active=dev +#spring.profiles.active=dev #spring.profiles.active=local -#spring.profiles.active=prod +spring.profiles.active=prod m3u8.ffmpegPath=D:/ #admin.isOnline=false diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md index aa7d93c4..40faf19b 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md @@ -95,6 +95,7 @@ queryByConditionGroup t.teacher_open_course_schedule_session_start_date, t.teacher_open_course_schedule_session_end_date, t.teacher_open_course_schedule_session_week_num, + t.teacher_open_course_schedule_session_add_time, t.org_id, t.user_id from teacher_open_course_schedule_session t diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js index 96db1b3b..3c494ac2 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/index.js @@ -45,11 +45,11 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { hide: $.isEmpty(sx_['teacherIdText']) ? false : sx_['teacherIdText'], }, { - field: 'schoolClassInfo', + field: 'schoolClassIdsText', title: '上课班级', align: "center", hideField: false, - hide: $.isEmpty(sx_['schoolClassInfo']) ? false : sx_['schoolClassInfo'], + hide: $.isEmpty(sx_['schoolClassIdsText']) ? false : sx_['schoolClassIdsText'], /*templet:function (d) { return }*/ @@ -64,6 +64,16 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) { return "查看" } }, + { + field: 'teacherOpenCourseScheduleSessionWeekNum', + title: '周次', + align: "center", + hideField: false, + hide: $.isEmpty(sx_['teacherOpenCourseScheduleSessionWeekNum']) ? false : sx_['teacherOpenCourseScheduleSessionWeekNum'], + templet:function (d) { + return d.teacherOpenCourseScheduleSessionWeekNum + "周" + } + }, { field: 'look', title: '上课教室', diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html index 9f72e549..d73344f9 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/index.html @@ -50,11 +50,12 @@ 上课日期 - 周次 - 上课星期 - 课次 - 上课时间 - 上课教室 + + 时长 + 上课星期 + 课次 + 上课时间 + 上课教室