Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
yangdj 2 years ago
commit 3523cd3521

@ -29,6 +29,10 @@ public class CourseInfo extends BaseEntity{
private Long courseInfoId ; private Long courseInfoId ;
// 全路径ID
private String courseInfoFullId;
//名称(课程名 或 章名 或 节名) //名称(课程名 或 章名 或 节名)
private String courseInfoName ; private String courseInfoName ;
@ -333,4 +337,11 @@ public class CourseInfo extends BaseEntity{
public String toString() { public String toString() {
return JSONUtil.toJsonStr(this); return JSONUtil.toJsonStr(this);
} }
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
public String getCourseInfoFullId() {
return this.courseInfoFullId;
}
} }

@ -108,6 +108,24 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
return ret; return ret;
} }
/**
* ID
* @param courseInfo
* @return
*/
public String getCourseInfoFullId(CourseInfo courseInfo) {
Long courseInfoId = courseInfo.getCourseInfoId();
Long courseInfoParentId = courseInfo.getCourseInfoParentId();
if (courseInfoParentId != null && !courseInfoParentId.equals(courseInfoId)) {
CourseInfo parentCi = getById(courseInfoParentId);
return getCourseInfoFullId(parentCi) + "_" + courseInfoId;
}
return courseInfoId.toString();
}
public CourseInfo add(CourseInfoQuery courseInfoQuery){ public CourseInfo add(CourseInfoQuery courseInfoQuery){
@ -132,6 +150,13 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
} }
} }
// 更新全路径ID
String courseInfoFullId = getCourseInfoFullId(courseInfo);
CourseInfo model = new CourseInfo();
model.setCourseInfoId(courseInfo.getCourseInfoId());
model.setCourseInfoFullId(courseInfoFullId);
updateTemplate(model);
return courseInfo; return courseInfo;
} }

@ -1,6 +1,8 @@
package com.ibeetl.jlw.service; package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.jlw.aliPay.utils.StringUtils; import cn.jlw.aliPay.utils.StringUtils;
import com.ibeetl.admin.core.service.CoreBaseService; import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.jlw.dao.CourseInfoDao; import com.ibeetl.jlw.dao.CourseInfoDao;
@ -16,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import static cn.jlw.util.ConvertM3U8.booleanMap; import static cn.jlw.util.ConvertM3U8.booleanMap;
@ -267,4 +270,25 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo>{
public List<ResourcesInfo> getValues (Object paras){ public List<ResourcesInfo> getValues (Object paras){
return sqlManager.select(SqlId.of("jlw.resourcesInfo.getResourcesInfoValues"),ResourcesInfo.class,paras); return sqlManager.select(SqlId.of("jlw.resourcesInfo.getResourcesInfoValues"),ResourcesInfo.class,paras);
} }
/**
*
* @param resourcesInfoIds
* @param courseId
*/
public void copy(String resourcesInfoIds, Long courseId) {
ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery();
resourcesInfoQuery.setResourcesInfoIds(resourcesInfoIds);
List<ResourcesInfo> list = getValuesByQuery(resourcesInfoQuery);
List<ResourcesInfo> insertList = CollectionUtil.emptyIfNull(list).stream().map(item -> {
item.setCourseInfoId(courseId);
item.setResourcesInfoId(null);
return item;
}).collect(Collectors.toList());
if (ObjectUtil.isEmpty(insertList)) {
insertBatch(insertList);
}
}
} }

@ -298,7 +298,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体 // 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery(); TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId()); signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(ip_signin.name()); signinLogQuery.setTeacherOpenCourseStudentSigninLogType(ip_signin.name());
@ -330,7 +330,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体 // 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery(); TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId()); signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(manual_signin.name()); signinLogQuery.setTeacherOpenCourseStudentSigninLogType(manual_signin.name());
@ -374,7 +374,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
// 构建实体 // 构建实体
TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery(); TeacherOpenCourseStudentSigninLogQuery signinLogQuery = new TeacherOpenCourseStudentSigninLogQuery();
signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingSessionTime(signinSetting.getTeacherOpenCourseStudentSigninSettingSessionTime().toString());
signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId()); signinLogQuery.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId()); signinLogQuery.setTeacherOpenCourseId(signinSetting.getTeacherOpenCourseId());
signinLogQuery.setTeacherOpenCourseStudentSigninLogType(code_signin.name()); signinLogQuery.setTeacherOpenCourseStudentSigninLogType(code_signin.name());

