课程授权下拉列表

beetlsql3-dev
Mlxa0324 2 years ago
parent 3b394ac195
commit 63fbf7489d

@ -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" + "\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 != 0 \n" +
"\tAND tb.use_type IS NOT NULL \n" + "\tAND tb.use_type IS NOT NULL \n" +
"@if(!isEmpty(orgId) && orgId != 1) { \n" +
"\tAND tb.org_id = #orgId# \n" + "\tAND tb.org_id = #orgId# \n" +
"@} \n" +
"\tAND ( now() BETWEEN tb.use_start_time AND tb.use_end_time )\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" + "\tLEFT JOIN course_label td ON td.course_label_id = t.course_label_id \n" +
"\tAND td.course_label_status = 1\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" + " 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 != 0\n" +
" AND tb.use_type IS NOT NULL\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" + " 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" + " LEFT JOIN course_label td ON td.course_label_id = t.course_label_id\n" +
" AND td.course_label_status = 1\n" + " AND td.course_label_status = 1\n" +

@ -14,6 +14,7 @@ import org.beetl.sql.core.SQLReady;
import org.beetl.sql.core.SqlId; import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -159,8 +160,11 @@ public class UniversitiesCollegesJurisdictionCurriculumResourcesService extends
/** /**
* *
* *
*
* ResourcesCourseInfoAuthDetailsVO orgId
* @return * @return
*/ */
@Cacheable(value = "cache:core:getResourcesCourseInfoAuthDetails", key="#orgId", cacheManager="cacheManager1Hour")
public ResourcesCourseInfoAuthDetailsVO getResourcesCourseInfoAuthDetails(Long orgId) { public ResourcesCourseInfoAuthDetailsVO getResourcesCourseInfoAuthDetails(Long orgId) {
ResourcesCourseInfoAuthDetailsVO authDetailsVO = sqlManager.executeQueryOne( ResourcesCourseInfoAuthDetailsVO authDetailsVO = sqlManager.executeQueryOne(
new SQLReady("SELECT ? as org_id", orgId), ResourcesCourseInfoAuthDetailsVO.class); new SQLReady("SELECT ? as org_id", orgId), ResourcesCourseInfoAuthDetailsVO.class);

@ -0,0 +1,65 @@
<!--#
/* 公共的课程下拉框组件。
查询已经授权的课程
条件:
name 标签的name值
id 标签的ID值。
*/
var newId = !isEmpty(id) ? id : ('select_id_' + name + '_' + @cn.hutool.core.util.RandomUtil.randomString(10));
-->
<select name="${name!''}" id="${newId ! ''}" lay-verify="" lay-search>
<option value="">请选择</option>
</select>
<script type="text/javascript">
// 根据当前登录用户,获取授权的课程信息
var currentAuthCourseInfoDetails =
Common.getAjax('/jlw/universitiesCollegesJurisdictionCurriculumResources/getAuthDetailsByCacheUser.json').data;
// 应用课程类
var applicationCourseList = currentAuthCourseInfoDetails.applicationCourseList || [];
// 理论课程类
var theoryCourseList = currentAuthCourseInfoDetails.theoryCourseList || [];
// 考证课程类
var textualResearchCourseList = currentAuthCourseInfoDetails.textualResearchCourseList || [];
/**
* <select name="quiz">
* <option value="">请选择</option>
* <optgroup label="城市记忆">
* <option value="你工作的第一个城市">你工作的第一个城市?</option>
* </optgroup>
* <optgroup label="学生时代">
* <option value="你的工号">你的工号?</option>
* <option value="你最喜欢的老师">你最喜欢的老师?</option>
* </optgroup>
* </select>
*/
var ele = $('#${newId}');
ele.append('<optgroup label="应用课程类">');
for (let currentAuthCourseInfoDetail of applicationCourseList) {
$('#${newId}').append(
'<option value="'+ currentAuthCourseInfoDetail.courseInfoId +'">'+ currentAuthCourseInfoDetail.courseInfoName +'</option>')
}
ele.append('</optgroup>');
ele.append('<optgroup label="理论课程类">');
for (let currentAuthCourseInfoDetail of theoryCourseList) {
ele.append(
'<option value="'+ currentAuthCourseInfoDetail.courseInfoId +'">'+ currentAuthCourseInfoDetail.courseInfoName +'</option>')
}
ele.append('</optgroup>');
ele.append('<optgroup label="考证课程类">');
for (let currentAuthCourseInfoDetail of textualResearchCourseList) {
ele.append(
'<option value="'+ currentAuthCourseInfoDetail.courseInfoId +'">'+ currentAuthCourseInfoDetail.courseInfoName +'</option>')
}
ele.append('</optgroup>');
</script>

@ -18,10 +18,17 @@
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">课程筛选</label> <label class="layui-form-label">课程筛选</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<layui:simpleDictSelect style='layui-input-inline' <!--#// 注释 -->
type="course_info.course_info_name.course_info_status=1,course_info_type=1,find_in_set(course_label_id,(select group_concat(course_label_id) from course_label where course_label_status = 1))" <!--#// <layui:simpleDictSelect style='layui-input-inline'-->
id="courseInfoIds" name="courseInfoId_0" <!--#// type="course_info.course_info_name.course_info_status=1,course_info_type=1,-->
layFilter="select_courseInfoIds"/> <!--#// find_in_set(course_label_id,(select group_concat(course_label_id)-->
<!--#// from course_label where course_label_status = 1))"-->
<!--#// id="courseInfoIds" name="courseInfoId_0"-->
<!--#// layFilter="select_courseInfoIds"/>-->
<!--#// 注释 -->
<!--#// 查询授权的课程列表。自动根据身份判断 -->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId_0", "id": ""}) {} -->
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">

Loading…
Cancel
Save