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 @@