@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -39,13 +41,13 @@ import static cn.hutool.core.util.ArrayUtil.join;
*/ */
@Controller @Controller
@Validated
public class ResourcesInfoController{ public class ResourcesInfoController{
private final Log log = LogFactory.getLog(this.getClass()); private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/jlw/resourcesInfo"; private static final String MODEL = "/jlw/resourcesInfo";
private static final String API = "/api/resourcesInfo"; private static final String API = "/api/resourcesInfo";
@Autowired private ResourcesInfoService resourcesInfoService; @Autowired private ResourcesInfoService resourcesInfoService;
@Autowired private CourseInfoService courseInfoService; @Autowired private CourseInfoService courseInfoService;
@ -195,6 +197,22 @@ public class ResourcesInfoController{
} }
} }
/**
*
*
* @param resourcesInfoIds
* @param courseId
* @return
*/
@PostMapping(MODEL + "/copy.json")
@Function("resourcesInfo.add")
@ResponseBody
public JsonResult copy(@NotBlank(message = "资源IDs不能为空") String resourcesInfoIds, @NotNull(message = "课程ID不能为空") Long courseId){// courseId课程ID
resourcesInfoService.copy(resourcesInfoIds, courseId);
return JsonResult.success();
}
//批量设置章节 //批量设置章节
@PostMapping(MODEL + "/setCourseInfoId.json") @PostMapping(MODEL + "/setCourseInfoId.json")
@Function("resourcesInfo.edit") @Function("resourcesInfo.edit")
@ -285,4 +303,5 @@ public class ResourcesInfoController{
} }
} }

