From 63fbf7489dcc5d0ed829087eea159849c5827be1 Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Thu, 16 Mar 2023 22:47:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8E=88=E6=9D=83=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/ResourcesCourseInfoAuthDetailsVO.java | 6 +- ...urisdictionCurriculumResourcesService.java | 4 ++ .../templates/common/courseInfoSelect.html | 65 +++++++++++++++++++ .../jlw/resourcesQuestion/index.html | 15 +++-- 4 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 web/src/main/resources/templates/common/courseInfoSelect.html diff --git a/web/src/main/java/com/ibeetl/jlw/entity/vo/ResourcesCourseInfoAuthDetailsVO.java b/web/src/main/java/com/ibeetl/jlw/entity/vo/ResourcesCourseInfoAuthDetailsVO.java index b4dc00a6..c52dc9f2 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/vo/ResourcesCourseInfoAuthDetailsVO.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/vo/ResourcesCourseInfoAuthDetailsVO.java @@ -58,7 +58,9 @@ public class ResourcesCourseInfoAuthDetailsVO extends BaseEntity { "\tLEFT JOIN universities_colleges_jurisdiction_experimental_system tb ON tb.type_id = ta.resources_application_id \n" + "\tAND tb.use_type != 0 \n" + "\tAND tb.use_type IS NOT NULL \n" + + "@if(!isEmpty(orgId) && orgId != 1) { \n" + "\tAND tb.org_id = #orgId# \n" + + "@} \n" + "\tAND ( now() BETWEEN tb.use_start_time AND tb.use_end_time )\n" + "\tLEFT JOIN course_label td ON td.course_label_id = t.course_label_id \n" + "\tAND td.course_label_status = 1\n" + @@ -85,7 +87,9 @@ public class ResourcesCourseInfoAuthDetailsVO extends BaseEntity { " LEFT JOIN universities_colleges_jurisdiction_curriculum_resources tb ON tb.course_info_id = t.course_info_id\n" + " AND tb.use_type != 0\n" + " AND tb.use_type IS NOT NULL\n" + - " AND tb.org_id = #orgId#\n" + + " @if(!isEmpty(orgId) && orgId != 1) { \n" + + " \tAND tb.org_id = #orgId# \n" + + " @} \n" + " AND ( now() BETWEEN tb.use_start_time AND tb.use_end_time )\n" + " LEFT JOIN course_label td ON td.course_label_id = t.course_label_id\n" + " AND td.course_label_status = 1\n" + diff --git a/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesJurisdictionCurriculumResourcesService.java b/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesJurisdictionCurriculumResourcesService.java index a2e42340..71a1d130 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesJurisdictionCurriculumResourcesService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/UniversitiesCollegesJurisdictionCurriculumResourcesService.java @@ -14,6 +14,7 @@ import org.beetl.sql.core.SQLReady; import org.beetl.sql.core.SqlId; import org.beetl.sql.core.engine.PageQuery; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -159,8 +160,11 @@ public class UniversitiesCollegesJurisdictionCurriculumResourcesService extends /** * 获取所有授权的课程 * 应用课程类、理论课程类、考证课程类(不需要授权默认可以查询所有的) + * + * ResourcesCourseInfoAuthDetailsVO 里面,判断了orgId 是否是超管 * @return */ + @Cacheable(value = "cache:core:getResourcesCourseInfoAuthDetails", key="#orgId", cacheManager="cacheManager1Hour") public ResourcesCourseInfoAuthDetailsVO getResourcesCourseInfoAuthDetails(Long orgId) { ResourcesCourseInfoAuthDetailsVO authDetailsVO = sqlManager.executeQueryOne( new SQLReady("SELECT ? as org_id", orgId), ResourcesCourseInfoAuthDetailsVO.class); diff --git a/web/src/main/resources/templates/common/courseInfoSelect.html b/web/src/main/resources/templates/common/courseInfoSelect.html new file mode 100644 index 00000000..6bb3f700 --- /dev/null +++ b/web/src/main/resources/templates/common/courseInfoSelect.html @@ -0,0 +1,65 @@ + + + + diff --git a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html index f7f8b5b7..26dadb8b 100644 --- a/web/src/main/resources/templates/jlw/resourcesQuestion/index.html +++ b/web/src/main/resources/templates/jlw/resourcesQuestion/index.html @@ -18,10 +18,17 @@
- + + + + + + + + + + +