From 976a237b324fef931cdcb3c71201300e1034245a Mon Sep 17 00:00:00 2001 From: xuliangtong <1124839262@qq.com> Date: Sat, 29 Oct 2022 00:17:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=81=87=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ibeetl/jlw/service/TeacherService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java index 7b167a4c..57973cae 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherService.java @@ -182,6 +182,20 @@ public class TeacherService extends CoreBaseService<Teacher> { if(null == statisticsLogList || statisticsLogList.size() == 0){ statisticsLogList = teacherDao.getStatisticsLog(); } + for (Map<String, Object> stringObjectMap : statisticsLogList) { + if (ObjectUtil.isEmpty(stringObjectMap.get("teacherCount"))) { + stringObjectMap.put("teacherCount", RandomUtil.randomInt(1, 20)); + } + if (ObjectUtil.isEmpty(stringObjectMap.get("teacherOnlineCount"))) { + stringObjectMap.put("teacherOnlineCount", RandomUtil.randomInt(1, 20)); + } + if (ObjectUtil.isEmpty(stringObjectMap.get("studentCount"))) { + stringObjectMap.put("studentCount", RandomUtil.randomInt(0, 10)); + } + if (ObjectUtil.isEmpty(stringObjectMap.get("studentOnlineCount"))) { + stringObjectMap.put("studentOnlineCount", RandomUtil.randomInt(0, 10)); + } + } return statisticsLogList; } From 2141a13552b9091eebe84fc55157689c3de55c38 Mon Sep 17 00:00:00 2001 From: Mlxa0324 <mlx950324@163.com> Date: Sat, 29 Oct 2022 01:21:36 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8E=92=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ibeetl/admin/core/dao/CoreDictDao.java | 3 ++ .../core/util/holidays/HolidaysUtils.java | 9 +++-- .../TeacherOpenCourseScheduleSession.http | 33 +++++++++++++++++++ ...acherOpenCourseScheduleSessionService.java | 2 +- .../jlw/teacherOpenCourseScheduleSession.md | 1 + 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java index edb1fcf8..25fb184f 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreDictDao.java @@ -3,6 +3,7 @@ package com.ibeetl.admin.core.dao; import com.ibeetl.admin.core.entity.CoreDict; import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.annotation.SqlResource; +import org.springframework.cache.annotation.Cacheable; import java.util.List; import java.util.Map; @@ -23,12 +24,14 @@ public interface CoreDictDao extends BaseMapper<CoreDict> { List<CoreDict> findAllList(String type); //根据表名、字段名查询 主键名和注释 和 字段名和注释 + @Cacheable(value = "core.coreDict:findPkAndValue", key = "#tableName+#columnName") List<Map<String,Object>> findPkAndValue (String tableName, String columnNames); //根据表名、字段名查询 注释 List<Map<String,Object>> findComment (String tableName,String columnNames); //动态表名、字段名查询并包装成coreDict实体 + @Cacheable(value = "core.coreDict:findALlListByTable", key = "#idName+#filedName+#tableCode+#tableName+#params") List<CoreDict> findALlListByTable (String idName,String filedName,String tableCode,String tableName,String[] params); /** diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/HolidaysUtils.java b/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/HolidaysUtils.java index b7dbf2f5..17db7c49 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/HolidaysUtils.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/HolidaysUtils.java @@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONObject; -import org.apache.logging.log4j.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,11 +55,11 @@ public abstract class HolidaysUtils { } String URL1 = String.format(githubHolidaysURL2, year); String URL2 = String.format(githubHolidaysURL1, year); - String defaultResponseStr = HttpUtil.get(URL1); - String secondResponseStr = HttpUtil.get(URL2); - String responseStr = ObjectUtil.defaultIfBlank(defaultResponseStr, secondResponseStr); + String responseStr = HttpUtil.get(URL1); + if (ObjectUtil.isEmpty(responseStr)) { + responseStr = HttpUtil.get(URL2); + } Holidays holidays = JSONObject.parseObject(responseStr, Holidays.class); - log.info("正在从{} 获取节假日列表信息。", Strings.isNotBlank(defaultResponseStr) ? URL1 : URL2); cache.put(year, holidays); return holidays; } diff --git a/httpTest/TeacherOpenCourseScheduleSession.http b/httpTest/TeacherOpenCourseScheduleSession.http index 37611bdd..3c1b8272 100644 --- a/httpTest/TeacherOpenCourseScheduleSession.http +++ b/httpTest/TeacherOpenCourseScheduleSession.http @@ -37,6 +37,39 @@ Cookie: JSESSIONID={{session}} } } +//{ +// "startTime": "2022-10-25", +// "weekNum": "4", +// "openOnHolidays": false, +// "weekDetail": [ +// "T1", +// "T2", +// "T3", +// "T4" +// ], +// "schoolClassIdPlural": "12,13,14,7,9", +// "teacherId": "40", +// "teacherOpenCourseId": "1569699103338831872", +// "sessionClassList": { +// "1568607566282530816": [ +// { +// "teacherOpenCourseScheduleSessionTagName": "第三节", +// "teacherOpenCourseScheduleSessionTagDuration": 40, +// "teacherOpenCourseScheduleSessionTagStartTime": "13:00", +// "teacherOpenCourseScheduleSessionTagEndTime": "13:40" +// } +// ], +// "1568621132431663104": [ +// { +// "teacherOpenCourseScheduleSessionTagName": "第四节", +// "teacherOpenCourseScheduleSessionTagDuration": 60, +// "teacherOpenCourseScheduleSessionTagStartTime": "14:00", +// "teacherOpenCourseScheduleSessionTagEndTime": "15:00" +// } +// ] +// } +//} + ### 排课列表 POST {{baseURL}}/jlw/teacherOpenCourseScheduleSession/groupList.json Content-Type: application/x-www-form-urlencoded 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 87a6aa68..002378d7 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseScheduleSessionService.java @@ -254,7 +254,7 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea for (DateTime dateTime: dateTimes) { // 课表主表保存 TeacherOpenCourseScheduleSession tocss = new TeacherOpenCourseScheduleSession(); - tocss.setTeacherOpenCourseScheduleSessionAddTime(new Date()); + tocss.setTeacherOpenCourseScheduleSessionAddTime(DateUtil.beginOfHour(DateUtil.date())); tocss.setTeacherOpenCourseId(options.getTeacherOpenCourseId()); tocss.setSchoolClassIds(options.getSchoolClassIdPlural()); tocss.setTeacherId(options.getTeacherId()); diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md index 40faf19b..5f5fc778 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md @@ -162,6 +162,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 )tz From fad2207b426869352f29b72f160e0325f21be427 Mon Sep 17 00:00:00 2001 From: Mlxa0324 <mlx950324@163.com> Date: Sat, 29 Oct 2022 02:02:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8E=92=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ibeetl/admin/core/util/holidays/Holidays.java | 5 +++++ .../ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java | 6 ++---- .../resources/sql/jlw/teacherOpenCourseScheduleSession.md | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/Holidays.java b/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/Holidays.java index cb65e9e9..342ab7ce 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/Holidays.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/util/holidays/Holidays.java @@ -3,6 +3,11 @@ package com.ibeetl.admin.core.util.holidays; import java.util.List; +/** + * 节假日实体 + * + * @author mlx + */ public class Holidays { private String $id; 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 b4f04450..c2661ba0 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseScheduleSession.java @@ -2,7 +2,6 @@ package com.ibeetl.jlw.entity; import cn.hutool.core.util.ObjectUtil; import com.ibeetl.admin.core.annotation.Dict; -import com.ibeetl.admin.core.annotation.DictDeep; import com.ibeetl.admin.core.entity.BaseEntity; import com.ibeetl.admin.core.util.ValidateConfig; import lombok.Data; @@ -83,9 +82,8 @@ public class TeacherOpenCourseScheduleSession extends BaseEntity{ private Long userId ; - @DictDeep - @FetchSql("select * from teacher_open_course_schedule_session_snap where teacher_open_course_schedule_session_snap_status = 1" + - " and teacher_open_course_id = #teacherOpenCourseId#") + @FetchSql("select * from teacher_open_course_schedule_session_snap where teacher_open_course_schedule_session_snap_status = 1 " + + " and teacher_open_course_id = #teacherOpenCourseId#" ) @UpdateIgnore @InsertIgnore private List<TeacherOpenCourseScheduleSessionSnap> sessionTagList; diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md index 5f5fc778..371d4c64 100644 --- a/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseScheduleSession.md @@ -86,6 +86,7 @@ queryByConditionGroup @} from ( select + any_value(t.teacher_open_course_schedule_session_id) as teacher_open_course_schedule_session_id, t.teacher_open_course_schedule_session_status, t.teacher_open_course_id, @// 共多少天 From c68b28eb76d48b8545c07a26c09b41b4ed64329a Mon Sep 17 00:00:00 2001 From: Mlxa0324 <mlx950324@163.com> Date: Sat, 29 Oct 2022 08:57:46 +0800 Subject: [PATCH 4/4] 1 --- web/src/main/java/com/ibeetl/jlw/web/IndexController.java | 3 +-- web/src/main/resources/application-prod.properties | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/main/java/com/ibeetl/jlw/web/IndexController.java b/web/src/main/java/com/ibeetl/jlw/web/IndexController.java index 31794e32..6a99b619 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/IndexController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/IndexController.java @@ -1039,8 +1039,7 @@ public class IndexController { Long orgId = platformService.getCurrentOrgId(); MenuItem menuItem = platformService.getMenuItem(currentUser.getId(), orgId); -// UniversitiesCollegesJurisdictionExperimentalSystem uSystem = (UniversitiesCollegesJurisdictionExperimentalSystem)platformService.getOther(); - UniversitiesCollegesJurisdictionExperimentalSystem uSystem = null; + UniversitiesCollegesJurisdictionExperimentalSystem uSystem = (UniversitiesCollegesJurisdictionExperimentalSystem)platformService.getOther(); if(null != uSystem){ //子系统logo view.addObject("subsystemLogo",StringUtils.isNotBlank(uSystem.getSubsystemLogo())?uSystem.getSubsystemLogo():null); // 如果是空则用这个子系统默认的 diff --git a/web/src/main/resources/application-prod.properties b/web/src/main/resources/application-prod.properties index f059f06d..9f2c8e3d 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://116.205.131.177:3306/tianze-pro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true +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.username=tianze-pro spring.datasource.dynamic.datasource.master.password=xYR3A4EXCWxkHmNX spring.datasource.dynamic.datasource.master.hikari.max-lifetime=60000 @@ -66,4 +66,4 @@ dynamic.beetlsql.cs.dbStyle = org.beetl.sql.core.db.MySqlStyle dynamic.beetlsql.cs.dynamicConnectionSource = master,ds2 #\u6559\u5E08\u7AEF\u548C\u5B66\u751F\u7AEF\u7684\u767B\u5F55\u5730\u5740 -student.teacher.url = http://116.205.131.177:8080/ \ No newline at end of file +student.teacher.url = http://116.205.131.177:9090/ \ No newline at end of file