@ -12,6 +12,8 @@ import java.util.Date;
public class CourseInfoQuery extends PageParam { public class CourseInfoQuery extends PageParam {
@Query(name = "ID", display = false) @Query(name = "ID", display = false)
private Long courseInfoId; private Long courseInfoId;
@Query(name = "全路径ID", display = false)
private String courseInfoFullId;
@Query(name = "名称", display = true) @Query(name = "名称", display = true)
private String courseInfoName; private String courseInfoName;
@Query(name = "课程缩略图", display = false) @Query(name = "课程缩略图", display = false)
@ -184,6 +186,7 @@ public class CourseInfoQuery extends PageParam {
public CourseInfo pojo(){ public CourseInfo pojo(){
CourseInfo pojo = new CourseInfo(); CourseInfo pojo = new CourseInfo();
pojo.setCourseInfoId(this.getCourseInfoId()); pojo.setCourseInfoId(this.getCourseInfoId());
pojo.setCourseInfoFullId(this.getCourseInfoFullId());
pojo.setCourseInfoName(this.getCourseInfoName()); pojo.setCourseInfoName(this.getCourseInfoName());
pojo.setCourseInfoThumbnail(this.getCourseInfoThumbnail()); pojo.setCourseInfoThumbnail(this.getCourseInfoThumbnail());
pojo.setCourseLabelId(this.getCourseLabelId()); pojo.setCourseLabelId(this.getCourseLabelId());
@ -308,4 +311,12 @@ public class CourseInfoQuery extends PageParam {
public void setCourseInfoIdPlural(String courseInfoIdPlural) { public void setCourseInfoIdPlural(String courseInfoIdPlural) {
this.courseInfoIdPlural = courseInfoIdPlural; this.courseInfoIdPlural = courseInfoIdPlural;
} }
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
} }

@ -40,6 +40,11 @@ public class ResourcesInfoQuery extends PageParam {
private String courseInfoIds; private String courseInfoIds;
private String orgIdPlural; private String orgIdPlural;
/**
*
*/
private String courseInfoFullId;
public Long getResourcesInfoId(){ public Long getResourcesInfoId(){
return resourcesInfoId; return resourcesInfoId;
} }
@ -154,4 +159,12 @@ public class ResourcesInfoQuery extends PageParam {
public String getOrgIdPlural() { public String getOrgIdPlural() {
return orgIdPlural; return orgIdPlural;
} }
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
} }

@ -1,11 +1,13 @@
package com.ibeetl.jlw.web.query; package com.ibeetl.jlw.web.query;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.jlw.validate.ValidateConfig; import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam; import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog; import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog;
import com.ibeetl.jlw.enums.SignInTypeEnum; import com.ibeetl.jlw.enums.SignInTypeEnum;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@ -22,8 +24,8 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
private Long teacherOpenCourseStudentSigninSettingId; private Long teacherOpenCourseStudentSigninSettingId;
// 签到场次(时间) // 签到场次(时间)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date teacherOpenCourseStudentSigninSettingSessionTime; private String teacherOpenCourseStudentSigninSettingSessionTime;
@Query(name = "学生ID", display = false,type=Query.TYPE_DICT,dict="student.student_name.student_status=1") @Query(name = "学生ID", display = false,type=Query.TYPE_DICT,dict="student.student_name.student_status=1")
private Long studentId; private Long studentId;
@Query(name = "开课ID", display = false,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1") @Query(name = "开课ID", display = false,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
@ -151,7 +153,7 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
pojo.setTeacherOpenCourseStudentSigninLogIp(this.getTeacherOpenCourseStudentSigninLogIp()); pojo.setTeacherOpenCourseStudentSigninLogIp(this.getTeacherOpenCourseStudentSigninLogIp());
pojo.setTeacherOpenCourseStudentSigninLogTag(this.getTeacherOpenCourseStudentSigninLogTag()); pojo.setTeacherOpenCourseStudentSigninLogTag(this.getTeacherOpenCourseStudentSigninLogTag());
pojo.setTeacherOpenCourseStudentSigninSettingId(this.getTeacherOpenCourseStudentSigninSettingId()); pojo.setTeacherOpenCourseStudentSigninSettingId(this.getTeacherOpenCourseStudentSigninSettingId());
pojo.setTeacherOpenCourseStudentSigninSettingSessionTime(this.getTeacherOpenCourseStudentSigninSettingSessionTime()); pojo.setTeacherOpenCourseStudentSigninSettingSessionTime(DateUtil.parse(this.getTeacherOpenCourseStudentSigninSettingSessionTime()));
pojo.setOrgId(this.getOrgId()); pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId()); pojo.setUserId(this.getUserId());
return pojo; return pojo;
@ -216,11 +218,11 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
this.teacherOpenCourseStudentSigninSettingId = teacherOpenCourseStudentSigninSettingId; this.teacherOpenCourseStudentSigninSettingId = teacherOpenCourseStudentSigninSettingId;
} }
public Date getTeacherOpenCourseStudentSigninSettingSessionTime() { public String getTeacherOpenCourseStudentSigninSettingSessionTime() {
return teacherOpenCourseStudentSigninSettingSessionTime; return teacherOpenCourseStudentSigninSettingSessionTime;
} }
public void setTeacherOpenCourseStudentSigninSettingSessionTime(Date teacherOpenCourseStudentSigninSettingSessionTime) { public void setTeacherOpenCourseStudentSigninSettingSessionTime(String teacherOpenCourseStudentSigninSettingSessionTime) {
this.teacherOpenCourseStudentSigninSettingSessionTime = (teacherOpenCourseStudentSigninSettingSessionTime); this.teacherOpenCourseStudentSigninSettingSessionTime = (teacherOpenCourseStudentSigninSettingSessionTime);
} }

@ -28,6 +28,9 @@ queryByCondition
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){ @if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#) and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@} @}
@ -107,6 +110,9 @@ queryByConditionQuery
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){ @if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#) and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@} @}
@ -331,6 +337,9 @@ getCourseInfoValues
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){ @if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#) and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@} @}
@ -491,6 +500,9 @@ getValues
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){ @if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#) and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@} @}
@ -556,6 +568,9 @@ getValuesQuery
@if(!isEmpty(courseInfoId)){ @if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId# and t.course_info_id =#courseInfoId#
@} @}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){ @if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#) and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@} @}

@ -39,6 +39,9 @@ queryByCondition
@if(!isEmpty(orgIdPlural)){ @if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id, #orgIdPlural#) and find_in_set(t.org_id, #orgIdPlural#)
@} @}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(!isEmpty(addType)){ @if(!isEmpty(addType)){
and t.add_type =#addType# and t.add_type =#addType#
@} @}
@ -67,6 +70,7 @@ getValuesByQuery
select t.* select t.*
from resources_info t from resources_info t
left join course_info a on a.course_info_id = t.course_info_id
where 1=1 where 1=1
@if(!isEmpty(resourcesInfoIds)){ @if(!isEmpty(resourcesInfoIds)){
and find_in_set(t.resources_info_id,#resourcesInfoIds#) and find_in_set(t.resources_info_id,#resourcesInfoIds#)
@ -95,6 +99,9 @@ getValuesByQuery
@if(!isEmpty(addType)){ @if(!isEmpty(addType)){
and t.add_type =#addType# and t.add_type =#addType#
@} @}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(isEmpty(seeSelf) && !isEmpty(userId)){ @if(isEmpty(seeSelf) && !isEmpty(userId)){
and t.user_id =#userId# and t.user_id =#userId#
@} @}

@ -7,6 +7,7 @@ queryByCondition
t.* t.*
@} @}
from teacher_open_course_merge_student t from teacher_open_course_merge_student t
inner join student ta on ta.student_id = t.student_id and ta.student_status = 1
where 1=1 where 1=1
@//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行 @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("teacherOpenCourseMergeStudent.query")# and #function("teacherOpenCourseMergeStudent.query")#
@ -40,6 +41,9 @@ queryByCondition
@if(!isEmpty(studentId)){ @if(!isEmpty(studentId)){
and t.student_id =#studentId# and t.student_id =#studentId#
@} @}
@if(!isEmpty(studentSnOrName)){
and concat(ta.student_name, ta.student_sn) like #'%'+studentSnOrName+'%'#
@}
@if(!isEmpty(studentIdPlural)){ @if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#) and find_in_set(t.student_id,#studentIdPlural#)
@} @}
@ -55,6 +59,9 @@ queryByCondition
@if(!isEmpty(userIdPlural)){ @if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#) and find_in_set(t.user_id,#userIdPlural#)
@} @}
@if(!isEmpty(schoolClassIdPlural)){
and find_in_set(ta.class_id, #schoolClassIdPlural#)
@}
queryByConditionQuery queryByConditionQuery

@ -15,16 +15,17 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
, trigger: 'click' , trigger: 'click'
}); });
var data = []; var data = [];
var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/sessionDateList.json"); var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/sessionDateList.json", {"teacherOpenCourseId": teacherOpenCourseId});
if(ret.code==0){ if(ret.code==0){
data = ret.data; data = ret.data;
} }
/*var getTpl = opTime_demo.innerHTML var getTpl = opTime_demo.innerHTML
,view = document.getElementById('opTime_view'); ,view = document.getElementById('opTime_view');
laytpl(getTpl).render(data, function(html){ laytpl(getTpl).render(data, function(html){
view.innerHTML = html; view.innerHTML = html;
});*/ });
form.render();
var view ={ var view ={
init:function(){ init:function(){
var that = this var that = this
@ -98,7 +99,7 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'], hide: $.isEmpty(sx_['teacherOpenCourseIdText']) ? false : sx_['teacherOpenCourseIdText'],
}, },
{ {
field: 'teacherOpenCourseStudentSigninLogAddTime', field: 'teacherOpenCourseStudentSigninSettingSessionTime',
title: '签到日期', title: '签到日期',
align: "center", align: "center",
hideField: false, hideField: false,
@ -141,13 +142,13 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
}else{ }else{
} }
}) });
//触发行单击事件 //触发行单击事件
table.on('row(studentTable)', function(obj){ table.on('row(studentTable)', function(obj){
var param={ var param={
'teacherOpenCourseStudentSigninSettingId': teacherOpenCourseStudentSigninSettingId, 'teacherOpenCourseStudentSigninSettingId': teacherOpenCourseStudentSigninSettingId,
'teacherOpenCourseStudentSigninSettingSessionTime':$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(), 'teacherOpenCourseStudentSigninSettingSessionTime':$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
'studentSn':obj.data.studentInfo.studentSn 'studentId':obj.data.studentId
} }
teacherOpenCourseStudentSigninLogTable.reload({ teacherOpenCourseStudentSigninLogTable.reload({
@ -165,6 +166,7 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
var btn_s = $("#searchFormSearch"); var btn_s = $("#searchFormSearch");
btn_s.on('click', function () { btn_s.on('click', function () {
console.log($("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val())
var data = $("#searchForm").serializeJson(); var data = $("#searchForm").serializeJson();
teacherOpenCourseStudentSigninLogTable.reload({ teacherOpenCourseStudentSigninLogTable.reload({
where: data, where: data,
@ -273,10 +275,11 @@ layui.define([ 'form', 'laydate', 'table','laytpl'], function(exports) {
function getParam_s(){ function getParam_s(){
var param = { var param = {
"teacherOpenCourseStudentSigninSettingSessionTime":$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(), "teacherOpenCourseStudentSigninSettingSessionTime":$("select[name='teacherOpenCourseStudentSigninSettingSessionTime']").val(),
"classId":$("#studentForm select[name='classId']").val(), "schoolClassIdPlural":$("#studentForm select[name='classId']").val(),
"studentOrName":$("#studentForm input[name='studentOrName']").val(), "studentSnOrName":$("#studentForm input[name='studentOrName']").val(),
'teacherOpenCourseId':teacherOpenCourseId 'teacherOpenCourseId':teacherOpenCourseId
}; };
return param return param
} }
exports('index',view); exports('index',view);

@ -88,7 +88,7 @@
<label class="layui-form-label" style="width: 80px">归属课程:</label> <label class="layui-form-label" style="width: 80px">归属课程:</label>
<div class="layui-input-block" style="margin-left: -80px;"> <div class="layui-input-block" style="margin-left: -80px;">
<layui:simpleDictSelect style='layui-input-block' <layui:simpleDictSelect style='layui-input-block'
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))" type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find_in_set(course_label_id,(select group_concat(course_label_id) from course_label where course_label_status = 1))"
id="courseInfoIds" name="courseInfoId_1" id="courseInfoIds" name="courseInfoId_1"
layFilter="select_courseInfoIds"/> layFilter="select_courseInfoIds"/>
</div> </div>
@ -135,7 +135,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label" style="width: 80px">内容:</label> <label class="layui-form-label" style="width: 80px">内容:</label>
<div class="layui-input-inline" style="width: 60% !important;min-width: 500px;"> <div class="layui-input-inline" style="width: 60% !important;min-width: 500px;">
<textarea id="resourcesInfoFiles" name="resourcesInfoFiles" style="display:none;"></textarea> <textarea id="resourcesInfoContent" name="resourcesInfoContent" style="display:none;"></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -180,15 +180,16 @@
//拖拽上传 //拖拽上传
upload.render({ upload.render({
elem: '#resourcesUpload' elem: '#resourcesUpload'
,url: Common.ctxPath + '/jlw/file/update.do' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。 ,url: Common.ctxPath + '/jlw/file/update.do'
,done: function(res){ ,done: function(res){
layer.msg('上传成功'); layer.msg('上传成功');
layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', Common.ctxPath + res.data.src); layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', Common.ctxPath + res.data.src);
} }
}); });
var uploadInst = upload.render({ var uploadInst = upload.render({
elem: '#test1' //绑定元素 elem: '#test1' //上传图文
, url: Common.ctxPath + '/jlw/file/update.do' , url: Common.ctxPath + '/jlw/file/update.do'
,accept:'file'
, done: function (res) { , done: function (res) {
//上传完毕回调 //上传完毕回调
layer.msg('上传成功'); layer.msg('上传成功');
@ -199,10 +200,13 @@
}); });
var courseInfoTable = function () { var courseInfoTable = function () {
layer.load(1);
var data=[];
setTimeout(function () {
var ret = Common.getAjax("/jlw/courseInfo/getCourseResources.json", {courseInfoId: courseInfoParentId}); var ret = Common.getAjax("/jlw/courseInfo/getCourseResources.json", {courseInfoId: courseInfoParentId});
var data = ret.data; data = ret.data;
if (ret.code == 0) { if(ret.code == 0){
ret.data.forEach(item => { data.forEach(item => {
item.resourcesInfo.forEach(function (e, i) { item.resourcesInfo.forEach(function (e, i) {
e.courseInfoParentId = e.courseInfoId; e.courseInfoParentId = e.courseInfoId;
e.courseInfoId = 0; e.courseInfoId = 0;
@ -210,7 +214,6 @@
data.push(e); data.push(e);
}) })
}); });
}
treetable.render({ treetable.render({
elem: '#courseInfoTable', elem: '#courseInfoTable',
height: Lib.getTableHeight(1), height: Lib.getTableHeight(1),
@ -244,6 +247,7 @@
{ {
field: 'resourcesInfoType', field: 'resourcesInfoType',
title: '资源类型', title: '资源类型',
width:120,
align: "center", align: "center",
templet: function (d) { templet: function (d) {
//资源类型(1视频 2PPT 3PDF 4链接 5图片) //资源类型(1视频 2PPT 3PDF 4链接 5图片)
@ -297,6 +301,9 @@
} }
]] ]]
}); });
layer.closeAll();
}
}, 10);
}; };
courseInfoTable(); courseInfoTable();
/*新增章目录*/ /*新增章目录*/
@ -335,16 +342,15 @@
}; };
addOpen("",'子章节名称',"",param); addOpen("",'子章节名称',"",param);
}else if (obj.event === 'updataResources') {//上传资源 }else if (obj.event === 'updataResources') {//上传资源
var that = this;
updataResourcesOpen(); updataResourcesOpen();
}else if (obj.event === 'addLine') {//添加链接 }else if (obj.event === 'addLine') {//添加链接
addLine(); addLine(data.courseInfoId);
} else if (obj.event === 'addPW') {//添加图文 } else if (obj.event === 'addPW') {//添加图文
addPW(); addPW(data.courseInfoId);
}else if (obj.event === 'look') {//查看 }else if (obj.event === 'look') {//查看
Lib.downloadFile(data); Lib.downloadFile(data);
}else if (obj.event === 'update') {//上传 }else if (obj.event === 'update') {//上传
updataResourcesOpenLocal(); updataResourcesOpen();
}else if(obj.event === 'edit'){ }else if(obj.event === 'edit'){
var title="章节目录"; var title="章节目录";
var param = {}; var param = {};
@ -571,7 +577,7 @@
/*资源表格搜索*/ /*资源表格搜索*/
function searchList() { function searchList() {
var param = { var param = {
"courseInfoId": $("#edit_dialog select[name='courseInfoId_1']").val(), "courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(),
"resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val() "resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val()
}; };
resourcesTable.reload({ resourcesTable.reload({
@ -583,7 +589,7 @@
} }
/*添加链接*/ /*添加链接*/
function addLine() { function addLine(courseInfoId) {
layer.open({ layer.open({
type: 1, type: 1,
title: "添加链接", title: "添加链接",
@ -591,7 +597,6 @@
btn: ['保存', '关闭'], btn: ['保存', '关闭'],
content: $("#addLine_dialog"), content: $("#addLine_dialog"),
success: function (layero, index) { success: function (layero, index) {
}, yes: function (index) { }, yes: function (index) {
var resourcesInfoName = $("#addLine_dialog input[name='resourcesInfoName']").val(); var resourcesInfoName = $("#addLine_dialog input[name='resourcesInfoName']").val();
var resourcesInfoContent = $("#addLine_dialog input[name='resourcesInfoContent']").val(); var resourcesInfoContent = $("#addLine_dialog input[name='resourcesInfoContent']").val();
@ -611,30 +616,41 @@
}); });
return; return;
} }
var param = {resourcesInfoName: resourcesInfoName, resourcesInfoContent: resourcesInfoContent,resourcesInfoType:4}; var param = {
Common.info("保存成功!!"); 'resourcesInfoName': resourcesInfoName,
console.log(param) 'resourcesInfoContent': resourcesInfoContent,
layer.close(index); 'resourcesInfoType':4,
return; 'courseInfoId':courseInfoId
var ret = Common.postAjax("/jlw/courseInfo/edit.json", param); };
layer.load(0,{
shadeClose: false,
shade: [0.5]
});
setTimeout(function () {
var ret = Common.postAjax("/jlw/resourcesInfo/add.json", param);
layer.close();
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, { layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'], offset: ['50%'],
icon: ret.code == 0 ? 1 : 2, icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒 time: 1500 //2秒关闭如果不配置默认是3秒
}, function () { },function () {
if (ret.code == 0) { if (ret.code == 0) {
courseInfoTable();
layer.close(index); layer.close(index);
} }
}); });
}, 50);
}, btn2: function (index, layero) { }, btn2: function (index, layero) {
layer.close(index); layer.close(index);
} }
}); });
} }
var courseInfoContent_ = layedit.build('resourcesInfoFiles', {height: 200}); //题干 var courseInfoContent_ = layedit.build('resourcesInfoContent', {height: 200}); //题干
/*添加图文*/ /*添加图文*/
function addPW() { function addPW(courseInfoId) {
layer.open({ layer.open({
type: 1, type: 1,
title: "添加图文", title: "添加图文",
@ -645,30 +661,40 @@
}, yes: function (index) { }, yes: function (index) {
var resourcesInfoName = $("#addPW_dialog input[name='resourcesInfoName']").val(); var resourcesInfoName = $("#addPW_dialog input[name='resourcesInfoName']").val();
var resourcesInfoFiles = layedit.getContent(courseInfoContent_); var resourcesInfoContent = layedit.getContent(courseInfoContent_);
if ($.isEmpty(resourcesInfoName)) { if ($.isEmpty(resourcesInfoName)) {
layer.msg("请输入资源名称!", { layer.msg("请输入图文名称!", {
offset: ['50%'], offset: ['50%'],
icon: 2, icon: 2,
time: 2000 //2秒关闭如果不配置默认是3秒 time: 2000 //2秒关闭如果不配置默认是3秒
}); });
return; return;
} }
var param = {resourcesInfoName: resourcesInfoName, resourcesInfoFiles: resourcesInfoFiles}; var param = {
Common.info("保存成功!!"); 'resourcesInfoName': resourcesInfoName,
console.log(param) 'resourcesInfoContent': resourcesInfoContent,
layer.close(index); 'resourcesInfoType':5,
return; 'courseInfoId':courseInfoId
var ret = Common.postAjax("/jlw/courseInfo/edit.json", param); };
layer.load(0,{
shadeClose: false,
shade: [0.5]
});
setTimeout(function () {
var ret = Common.postAjax("/jlw/resourcesInfo/add.json", param);
layer.close();
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, { layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'], offset: ['50%'],
icon: ret.code == 0 ? 1 : 2, icon: ret.code == 0 ? 1 : 2,
time: 1500 //2秒关闭如果不配置默认是3秒 time: 1500 //2秒关闭如果不配置默认是3秒
}, function () { }, function () {
if (ret.code == 0) { if (ret.code == 0) {
layer.close(index); layer.close(index)
courseInfoTable();
} }
}); });
}, 10);
}, btn2: function (index, layero) { }, btn2: function (index, layero) {
layer.close(index); layer.close(index);
} }

@ -29,12 +29,7 @@
<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">
<select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="" id="opTime_view"> <select name="teacherOpenCourseStudentSigninSettingSessionTime" lay-verify="" id="opTime_view"> </select>
<option value="">请选择</option>
<option value="2022-07-07">2022-07-07</option>
<option value="2022-08-07">2022-08-07</option>
<option value="2022-09-07">2022-09-07</option>
</select>
<!--<input type="text" name="" placeholder="teacherOpenCourseStudentSigninSettingSessionTime" <!--<input type="text" name="" placeholder="teacherOpenCourseStudentSigninSettingSessionTime"
autocomplete="off" class="layui-input" id="test5">--> autocomplete="off" class="layui-input" id="test5">-->
</div> </div>
@ -63,7 +58,12 @@
</div> </div>
<input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/> <input type="hidden" name="teacherOpenCourseId" autocomplete="off" class="layui-input" value="${teacherOpenCourseId}"/>
<!--#} --> <!--#} -->
<script id="opTime_demo" type="text/html">
<option value="">请选择</option>
{{# layui.each(d, function(index, item){ }}
<option value="{{item}}">{{item}}</option>
{{# }); }}
</script>
<!--<script type="text/html" id="toolbar_teacherOpenCourseStudentSigninLog"> <!--<script type="text/html" id="toolbar_teacherOpenCourseStudentSigninLog">
<div class="layui-btn-container"> <div class="layui-btn-container">
<div class="layui-btn-group" > <div class="layui-btn-group" >

Loading…
Cancel
Save