diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/util/beetl/DataTableName.java b/admin-core/src/main/java/com/ibeetl/admin/core/util/beetl/DataTableName.java index b9b300a4..66d55442 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/util/beetl/DataTableName.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/util/beetl/DataTableName.java @@ -1,5 +1,6 @@ package com.ibeetl.admin.core.util.beetl; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ReflectUtil; import cn.hutool.extra.spring.SpringUtil; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; @@ -8,8 +9,10 @@ import org.apache.commons.lang3.StringUtils; import org.beetl.core.Context; import org.beetl.core.Function; import org.beetl.sql.ext.spring.SpringConnectionSource; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import java.lang.reflect.Method; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -17,6 +20,8 @@ import java.util.concurrent.ConcurrentHashMap; //1商品分类 2商品 3文章分类 4文章 5商品属性 6适用场合 7品牌 8Region @Component public class DataTableName implements Function { + + @Resource Environment env; public volatile Map dataSourceMap = new ConcurrentHashMap<>(); @Override @@ -27,14 +32,22 @@ public class DataTableName implements Function { } private String getDatabaseName(String sourceName) { + // 如果没有获取到当前的sourceName + String sqlManagers = env.getProperty("dynamic.beetlsql.sqlManagers", String.class); + Assert.notBlank(sqlManagers, "dynamic.beetlsql.sqlManagers 至少需要设置一个数据源"); + // 取设置的sqlManagers 第一个值。 if (StringUtils.isBlank(sourceName)) { - sourceName = "master"; + sourceName = sqlManagers.split(",")[0]; } + + // 缓存判断 String s = dataSourceMap.get(sourceName); if (StringUtils.isNotBlank(s)) { return s; } + + // 取当前线程对应的 ibeetlSQL数据源Bean String beanName = sourceName + "BeetlSqlDataSourceBean"; SpringConnectionSource cs = SpringUtil.getBean(beanName, SpringConnectionSource.class); JdbcConnection delegate = (JdbcConnection)ReflectUtil.getFieldValue(cs.getMetaData(), "delegate"); diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninLogDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninLogDao.java new file mode 100644 index 00000000..f531084d --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninLogDao.java @@ -0,0 +1,25 @@ +package com.ibeetl.jlw.dao; + +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninLogQuery; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.mapper.BaseMapper; +import org.beetl.sql.mapper.annotation.SqlResource; +import org.beetl.sql.mapper.annotation.Update; + +import java.util.List; + +/** + * 学生签到记录 Dao + */ +@SqlResource("jlw.teacherOpenCourseStudentSigninLog") +public interface TeacherOpenCourseStudentSigninLogDao extends BaseMapper{ + PageQuery queryByCondition(PageQuery query); + PageQuery queryByConditionQuery(PageQuery query); + @Update + void deleteTeacherOpenCourseStudentSigninLogByIds(String ids); + @Update + int updateGivenByIds(TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery); + List getByIds(String ids); + List getValuesByQuery(TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery); +} diff --git a/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninSettingDao.java b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninSettingDao.java new file mode 100644 index 00000000..ff9aabf3 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/dao/TeacherOpenCourseStudentSigninSettingDao.java @@ -0,0 +1,25 @@ +package com.ibeetl.jlw.dao; + +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninSettingQuery; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.mapper.BaseMapper; +import org.beetl.sql.mapper.annotation.SqlResource; +import org.beetl.sql.mapper.annotation.Update; + +import java.util.List; + +/** + * 学生签到设置 Dao + */ +@SqlResource("jlw.teacherOpenCourseStudentSigninSetting") +public interface TeacherOpenCourseStudentSigninSettingDao extends BaseMapper{ + PageQuery queryByCondition(PageQuery query); + PageQuery queryByConditionQuery(PageQuery query); + @Update + void deleteTeacherOpenCourseStudentSigninSettingByIds(String ids); + @Update + int updateGivenByIds(TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery); + List getByIds(String ids); + List getValuesByQuery(TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery); +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninLog.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninLog.java new file mode 100644 index 00000000..f5d41126 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninLog.java @@ -0,0 +1,181 @@ +package com.ibeetl.jlw.entity; + +import com.ibeetl.admin.core.annotation.Dict; +import com.ibeetl.admin.core.entity.BaseEntity; +import com.ibeetl.admin.core.util.ValidateConfig; +import org.beetl.sql.annotation.entity.AssignID; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/* +* 教师-我的课程-开课-学生签到记录 +* gen by Spring Boot2 Admin 2022-09-18 +*/ +public class TeacherOpenCourseStudentSigninLog extends BaseEntity{ + + //ID + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + // @SeqID(name = ORACLE_CORE_SEQ_NAME) + @AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog") + + private Long teacherOpenCourseStudentSigninId ; + + //学生ID + @Dict(type="student.student_name.student_status=1") + + private Long studentId ; + + //开课ID + @Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1") + + private Long openCourseId ; + + //班级ID + @Dict(type="school_class.class_name.class_status=1") + + private String schoolClassId ; + + //签到日期 + + private Date addTime ; + + //签到方式 (数据字典 student_signin_type) + @Dict(type="student_signin_type") + + private String type ; + + //备注(缺勤理由) + + private String remark ; + + //组织ID + + private Long orgId ; + + //用户ID + + private Long userId ; + + public TeacherOpenCourseStudentSigninLog(){ + } + + /**ID + *@return + */ + public Long getTeacherOpenCourseStudentSigninId(){ + return teacherOpenCourseStudentSigninId; + } + /**ID + *@param teacherOpenCourseStudentSigninId + */ + public void setTeacherOpenCourseStudentSigninId(Long teacherOpenCourseStudentSigninId){ + this.teacherOpenCourseStudentSigninId = teacherOpenCourseStudentSigninId; + } + + /**学生ID + *@return + */ + public Long getStudentId(){ + return studentId; + } + /**学生ID + *@param studentId + */ + public void setStudentId(Long studentId){ + this.studentId = studentId; + } + + /**开课ID + *@return + */ + public Long getOpenCourseId(){ + return openCourseId; + } + /**开课ID + *@param openCourseId + */ + public void setOpenCourseId(Long openCourseId){ + this.openCourseId = openCourseId; + } + + /**班级ID + *@return + */ + public String getSchoolClassId(){ + return schoolClassId; + } + /**班级ID + *@param schoolClassId + */ + public void setSchoolClassId(String schoolClassId){ + this.schoolClassId = schoolClassId; + } + + /**签到日期 + *@return + */ + public Date getAddTime(){ + return addTime; + } + /**签到日期 + *@param addTime + */ + public void setAddTime(Date addTime){ + this.addTime = addTime; + } + + /**签到方式 (数据字典 student_signin_type) + *@return + */ + public String getType(){ + return type; + } + /**签到方式 (数据字典 student_signin_type) + *@param type + */ + public void setType(String type){ + this.type = type; + } + + /**备注(缺勤理由) + *@return + */ + public String getRemark(){ + return remark; + } + /**备注(缺勤理由) + *@param remark + */ + public void setRemark(String remark){ + this.remark = remark; + } + + /**组织ID + *@return + */ + public Long getOrgId(){ + return orgId; + } + /**组织ID + *@param orgId + */ + public void setOrgId(Long orgId){ + this.orgId = orgId; + } + + /**用户ID + *@return + */ + public Long getUserId(){ + return userId; + } + /**用户ID + *@param userId + */ + public void setUserId(Long userId){ + this.userId = userId; + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninSetting.java b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninSetting.java new file mode 100644 index 00000000..ccfc15be --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/TeacherOpenCourseStudentSigninSetting.java @@ -0,0 +1,163 @@ +package com.ibeetl.jlw.entity; + +import com.ibeetl.admin.core.annotation.Dict; +import com.ibeetl.admin.core.entity.BaseEntity; +import com.ibeetl.admin.core.util.ValidateConfig; +import org.beetl.sql.annotation.entity.AssignID; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/* +* 教师-我的课程-开课-学生签到-配置 +* gen by Spring Boot2 Admin 2022-09-18 +*/ +public class TeacherOpenCourseStudentSigninSetting extends BaseEntity{ + + //ID + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + // @SeqID(name = ORACLE_CORE_SEQ_NAME) + @AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting") + + private Long teacherOpenCourseStudentSigninSettingId ; + + //开课ID + @Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1") + + private Long openCourseId ; + + //班级ID + @Dict(type="school_class.class_name.class_status=1") + + private Long schoolClassId ; + + //签到方式 (数据字典 student_signin_type) + @Dict(type="student_signin_type") + + private String type ; + + //设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置 + + private String value ; + + //组织ID + + private Long orgId ; + + //用户ID + + private Long userId ; + + //创建时间 + + private Date createTime ; + + public TeacherOpenCourseStudentSigninSetting(){ + } + + /**ID + *@return + */ + public Long getTeacherOpenCourseStudentSigninSettingId(){ + return teacherOpenCourseStudentSigninSettingId; + } + /**ID + *@param teacherOpenCourseStudentSigninSettingId + */ + public void setTeacherOpenCourseStudentSigninSettingId(Long teacherOpenCourseStudentSigninSettingId){ + this.teacherOpenCourseStudentSigninSettingId = teacherOpenCourseStudentSigninSettingId; + } + + /**开课ID + *@return + */ + public Long getOpenCourseId(){ + return openCourseId; + } + /**开课ID + *@param openCourseId + */ + public void setOpenCourseId(Long openCourseId){ + this.openCourseId = openCourseId; + } + + /**班级ID + *@return + */ + public Long getSchoolClassId(){ + return schoolClassId; + } + /**班级ID + *@param schoolClassId + */ + public void setSchoolClassId(Long schoolClassId){ + this.schoolClassId = schoolClassId; + } + + /**签到方式 (数据字典 student_signin_type) + *@return + */ + public String getType(){ + return type; + } + /**签到方式 (数据字典 student_signin_type) + *@param type + */ + public void setType(String type){ + this.type = type; + } + + /**设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置 + *@return + */ + public String getValue(){ + return value; + } + /**设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置 + *@param value + */ + public void setValue(String value){ + this.value = value; + } + + /**组织ID + *@return + */ + public Long getOrgId(){ + return orgId; + } + /**组织ID + *@param orgId + */ + public void setOrgId(Long orgId){ + this.orgId = orgId; + } + + /**用户ID + *@return + */ + public Long getUserId(){ + return userId; + } + /**用户ID + *@param userId + */ + public void setUserId(Long userId){ + this.userId = userId; + } + + /**创建时间 + *@return + */ + public Date getCreateTime(){ + return createTime; + } + /**创建时间 + *@param createTime + */ + public void setCreateTime(Date createTime){ + this.createTime = createTime; + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninLogService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninLogService.java new file mode 100644 index 00000000..9784f492 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninLogService.java @@ -0,0 +1,147 @@ +package com.ibeetl.jlw.service; + +import cn.jlw.util.ToolUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ibeetl.admin.core.service.CoreBaseService; +import com.ibeetl.admin.core.util.PlatformException; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.admin.core.web.JsonReturnCode; +import com.ibeetl.jlw.dao.TeacherOpenCourseStudentSigninLogDao; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninLogQuery; +import org.apache.commons.lang3.StringUtils; +import org.beetl.sql.core.SqlId; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 学生签到记录 Service + * 当分布式ID开启后请勿使用insert(*,true) + */ + +@Service +@Transactional +public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService{ + + @Resource private TeacherOpenCourseStudentSigninLogDao teacherOpenCourseStudentSigninLogDao; + + public PageQueryqueryByCondition(PageQuery query){ + PageQuery ret = teacherOpenCourseStudentSigninLogDao.queryByCondition(query); + queryListAfter(ret.getList()); + return ret; + } + + public PageQueryqueryByConditionQuery(PageQuery query){ + PageQuery ret = teacherOpenCourseStudentSigninLogDao.queryByConditionQuery(query); + queryListAfter(ret.getList()); + return ret; + } + + public void deleteByList(List list){ + String ids = ""; + ToolUtils.deleteNullList(list); + for(int i=0;null != list && i teacherOpenCourseStudentSigninLogList = new ArrayList<>(); + try { + teacherOpenCourseStudentSigninLogList = JSON.parseArray(teacherOpenCourseStudentSigninLogQuery.getTeacherOpenCourseStudentSigninLogJsonStr(), TeacherOpenCourseStudentSigninLog.class); + } catch (Exception e) { + try { + teacherOpenCourseStudentSigninLogList.add(JSONObject.parseObject(teacherOpenCourseStudentSigninLogQuery.getTeacherOpenCourseStudentSigninLogJsonStr(), TeacherOpenCourseStudentSigninLog.class)); + } catch (Exception e1) {} + } + ToolUtils.deleteNullList(teacherOpenCourseStudentSigninLogList); + if(null != teacherOpenCourseStudentSigninLogList && teacherOpenCourseStudentSigninLogList.size()>0){ + for(int i=0;i 0; + if(!flag){ + msg = "更新指定参数失败"; + } + }else{ + msg = "指定参数为空"; + } + return msg; + } + + public List getValues (Object paras){ + return sqlManager.select(SqlId.of("jlw.teacherOpenCourseStudentSigninLog.getTeacherOpenCourseStudentSigninLogValues"), TeacherOpenCourseStudentSigninLog.class, paras); + } + + public List getValuesByQuery (TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery){ + return teacherOpenCourseStudentSigninLogDao.getValuesByQuery(teacherOpenCourseStudentSigninLogQuery); + } + + public TeacherOpenCourseStudentSigninLog getInfo (Long teacherOpenCourseStudentSigninId){ + TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery = new TeacherOpenCourseStudentSigninLogQuery(); + teacherOpenCourseStudentSigninLogQuery.setTeacherOpenCourseStudentSigninId(teacherOpenCourseStudentSigninId); + List list = teacherOpenCourseStudentSigninLogDao.getValuesByQuery(teacherOpenCourseStudentSigninLogQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public TeacherOpenCourseStudentSigninLog getInfo (TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery){ + List list = teacherOpenCourseStudentSigninLogDao.getValuesByQuery(teacherOpenCourseStudentSigninLogQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninSettingService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninSettingService.java new file mode 100644 index 00000000..9ad90869 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseStudentSigninSettingService.java @@ -0,0 +1,147 @@ +package com.ibeetl.jlw.service; + +import cn.jlw.util.ToolUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ibeetl.admin.core.service.CoreBaseService; +import com.ibeetl.admin.core.util.PlatformException; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.admin.core.web.JsonReturnCode; +import com.ibeetl.jlw.dao.TeacherOpenCourseStudentSigninSettingDao; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninSettingQuery; +import org.apache.commons.lang3.StringUtils; +import org.beetl.sql.core.SqlId; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 学生签到设置 Service + * 当分布式ID开启后请勿使用insert(*,true) + */ + +@Service +@Transactional +public class TeacherOpenCourseStudentSigninSettingService extends CoreBaseService{ + + @Resource private TeacherOpenCourseStudentSigninSettingDao teacherOpenCourseStudentSigninSettingDao; + + public PageQueryqueryByCondition(PageQuery query){ + PageQuery ret = teacherOpenCourseStudentSigninSettingDao.queryByCondition(query); + queryListAfter(ret.getList()); + return ret; + } + + public PageQueryqueryByConditionQuery(PageQuery query){ + PageQuery ret = teacherOpenCourseStudentSigninSettingDao.queryByConditionQuery(query); + queryListAfter(ret.getList()); + return ret; + } + + public void deleteByList(List list){ + String ids = ""; + ToolUtils.deleteNullList(list); + for(int i=0;null != list && i teacherOpenCourseStudentSigninSettingList = new ArrayList<>(); + try { + teacherOpenCourseStudentSigninSettingList = JSON.parseArray(teacherOpenCourseStudentSigninSettingQuery.getTeacherOpenCourseStudentSigninSettingJsonStr(), TeacherOpenCourseStudentSigninSetting.class); + } catch (Exception e) { + try { + teacherOpenCourseStudentSigninSettingList.add(JSONObject.parseObject(teacherOpenCourseStudentSigninSettingQuery.getTeacherOpenCourseStudentSigninSettingJsonStr(), TeacherOpenCourseStudentSigninSetting.class)); + } catch (Exception e1) {} + } + ToolUtils.deleteNullList(teacherOpenCourseStudentSigninSettingList); + if(null != teacherOpenCourseStudentSigninSettingList && teacherOpenCourseStudentSigninSettingList.size()>0){ + for(int i=0;i 0; + if(!flag){ + msg = "更新指定参数失败"; + } + }else{ + msg = "指定参数为空"; + } + return msg; + } + + public List getValues (Object paras){ + return sqlManager.select(SqlId.of("jlw.teacherOpenCourseStudentSigninSetting.getTeacherOpenCourseStudentSigninSettingValues"), TeacherOpenCourseStudentSigninSetting.class, paras); + } + + public List getValuesByQuery (TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery){ + return teacherOpenCourseStudentSigninSettingDao.getValuesByQuery(teacherOpenCourseStudentSigninSettingQuery); + } + + public TeacherOpenCourseStudentSigninSetting getInfo (Long teacherOpenCourseStudentSigninSettingId){ + TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery = new TeacherOpenCourseStudentSigninSettingQuery(); + teacherOpenCourseStudentSigninSettingQuery.setTeacherOpenCourseStudentSigninSettingId(teacherOpenCourseStudentSigninSettingId); + List list = teacherOpenCourseStudentSigninSettingDao.getValuesByQuery(teacherOpenCourseStudentSigninSettingQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public TeacherOpenCourseStudentSigninSetting getInfo (TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery){ + List list = teacherOpenCourseStudentSigninSettingDao.getValuesByQuery(teacherOpenCourseStudentSigninSettingQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninLogController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninLogController.java new file mode 100644 index 00000000..4b343a9a --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninLogController.java @@ -0,0 +1,193 @@ +package com.ibeetl.jlw.web; + +import cn.jlw.Interceptor.SCoreUser; +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.annotation.Function; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.file.FileService; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog; +import com.ibeetl.jlw.service.TeacherOpenCourseStudentSigninLogService; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninLogQuery; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 学生签到记录 教师-我的课程-开课-学生签到记录 接口 + * 切记不要对非线程安全的静态变量进行写操作 + */ + +@RestController +public class TeacherOpenCourseStudentSigninLogController{ + + private final Log log = LogFactory.getLog(this.getClass()); + private static final String MODEL = "/jlw/teacherOpenCourseStudentSigninLog"; + private static final String API = "/api/teacherOpenCourseStudentSigninLog"; + + + @Resource private TeacherOpenCourseStudentSigninLogService teacherOpenCourseStudentSigninLogService; + + @Resource FileService fileService; + + /* 前端接口 */ + + @PostMapping(API + "/getPageList.do") + public JsonResult getPageList(TeacherOpenCourseStudentSigninLogQuery condition,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + PageQuery page = condition.getPageQuery(); + teacherOpenCourseStudentSigninLogService.queryByConditionQuery(page); + return JsonResult.success(page); + } + } + + + @GetMapping(API + "/getInfo.do") + public JsonResultgetInfo(TeacherOpenCourseStudentSigninLogQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + TeacherOpenCourseStudentSigninLog teacherOpenCourseStudentSigninLog = teacherOpenCourseStudentSigninLogService.getInfo(param); + return JsonResult.success(teacherOpenCourseStudentSigninLog); + } + } + + + @GetMapping(API + "/getList.do") + public JsonResult>getList(TeacherOpenCourseStudentSigninLogQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + Listlist = teacherOpenCourseStudentSigninLogService.getValuesByQuery(param); + return JsonResult.success(list); + } + } + + + /* 后台页面 */ + + @GetMapping(MODEL + "/index.do") + @Function("teacherOpenCourseStudentSigninLog.query") + public ModelAndView index() { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninLog/index.html") ; + view.addObject("search", TeacherOpenCourseStudentSigninLogQuery.class.getName()); + return view; + } + + @GetMapping(MODEL + "/edit.do") + @Function("teacherOpenCourseStudentSigninLog.edit") + public ModelAndView edit(Long teacherOpenCourseStudentSigninId) { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninLog/edit.html"); + TeacherOpenCourseStudentSigninLog teacherOpenCourseStudentSigninLog = teacherOpenCourseStudentSigninLogService.queryById(teacherOpenCourseStudentSigninId); + view.addObject("teacherOpenCourseStudentSigninLog", teacherOpenCourseStudentSigninLog); + return view; + } + + @GetMapping(MODEL + "/add.do") + @Function("teacherOpenCourseStudentSigninLog.add") + public ModelAndView add(Long teacherOpenCourseStudentSigninId) { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninLog/add.html"); + if(null != teacherOpenCourseStudentSigninId){ + TeacherOpenCourseStudentSigninLog teacherOpenCourseStudentSigninLog = teacherOpenCourseStudentSigninLogService.queryById(teacherOpenCourseStudentSigninId); + view.addObject("teacherOpenCourseStudentSigninLog", teacherOpenCourseStudentSigninLog); + }else { + view.addObject("teacherOpenCourseStudentSigninLog", new TeacherOpenCourseStudentSigninLog()); + } + return view; + } + + /* 后台接口 */ + + @PostMapping(MODEL + "/list.json") + @Function("teacherOpenCourseStudentSigninLog.query") + public JsonResult list(TeacherOpenCourseStudentSigninLogQuery condition){ + PageQuery page = condition.getPageQuery(); + teacherOpenCourseStudentSigninLogService.queryByCondition(page); + return JsonResult.success(page); + } + + @PostMapping(MODEL + "/addAll.json") + @Function("teacherOpenCourseStudentSigninLog.add") + public JsonResult addAll(TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + teacherOpenCourseStudentSigninLogQuery.setUserId(coreUser.getId()); + teacherOpenCourseStudentSigninLogQuery.setOrgId(coreUser.getOrgId()); + String msg = teacherOpenCourseStudentSigninLogService.addAll(teacherOpenCourseStudentSigninLogQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("新增失败,"+msg); + } + } + } + + @PostMapping(MODEL + "/add.json") + @Function("teacherOpenCourseStudentSigninLog.add") + public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery, BindingResult result,@SCoreUser CoreUser coreUser){ + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else{ + teacherOpenCourseStudentSigninLogQuery.setUserId(coreUser.getId()); + teacherOpenCourseStudentSigninLogQuery.setOrgId(coreUser.getOrgId()); + return teacherOpenCourseStudentSigninLogService.add(teacherOpenCourseStudentSigninLogQuery); + } + } + + @PostMapping(MODEL + "/edit.json") + @Function("teacherOpenCourseStudentSigninLog.edit") + public JsonResult update(@Validated(ValidateConfig.UPDATE.class) TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery, BindingResult result) { + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else { + teacherOpenCourseStudentSigninLogQuery.setUserId(null); + teacherOpenCourseStudentSigninLogQuery.setOrgId(null); + String msg = teacherOpenCourseStudentSigninLogService.edit(teacherOpenCourseStudentSigninLogQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("更新失败,"+msg); + } + } + } + + + @GetMapping(MODEL + "/view.json") + @Function("teacherOpenCourseStudentSigninLog.query") + public JsonResultqueryInfo(Long teacherOpenCourseStudentSigninId) { + TeacherOpenCourseStudentSigninLog teacherOpenCourseStudentSigninLog = teacherOpenCourseStudentSigninLogService.queryById( teacherOpenCourseStudentSigninId); + return JsonResult.success(teacherOpenCourseStudentSigninLog); + } + + @GetMapping(MODEL + "/getValues.json") + @Function("teacherOpenCourseStudentSigninLog.query") + public JsonResult>getValues(TeacherOpenCourseStudentSigninLogQuery param) { + Listlist = teacherOpenCourseStudentSigninLogService.getValuesByQuery(param); + return JsonResult.success(list); + } + + + @PostMapping(MODEL + "/delete.json") + @Function("teacherOpenCourseStudentSigninLog.delete") + @ResponseBody + public JsonResult delete(String ids) { + teacherOpenCourseStudentSigninLogService.deleteTeacherOpenCourseStudentSigninLog(ids); + return JsonResult.success(); + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java new file mode 100644 index 00000000..b1561bde --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseStudentSigninSettingController.java @@ -0,0 +1,193 @@ +package com.ibeetl.jlw.web; + +import cn.jlw.Interceptor.SCoreUser; +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.annotation.Function; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.file.FileService; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting; +import com.ibeetl.jlw.service.TeacherOpenCourseStudentSigninSettingService; +import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninSettingQuery; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.validation.BindingResult; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 学生签到设置 教师-我的课程-开课-学生签到-配置 接口 + * 切记不要对非线程安全的静态变量进行写操作 + */ + +@RestController +public class TeacherOpenCourseStudentSigninSettingController{ + + private final Log log = LogFactory.getLog(this.getClass()); + private static final String MODEL = "/jlw/teacherOpenCourseStudentSigninSetting"; + private static final String API = "/api/teacherOpenCourseStudentSigninSetting"; + + + @Resource private TeacherOpenCourseStudentSigninSettingService teacherOpenCourseStudentSigninSettingService; + + @Resource FileService fileService; + + /* 前端接口 */ + + @PostMapping(API + "/getPageList.do") + public JsonResult getPageList(TeacherOpenCourseStudentSigninSettingQuery condition,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + PageQuery page = condition.getPageQuery(); + teacherOpenCourseStudentSigninSettingService.queryByConditionQuery(page); + return JsonResult.success(page); + } + } + + + @GetMapping(API + "/getInfo.do") + public JsonResultgetInfo(TeacherOpenCourseStudentSigninSettingQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + TeacherOpenCourseStudentSigninSetting teacherOpenCourseStudentSigninSetting = teacherOpenCourseStudentSigninSettingService.getInfo(param); + return JsonResult.success(teacherOpenCourseStudentSigninSetting); + } + } + + + @GetMapping(API + "/getList.do") + public JsonResult>getList(TeacherOpenCourseStudentSigninSettingQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + Listlist = teacherOpenCourseStudentSigninSettingService.getValuesByQuery(param); + return JsonResult.success(list); + } + } + + + /* 后台页面 */ + + @GetMapping(MODEL + "/index.do") + @Function("teacherOpenCourseStudentSigninSetting.query") + public ModelAndView index() { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninSetting/index.html") ; + view.addObject("search", TeacherOpenCourseStudentSigninSettingQuery.class.getName()); + return view; + } + + @GetMapping(MODEL + "/edit.do") + @Function("teacherOpenCourseStudentSigninSetting.edit") + public ModelAndView edit(Long teacherOpenCourseStudentSigninSettingId) { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninSetting/edit.html"); + TeacherOpenCourseStudentSigninSetting teacherOpenCourseStudentSigninSetting = teacherOpenCourseStudentSigninSettingService.queryById(teacherOpenCourseStudentSigninSettingId); + view.addObject("teacherOpenCourseStudentSigninSetting", teacherOpenCourseStudentSigninSetting); + return view; + } + + @GetMapping(MODEL + "/add.do") + @Function("teacherOpenCourseStudentSigninSetting.add") + public ModelAndView add(Long teacherOpenCourseStudentSigninSettingId) { + ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseStudentSigninSetting/add.html"); + if(null != teacherOpenCourseStudentSigninSettingId){ + TeacherOpenCourseStudentSigninSetting teacherOpenCourseStudentSigninSetting = teacherOpenCourseStudentSigninSettingService.queryById(teacherOpenCourseStudentSigninSettingId); + view.addObject("teacherOpenCourseStudentSigninSetting", teacherOpenCourseStudentSigninSetting); + }else { + view.addObject("teacherOpenCourseStudentSigninSetting", new TeacherOpenCourseStudentSigninSetting()); + } + return view; + } + + /* 后台接口 */ + + @PostMapping(MODEL + "/list.json") + @Function("teacherOpenCourseStudentSigninSetting.query") + public JsonResult list(TeacherOpenCourseStudentSigninSettingQuery condition){ + PageQuery page = condition.getPageQuery(); + teacherOpenCourseStudentSigninSettingService.queryByCondition(page); + return JsonResult.success(page); + } + + @PostMapping(MODEL + "/addAll.json") + @Function("teacherOpenCourseStudentSigninSetting.add") + public JsonResult addAll(TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + teacherOpenCourseStudentSigninSettingQuery.setUserId(coreUser.getId()); + teacherOpenCourseStudentSigninSettingQuery.setOrgId(coreUser.getOrgId()); + String msg = teacherOpenCourseStudentSigninSettingService.addAll(teacherOpenCourseStudentSigninSettingQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("新增失败,"+msg); + } + } + } + + @PostMapping(MODEL + "/add.json") + @Function("teacherOpenCourseStudentSigninSetting.add") + public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery, BindingResult result,@SCoreUser CoreUser coreUser){ + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else{ + teacherOpenCourseStudentSigninSettingQuery.setUserId(coreUser.getId()); + teacherOpenCourseStudentSigninSettingQuery.setOrgId(coreUser.getOrgId()); + return teacherOpenCourseStudentSigninSettingService.add(teacherOpenCourseStudentSigninSettingQuery); + } + } + + @PostMapping(MODEL + "/edit.json") + @Function("teacherOpenCourseStudentSigninSetting.edit") + public JsonResult update(@Validated(ValidateConfig.UPDATE.class) TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery, BindingResult result) { + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else { + teacherOpenCourseStudentSigninSettingQuery.setUserId(null); + teacherOpenCourseStudentSigninSettingQuery.setOrgId(null); + String msg = teacherOpenCourseStudentSigninSettingService.edit(teacherOpenCourseStudentSigninSettingQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("更新失败,"+msg); + } + } + } + + + @GetMapping(MODEL + "/view.json") + @Function("teacherOpenCourseStudentSigninSetting.query") + public JsonResultqueryInfo(Long teacherOpenCourseStudentSigninSettingId) { + TeacherOpenCourseStudentSigninSetting teacherOpenCourseStudentSigninSetting = teacherOpenCourseStudentSigninSettingService.queryById( teacherOpenCourseStudentSigninSettingId); + return JsonResult.success(teacherOpenCourseStudentSigninSetting); + } + + @GetMapping(MODEL + "/getValues.json") + @Function("teacherOpenCourseStudentSigninSetting.query") + public JsonResult>getValues(TeacherOpenCourseStudentSigninSettingQuery param) { + Listlist = teacherOpenCourseStudentSigninSettingService.getValuesByQuery(param); + return JsonResult.success(list); + } + + + @PostMapping(MODEL + "/delete.json") + @Function("teacherOpenCourseStudentSigninSetting.delete") + @ResponseBody + public JsonResult delete(String ids) { + teacherOpenCourseStudentSigninSettingService.deleteTeacherOpenCourseStudentSigninSetting(ids); + return JsonResult.success(); + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninLogQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninLogQuery.java new file mode 100644 index 00000000..874e14cc --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninLogQuery.java @@ -0,0 +1,156 @@ +package com.ibeetl.jlw.web.query; + +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.annotation.Query; +import com.ibeetl.admin.core.web.query.PageParam; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninLog; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + *学生签到记录查询 + */ +public class TeacherOpenCourseStudentSigninLogQuery extends PageParam { + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + @Query(name = "ID", display = false) + private Long teacherOpenCourseStudentSigninId; + @Query(name = "学生ID", display = true,type=Query.TYPE_DICT,dict="student.student_name.student_status=1") + private Long studentId; + @Query(name = "开课ID", display = true,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1") + private Long openCourseId; + @Query(name = "班级ID", display = true,type=Query.TYPE_DICT,dict="school_class.class_name.class_status=1") + private String schoolClassId; + @Query(name = "签到日期", display = false) + private Date addTime; + @Query(name = "签到方式 (数据字典 student_signin_type)", display = true,type=Query.TYPE_DICT,dict="student_signin_type") + private String type; + @Query(name = "备注(缺勤理由)", display = false) + private String remark; + @Query(name = "组织ID", display = false) + private Long orgId; + @Query(name = "用户ID", display = false) + private Long userId; + + private String teacherOpenCourseStudentSigninIdPlural; + private String studentIdPlural; + private String openCourseIdPlural; + private String orgIdPlural; + private String userIdPlural; + + private String teacherOpenCourseStudentSigninLogJsonStr;//json格式 + + private String _given;//指定更新的特定字段,多个逗号隔开 + + public Long getTeacherOpenCourseStudentSigninId(){ + return teacherOpenCourseStudentSigninId; + } + public void setTeacherOpenCourseStudentSigninId(Long teacherOpenCourseStudentSigninId ){ + this.teacherOpenCourseStudentSigninId = teacherOpenCourseStudentSigninId; + } + public Long getStudentId(){ + return studentId; + } + public void setStudentId(Long studentId ){ + this.studentId = studentId; + } + public Long getOpenCourseId(){ + return openCourseId; + } + public void setOpenCourseId(Long openCourseId ){ + this.openCourseId = openCourseId; + } + public String getSchoolClassId(){ + return schoolClassId; + } + public void setSchoolClassId(String schoolClassId ){ + this.schoolClassId = schoolClassId; + } + public Date getAddTime(){ + return addTime; + } + public void setAddTime(Date addTime ){ + this.addTime = addTime; + } + public String getType(){ + return type; + } + public void setType(String type ){ + this.type = type; + } + public String getRemark(){ + return remark; + } + public void setRemark(String remark ){ + this.remark = remark; + } + public Long getOrgId(){ + return orgId; + } + public void setOrgId(Long orgId ){ + this.orgId = orgId; + } + public Long getUserId(){ + return userId; + } + public void setUserId(Long userId ){ + this.userId = userId; + } + + public TeacherOpenCourseStudentSigninLog pojo(){ + TeacherOpenCourseStudentSigninLog pojo = new TeacherOpenCourseStudentSigninLog(); + pojo.setTeacherOpenCourseStudentSigninId(this.getTeacherOpenCourseStudentSigninId()); + pojo.setStudentId(this.getStudentId()); + pojo.setOpenCourseId(this.getOpenCourseId()); + pojo.setSchoolClassId(this.getSchoolClassId()); + pojo.setAddTime(this.getAddTime()); + pojo.setType(this.getType()); + pojo.setRemark(this.getRemark()); + pojo.setOrgId(this.getOrgId()); + pojo.setUserId(this.getUserId()); + return pojo; + } + + public String getTeacherOpenCourseStudentSigninIdPlural(){ + return teacherOpenCourseStudentSigninIdPlural; + } + public void setTeacherOpenCourseStudentSigninIdPlural(String teacherOpenCourseStudentSigninIdPlural){ + this.teacherOpenCourseStudentSigninIdPlural = teacherOpenCourseStudentSigninIdPlural; + } + public String getStudentIdPlural(){ + return studentIdPlural; + } + public void setStudentIdPlural(String studentIdPlural){ + this.studentIdPlural = studentIdPlural; + } + public String getOpenCourseIdPlural(){ + return openCourseIdPlural; + } + public void setOpenCourseIdPlural(String openCourseIdPlural){ + this.openCourseIdPlural = openCourseIdPlural; + } + public String getOrgIdPlural(){ + return orgIdPlural; + } + public void setOrgIdPlural(String orgIdPlural){ + this.orgIdPlural = orgIdPlural; + } + public String getUserIdPlural(){ + return userIdPlural; + } + public void setUserIdPlural(String userIdPlural){ + this.userIdPlural = userIdPlural; + } + public String getTeacherOpenCourseStudentSigninLogJsonStr(){ + return teacherOpenCourseStudentSigninLogJsonStr; + } + public void setTeacherOpenCourseStudentSigninLogJsonStr(String teacherOpenCourseStudentSigninLogJsonStr ){ + this.teacherOpenCourseStudentSigninLogJsonStr = teacherOpenCourseStudentSigninLogJsonStr; + } + public String get_given() { + return _given; + } + public void set_given(String _given) { + this._given = _given; + } +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninSettingQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninSettingQuery.java new file mode 100644 index 00000000..d23c3efe --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseStudentSigninSettingQuery.java @@ -0,0 +1,147 @@ +package com.ibeetl.jlw.web.query; + +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.annotation.Query; +import com.ibeetl.admin.core.web.query.PageParam; +import com.ibeetl.jlw.entity.TeacherOpenCourseStudentSigninSetting; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + *学生签到设置查询 + */ +public class TeacherOpenCourseStudentSigninSettingQuery extends PageParam { + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + @Query(name = "ID", display = false) + private Long teacherOpenCourseStudentSigninSettingId; + @Query(name = "开课ID", display = true,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1") + private Long openCourseId; + @Query(name = "班级ID", display = true,type=Query.TYPE_DICT,dict="school_class.class_name.class_status=1") + private Long schoolClassId; + @Query(name = "签到方式 (数据字典 student_signin_type)", display = true,type=Query.TYPE_DICT,dict="student_signin_type") + private String type; + @Query(name = "设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置", display = false) + private String value; + @Query(name = "组织ID", display = false) + private Long orgId; + @Query(name = "用户ID", display = false) + private Long userId; + @Query(name = "创建时间", display = false) + private Date createTime; + + private String teacherOpenCourseStudentSigninSettingIdPlural; + private String openCourseIdPlural; + private String schoolClassIdPlural; + private String orgIdPlural; + private String userIdPlural; + + private String teacherOpenCourseStudentSigninSettingJsonStr;//json格式 + + private String _given;//指定更新的特定字段,多个逗号隔开 + + public Long getTeacherOpenCourseStudentSigninSettingId(){ + return teacherOpenCourseStudentSigninSettingId; + } + public void setTeacherOpenCourseStudentSigninSettingId(Long teacherOpenCourseStudentSigninSettingId ){ + this.teacherOpenCourseStudentSigninSettingId = teacherOpenCourseStudentSigninSettingId; + } + public Long getOpenCourseId(){ + return openCourseId; + } + public void setOpenCourseId(Long openCourseId ){ + this.openCourseId = openCourseId; + } + public Long getSchoolClassId(){ + return schoolClassId; + } + public void setSchoolClassId(Long schoolClassId ){ + this.schoolClassId = schoolClassId; + } + public String getType(){ + return type; + } + public void setType(String type ){ + this.type = type; + } + public String getValue(){ + return value; + } + public void setValue(String value ){ + this.value = value; + } + public Long getOrgId(){ + return orgId; + } + public void setOrgId(Long orgId ){ + this.orgId = orgId; + } + public Long getUserId(){ + return userId; + } + public void setUserId(Long userId ){ + this.userId = userId; + } + public Date getCreateTime(){ + return createTime; + } + public void setCreateTime(Date createTime ){ + this.createTime = createTime; + } + + public TeacherOpenCourseStudentSigninSetting pojo(){ + TeacherOpenCourseStudentSigninSetting pojo = new TeacherOpenCourseStudentSigninSetting(); + pojo.setTeacherOpenCourseStudentSigninSettingId(this.getTeacherOpenCourseStudentSigninSettingId()); + pojo.setOpenCourseId(this.getOpenCourseId()); + pojo.setSchoolClassId(this.getSchoolClassId()); + pojo.setType(this.getType()); + pojo.setValue(this.getValue()); + pojo.setOrgId(this.getOrgId()); + pojo.setUserId(this.getUserId()); + pojo.setCreateTime(this.getCreateTime()); + return pojo; + } + + public String getTeacherOpenCourseStudentSigninSettingIdPlural(){ + return teacherOpenCourseStudentSigninSettingIdPlural; + } + public void setTeacherOpenCourseStudentSigninSettingIdPlural(String teacherOpenCourseStudentSigninSettingIdPlural){ + this.teacherOpenCourseStudentSigninSettingIdPlural = teacherOpenCourseStudentSigninSettingIdPlural; + } + public String getOpenCourseIdPlural(){ + return openCourseIdPlural; + } + public void setOpenCourseIdPlural(String openCourseIdPlural){ + this.openCourseIdPlural = openCourseIdPlural; + } + public String getSchoolClassIdPlural(){ + return schoolClassIdPlural; + } + public void setSchoolClassIdPlural(String schoolClassIdPlural){ + this.schoolClassIdPlural = schoolClassIdPlural; + } + public String getOrgIdPlural(){ + return orgIdPlural; + } + public void setOrgIdPlural(String orgIdPlural){ + this.orgIdPlural = orgIdPlural; + } + public String getUserIdPlural(){ + return userIdPlural; + } + public void setUserIdPlural(String userIdPlural){ + this.userIdPlural = userIdPlural; + } + public String getTeacherOpenCourseStudentSigninSettingJsonStr(){ + return teacherOpenCourseStudentSigninSettingJsonStr; + } + public void setTeacherOpenCourseStudentSigninSettingJsonStr(String teacherOpenCourseStudentSigninSettingJsonStr ){ + this.teacherOpenCourseStudentSigninSettingJsonStr = teacherOpenCourseStudentSigninSettingJsonStr; + } + public String get_given() { + return _given; + } + public void set_given(String _given) { + this._given = _given; + } +} diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninLog.md b/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninLog.md new file mode 100644 index 00000000..60523762 --- /dev/null +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninLog.md @@ -0,0 +1,285 @@ +queryByCondition +=== +* 根据不为空的参数进行分页查询 + + select + @pageTag(){ + t.* + @} + from teacher_open_course_student_signin_log t + where 1=1 + @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 + and #function("teacherOpenCourseStudentSigninLog.query")# + @if(!isEmpty(teacherOpenCourseStudentSigninId)){ + and t.teacher_open_course_student_signin_id =#teacherOpenCourseStudentSigninId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_id,#teacherOpenCourseStudentSigninIdPlural#) + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(addTime)){ + and t.add_time =#addTime# + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(remark)){ + and t.remark =#remark# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + +queryByConditionQuery +=== +* 根据不为空的参数进行分页查询(无权限) + + select + @pageTag(){ + t.* + @} + from teacher_open_course_student_signin_log t + where 1=1 + @if(!isEmpty(teacherOpenCourseStudentSigninId)){ + and t.teacher_open_course_student_signin_id =#teacherOpenCourseStudentSigninId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_id,#teacherOpenCourseStudentSigninIdPlural#) + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(addTime)){ + and t.add_time =#addTime# + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(remark)){ + and t.remark =#remark# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + + + +deleteTeacherOpenCourseStudentSigninLogByIds +=== + +* 批量删除 + + delete from teacher_open_course_student_signin_log where find_in_set(teacher_open_course_student_signin_id,#ids#) + + + +getByIds +=== + +select * from teacher_open_course_student_signin_log where find_in_set(teacher_open_course_student_signin_id,#ids#) + + +updateGivenByIds +=== + +* 批量更新指定字段,无论此字段是否有值 + + update teacher_open_course_student_signin_log + set + @if(contain("studentId",_given)){ + @if(isEmpty(studentId)){ + student_id = null , + @}else{ + student_id = #studentId# , + @} + @} + @if(contain("openCourseId",_given)){ + @if(isEmpty(openCourseId)){ + open_course_id = null , + @}else{ + open_course_id = #openCourseId# , + @} + @} + @if(contain("schoolClassId",_given)){ + @if(isEmpty(schoolClassId)){ + school_class_id = null , + @}else{ + school_class_id = #schoolClassId# , + @} + @} + @if(contain("addTime",_given)){ + @if(isEmpty(addTime)){ + add_time = null , + @}else{ + add_time = #addTime# , + @} + @} + @if(contain("type",_given)){ + @if(isEmpty(type)){ + type = null , + @}else{ + type = #type# , + @} + @} + @if(contain("remark",_given)){ + @if(isEmpty(remark)){ + remark = null , + @}else{ + remark = #remark# , + @} + @} + @if(contain("orgId",_given)){ + @if(isEmpty(orgId)){ + org_id = null , + @}else{ + org_id = #orgId# , + @} + @} + @if(contain("userId",_given)){ + @if(isEmpty(userId)){ + user_id = null , + @}else{ + user_id = #userId# , + @} + @} + teacher_open_course_student_signin_id = teacher_open_course_student_signin_id + where find_in_set(teacher_open_course_student_signin_id,#teacherOpenCourseStudentSigninIdPlural#) + + + +getTeacherOpenCourseStudentSigninLogValues +=== + +* 根据不为空的参数进行查询 + + select t.* + from teacher_open_course_student_signin_log t + where 1=1 + @if(!isEmpty(teacherOpenCourseStudentSigninId)){ + and t.teacher_open_course_student_signin_id =#teacherOpenCourseStudentSigninId# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(addTime)){ + and t.add_time =#addTime# + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(remark)){ + and t.remark =#remark# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + + +getValuesByQuery +=== + +* 根据不为空的参数进行查询 + + select t.* + from teacher_open_course_student_signin_log t + where 1=1 and #function("teacherOpenCourseStudentSigninLog.query")# + @if(!isEmpty(teacherOpenCourseStudentSigninId)){ + and t.teacher_open_course_student_signin_id =#teacherOpenCourseStudentSigninId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_id,#teacherOpenCourseStudentSigninIdPlural#) + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(addTime)){ + and t.add_time =#addTime# + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(remark)){ + and t.remark =#remark# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + + diff --git a/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninSetting.md b/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninSetting.md new file mode 100644 index 00000000..2da78582 --- /dev/null +++ b/web/src/main/resources/sql/jlw/teacherOpenCourseStudentSigninSetting.md @@ -0,0 +1,266 @@ +queryByCondition +=== +* 根据不为空的参数进行分页查询 + + select + @pageTag(){ + t.* + @} + from teacher_open_course_student_signin_setting t + where 1=1 + @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 + and #function("teacherOpenCourseStudentSigninSetting.query")# + @if(!isEmpty(teacherOpenCourseStudentSigninSettingId)){ + and t.teacher_open_course_student_signin_setting_id =#teacherOpenCourseStudentSigninSettingId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninSettingIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_setting_id,#teacherOpenCourseStudentSigninSettingIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(schoolClassIdPlural)){ + and find_in_set(t.school_class_id,#schoolClassIdPlural#) + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(value)){ + and t.value =#value# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + +queryByConditionQuery +=== +* 根据不为空的参数进行分页查询(无权限) + + select + @pageTag(){ + t.* + @} + from teacher_open_course_student_signin_setting t + where 1=1 + @if(!isEmpty(teacherOpenCourseStudentSigninSettingId)){ + and t.teacher_open_course_student_signin_setting_id =#teacherOpenCourseStudentSigninSettingId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninSettingIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_setting_id,#teacherOpenCourseStudentSigninSettingIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(schoolClassIdPlural)){ + and find_in_set(t.school_class_id,#schoolClassIdPlural#) + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(value)){ + and t.value =#value# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + + + +deleteTeacherOpenCourseStudentSigninSettingByIds +=== + +* 批量删除 + + delete from teacher_open_course_student_signin_setting where find_in_set(teacher_open_course_student_signin_setting_id,#ids#) + + + +getByIds +=== + +select * from teacher_open_course_student_signin_setting where find_in_set(teacher_open_course_student_signin_setting_id,#ids#) + + +updateGivenByIds +=== + +* 批量更新指定字段,无论此字段是否有值 + + update teacher_open_course_student_signin_setting + set + @if(contain("openCourseId",_given)){ + @if(isEmpty(openCourseId)){ + open_course_id = null , + @}else{ + open_course_id = #openCourseId# , + @} + @} + @if(contain("schoolClassId",_given)){ + @if(isEmpty(schoolClassId)){ + school_class_id = null , + @}else{ + school_class_id = #schoolClassId# , + @} + @} + @if(contain("type",_given)){ + @if(isEmpty(type)){ + type = null , + @}else{ + type = #type# , + @} + @} + @if(contain("value",_given)){ + @if(isEmpty(value)){ + value = null , + @}else{ + value = #value# , + @} + @} + @if(contain("orgId",_given)){ + @if(isEmpty(orgId)){ + org_id = null , + @}else{ + org_id = #orgId# , + @} + @} + @if(contain("userId",_given)){ + @if(isEmpty(userId)){ + user_id = null , + @}else{ + user_id = #userId# , + @} + @} + @if(contain("createTime",_given)){ + @if(isEmpty(createTime)){ + create_time = null , + @}else{ + create_time = #createTime# , + @} + @} + teacher_open_course_student_signin_setting_id = teacher_open_course_student_signin_setting_id + where find_in_set(teacher_open_course_student_signin_setting_id,#teacherOpenCourseStudentSigninSettingIdPlural#) + + + +getTeacherOpenCourseStudentSigninSettingValues +=== + +* 根据不为空的参数进行查询 + + select t.* + from teacher_open_course_student_signin_setting t + where 1=1 + @if(!isEmpty(teacherOpenCourseStudentSigninSettingId)){ + and t.teacher_open_course_student_signin_setting_id =#teacherOpenCourseStudentSigninSettingId# + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(value)){ + and t.value =#value# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + +getValuesByQuery +=== + +* 根据不为空的参数进行查询 + + select t.* + from teacher_open_course_student_signin_setting t + where 1=1 and #function("teacherOpenCourseStudentSigninSetting.query")# + @if(!isEmpty(teacherOpenCourseStudentSigninSettingId)){ + and t.teacher_open_course_student_signin_setting_id =#teacherOpenCourseStudentSigninSettingId# + @} + @if(!isEmpty(teacherOpenCourseStudentSigninSettingIdPlural)){ + and find_in_set(t.teacher_open_course_student_signin_setting_id,#teacherOpenCourseStudentSigninSettingIdPlural#) + @} + @if(!isEmpty(openCourseId)){ + and t.open_course_id =#openCourseId# + @} + @if(!isEmpty(openCourseIdPlural)){ + and find_in_set(t.open_course_id,#openCourseIdPlural#) + @} + @if(!isEmpty(schoolClassId)){ + and t.school_class_id =#schoolClassId# + @} + @if(!isEmpty(schoolClassIdPlural)){ + and find_in_set(t.school_class_id,#schoolClassIdPlural#) + @} + @if(!isEmpty(type)){ + and t.type =#type# + @} + @if(!isEmpty(value)){ + and t.value =#value# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + + + diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/add.js new file mode 100644 index 00000000..265571af --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/add.js @@ -0,0 +1,38 @@ +layui.define([ 'form', 'laydate', 'table','teacherOpenCourseStudentSigninLogApi'], function(exports) { + var form = layui.form; + var teacherOpenCourseStudentSigninLogApi = layui.teacherOpenCourseStudentSigninLogApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#addForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#addButton").click(function(){ + form.on('submit(form)', function(){ + var teacherOpenCourseStudentSigninId = $("#addForm input[name='teacherOpenCourseStudentSigninId']").val(); + if(!$.isEmpty(teacherOpenCourseStudentSigninId)){ + teacherOpenCourseStudentSigninLogApi.updateTeacherOpenCourseStudentSigninLog($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }else{ + teacherOpenCourseStudentSigninLogApi.addTeacherOpenCourseStudentSigninLog($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("添加成功"); + Lib.closeFrame(); + }); + } + + }); + }); + + $("#addButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('add',view); +}); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/del.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/del.js new file mode 100644 index 00000000..08928f2e --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/del.js @@ -0,0 +1,23 @@ +layui.define(['table', 'teacherOpenCourseStudentSigninLogApi'], function(exports) { + var teacherOpenCourseStudentSigninLogApi = layui.teacherOpenCourseStudentSigninLogApi; + var table=layui.table; + var view = { + init:function(){ + }, + delBatch:function(){ + var data = Common.getMoreDataFromTable(table,"teacherOpenCourseStudentSigninLogTable"); + if(data==null){ + return ; + } + Common.openConfirm("确认要删除这些学生签到记录?",function(){ + var ids =Common.concatBatchId(data,"teacherOpenCourseStudentSigninId"); + teacherOpenCourseStudentSigninLogApi.del(ids,function(){ + Common.info("删除成功"); + dataReload(); + }) + }) + } + } + exports('del',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/edit.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/edit.js new file mode 100644 index 00000000..5fb18630 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/edit.js @@ -0,0 +1,28 @@ +layui.define([ 'form', 'laydate', 'table','teacherOpenCourseStudentSigninLogApi'], function(exports) { + var form = layui.form; + var teacherOpenCourseStudentSigninLogApi = layui.teacherOpenCourseStudentSigninLogApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#updateForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#updateButton").click(function(){ + form.on('submit(form)', function(){ + teacherOpenCourseStudentSigninLogApi.updateTeacherOpenCourseStudentSigninLog($('#updateForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }); + }); + $("#updateButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('edit',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/index.js new file mode 100644 index 00000000..2ea46631 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/index.js @@ -0,0 +1,185 @@ +layui.define([ 'form', 'laydate', 'table' ], function(exports) { + var form = layui.form; + var laydate = layui.laydate; + var table = layui.table; + var teacherOpenCourseStudentSigninLogTable = null; + var view ={ + init:function(){ + var that = this + this.initTable(); + this.initSearchForm(); + this.initToolBar(); + window.dataReload = function(){ + Lib.doSearchForm($("#searchForm"),teacherOpenCourseStudentSigninLogTable) + that.initToolBar(); + } + }, + initTable:function(){ + var sx_ = localStorage.getItem("teacherOpenCourseStudentSigninLogTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存 + if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);} + teacherOpenCourseStudentSigninLogTable = table.render({ + elem : '#teacherOpenCourseStudentSigninLogTable', + height : Lib.getTableHeight(1), + cellMinWidth: 100, + method : 'post', + url : Common.ctxPath + '/jlw/teacherOpenCourseStudentSigninLog/list.json' // 数据接口 + ,page : Lib.tablePage // 开启分页 + ,toolbar: '#toolbar_teacherOpenCourseStudentSigninLog' //自定义头部左侧工具栏 + ,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏 + ,limit : 10, + cols : [ [ // 表头 + { + type : 'checkbox', + + }, + { + field : 'teacherOpenCourseStudentSigninId', + title : 'ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninId'])?false:sx_['teacherOpenCourseStudentSigninId'], + + width : 60, + }, + { + field : 'studentIdText', //数据字典类型为 student.student_name.student_status=1 + title : '学生ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['studentIdText'])?false:sx_['studentIdText'], + }, + { + field : 'openCourseIdText', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1 + title : '开课ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['openCourseIdText'])?false:sx_['openCourseIdText'], + }, + { + field : 'schoolClassIdText', //数据字典类型为 school_class.class_name.class_status=1 + title : '班级ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['schoolClassIdText'])?false:sx_['schoolClassIdText'], + }, + { + field : 'addTime', + title : '签到日期', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['addTime'])?false:sx_['addTime'], + }, + { + field : 'typeText', //数据字典类型为 student_signin_type + title : '签到方式 (数据字典 student_signin_type)', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['typeText'])?false:sx_['typeText'], + }, + { + field : 'remark', + title : '备注(缺勤理由)', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['remark'])?false:sx_['remark'], + }, + { + field : 'orgId', + title : '组织ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'], + }, + { + field : 'userId', + title : '用户ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['userId'])?false:sx_['userId'], + } + ,{ + field : 'operation_',title : '操作',align:"center", templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + + ] ] + + }); + + table.on('checkbox(teacherOpenCourseStudentSigninLogTable)', function(obj){ + var teacherOpenCourseStudentSigninLog = obj.data; + if(obj.checked){ + //按钮逻辑Lib.buttonEnable() + }else{ + + } + }) + }, + + initSearchForm:function(){ + Lib.initSearchForm( $("#searchForm"),teacherOpenCourseStudentSigninLogTable,form); + }, + + initToolBar:function(){ + toolbar = { + add: function () { + var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do"; + Common.openDlg(url,"学生签到记录管理>新增"); + }, + edit: function () { + var data = Common.getOneFromTable(table,"teacherOpenCourseStudentSigninLogTable"); + if(data==null){ + return ; + } + var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do?teacherOpenCourseStudentSigninId="+data.teacherOpenCourseStudentSigninId; + Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseStudentSigninId+">编辑"); + }, + del: function () { + layui.use(['del'], function(){ + var delView = layui.del + delView.delBatch(); + }); + }, + search: function () { + Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninLogTable, 1); + view.initToolBar() + }, + refresh: function () { + searchForm.reset(); + Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninLogTable, 1); + view.initToolBar() + }, + } + //触发事件 + $('.ext-toolbar').on('click', function() { + var type = $(this).data('type'); + toolbar[type] ? toolbar[type].call(this) : ''; + }); + + }, initTableTool: table.on('tool(teacherOpenCourseStudentSigninLogTable)', function (obj) { + var data = obj.data; + if (obj.event === 'edit') { + var url = "/jlw/teacherOpenCourseStudentSigninLog/add.do?teacherOpenCourseStudentSigninId="+data.teacherOpenCourseStudentSigninId; + Common.openDlg(url,"学生签到记录管理>"+data.teacherOpenCourseStudentSigninId+">编辑"); + }else if(obj.event === "del"){ + layer.confirm('是否确定删除该信息?', function (index) { + var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninLog/delete.json",{ids:data.teacherOpenCourseStudentSigninId}); + layer.msg(ret.code == 0?"删除成功!":ret.msg, { + offset: ['50%'], + icon: ret.code == 0?1:2, + time: 1500 //2秒关闭(如果不配置,默认是3秒) + },function (){ + if(ret.code == 0){ + Lib.tableRefresh(); + } + }); + }); + } + }) + } + exports('index',view); + +}); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/teacherOpenCourseStudentSigninLogApi.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/teacherOpenCourseStudentSigninLogApi.js new file mode 100644 index 00000000..c6618d0d --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninLog/teacherOpenCourseStudentSigninLogApi.js @@ -0,0 +1,18 @@ +/*访问后台的代码*/ +layui.define([], function(exports) { + var api={ + updateTeacherOpenCourseStudentSigninLog:function(form,callback){ + Lib.submitForm("/jlw/teacherOpenCourseStudentSigninLog/edit.json",form,{},callback) + }, + addTeacherOpenCourseStudentSigninLog:function(form,callback){ + Lib.submitForm("/jlw/teacherOpenCourseStudentSigninLog/add.json",form,{},callback) + }, + del:function(ids,callback){ + Common.post("/jlw/teacherOpenCourseStudentSigninLog/delete.json",{"ids":ids},function(){ + callback(); + }) + } + + }; + exports('teacherOpenCourseStudentSigninLogApi',api); +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/add.js new file mode 100644 index 00000000..be509a66 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/add.js @@ -0,0 +1,38 @@ +layui.define([ 'form', 'laydate', 'table','teacherOpenCourseStudentSigninSettingApi'], function(exports) { + var form = layui.form; + var teacherOpenCourseStudentSigninSettingApi = layui.teacherOpenCourseStudentSigninSettingApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#addForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#addButton").click(function(){ + form.on('submit(form)', function(){ + var teacherOpenCourseStudentSigninSettingId = $("#addForm input[name='teacherOpenCourseStudentSigninSettingId']").val(); + if(!$.isEmpty(teacherOpenCourseStudentSigninSettingId)){ + teacherOpenCourseStudentSigninSettingApi.updateTeacherOpenCourseStudentSigninSetting($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }else{ + teacherOpenCourseStudentSigninSettingApi.addTeacherOpenCourseStudentSigninSetting($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("添加成功"); + Lib.closeFrame(); + }); + } + + }); + }); + + $("#addButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('add',view); +}); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/del.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/del.js new file mode 100644 index 00000000..3cdbb2c4 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/del.js @@ -0,0 +1,23 @@ +layui.define(['table', 'teacherOpenCourseStudentSigninSettingApi'], function(exports) { + var teacherOpenCourseStudentSigninSettingApi = layui.teacherOpenCourseStudentSigninSettingApi; + var table=layui.table; + var view = { + init:function(){ + }, + delBatch:function(){ + var data = Common.getMoreDataFromTable(table,"teacherOpenCourseStudentSigninSettingTable"); + if(data==null){ + return ; + } + Common.openConfirm("确认要删除这些学生签到设置?",function(){ + var ids =Common.concatBatchId(data,"teacherOpenCourseStudentSigninSettingId"); + teacherOpenCourseStudentSigninSettingApi.del(ids,function(){ + Common.info("删除成功"); + dataReload(); + }) + }) + } + } + exports('del',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/edit.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/edit.js new file mode 100644 index 00000000..a30a329c --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/edit.js @@ -0,0 +1,28 @@ +layui.define([ 'form', 'laydate', 'table','teacherOpenCourseStudentSigninSettingApi'], function(exports) { + var form = layui.form; + var teacherOpenCourseStudentSigninSettingApi = layui.teacherOpenCourseStudentSigninSettingApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#updateForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#updateButton").click(function(){ + form.on('submit(form)', function(){ + teacherOpenCourseStudentSigninSettingApi.updateTeacherOpenCourseStudentSigninSetting($('#updateForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }); + }); + $("#updateButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('edit',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/index.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/index.js new file mode 100644 index 00000000..2db331b4 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/index.js @@ -0,0 +1,178 @@ +layui.define([ 'form', 'laydate', 'table' ], function(exports) { + var form = layui.form; + var laydate = layui.laydate; + var table = layui.table; + var teacherOpenCourseStudentSigninSettingTable = null; + var view ={ + init:function(){ + var that = this + this.initTable(); + this.initSearchForm(); + this.initToolBar(); + window.dataReload = function(){ + Lib.doSearchForm($("#searchForm"),teacherOpenCourseStudentSigninSettingTable) + that.initToolBar(); + } + }, + initTable:function(){ + var sx_ = localStorage.getItem("teacherOpenCourseStudentSigninSettingTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存 + if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);} + teacherOpenCourseStudentSigninSettingTable = table.render({ + elem : '#teacherOpenCourseStudentSigninSettingTable', + height : Lib.getTableHeight(1), + cellMinWidth: 100, + method : 'post', + url : Common.ctxPath + '/jlw/teacherOpenCourseStudentSigninSetting/list.json' // 数据接口 + ,page : Lib.tablePage // 开启分页 + ,toolbar: '#toolbar_teacherOpenCourseStudentSigninSetting' //自定义头部左侧工具栏 + ,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏 + ,limit : 10, + cols : [ [ // 表头 + { + type : 'checkbox', + + }, + { + field : 'teacherOpenCourseStudentSigninSettingId', + title : 'ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['teacherOpenCourseStudentSigninSettingId'])?false:sx_['teacherOpenCourseStudentSigninSettingId'], + + width : 60, + }, + { + field : 'openCourseIdText', //数据字典类型为 teacher_open_course.teacher_open_course_title.teacher_open_course_status=1 + title : '开课ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['openCourseIdText'])?false:sx_['openCourseIdText'], + }, + { + field : 'schoolClassIdText', //数据字典类型为 school_class.class_name.class_status=1 + title : '班级ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['schoolClassIdText'])?false:sx_['schoolClassIdText'], + }, + { + field : 'typeText', //数据字典类型为 student_signin_type + title : '签到方式 (数据字典 student_signin_type)', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['typeText'])?false:sx_['typeText'], + }, + { + field : 'value', + title : '设置的值:数据例子:IP: x.x.x.x-x.x.x.x,验证码:xxxx,手动签到:无需设置', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['value'])?false:sx_['value'], + }, + { + field : 'orgId', + title : '组织ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'], + }, + { + field : 'userId', + title : '用户ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['userId'])?false:sx_['userId'], + }, + { + field : 'createTime', + title : '创建时间', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['createTime'])?false:sx_['createTime'], + } + ,{ + field : 'operation_',title : '操作',align:"center", templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + + ] ] + + }); + + table.on('checkbox(teacherOpenCourseStudentSigninSettingTable)', function(obj){ + var teacherOpenCourseStudentSigninSetting = obj.data; + if(obj.checked){ + //按钮逻辑Lib.buttonEnable() + }else{ + + } + }) + }, + + initSearchForm:function(){ + Lib.initSearchForm( $("#searchForm"),teacherOpenCourseStudentSigninSettingTable,form); + }, + + initToolBar:function(){ + toolbar = { + add: function () { + var url = "/jlw/teacherOpenCourseStudentSigninSetting/add.do"; + Common.openDlg(url,"学生签到设置管理>新增"); + }, + edit: function () { + var data = Common.getOneFromTable(table,"teacherOpenCourseStudentSigninSettingTable"); + if(data==null){ + return ; + } + var url = "/jlw/teacherOpenCourseStudentSigninSetting/add.do?teacherOpenCourseStudentSigninSettingId="+data.teacherOpenCourseStudentSigninSettingId; + Common.openDlg(url,"学生签到设置管理>"+data.teacherOpenCourseStudentSigninSettingId+">编辑"); + }, + del: function () { + layui.use(['del'], function(){ + var delView = layui.del + delView.delBatch(); + }); + }, + search: function () { + Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninSettingTable, 1); + view.initToolBar() + }, + refresh: function () { + searchForm.reset(); + Lib.doSearchForm($("#searchForm"), teacherOpenCourseStudentSigninSettingTable, 1); + view.initToolBar() + }, + } + //触发事件 + $('.ext-toolbar').on('click', function() { + var type = $(this).data('type'); + toolbar[type] ? toolbar[type].call(this) : ''; + }); + + }, initTableTool: table.on('tool(teacherOpenCourseStudentSigninSettingTable)', function (obj) { + var data = obj.data; + if (obj.event === 'edit') { + var url = "/jlw/teacherOpenCourseStudentSigninSetting/add.do?teacherOpenCourseStudentSigninSettingId="+data.teacherOpenCourseStudentSigninSettingId; + Common.openDlg(url,"学生签到设置管理>"+data.teacherOpenCourseStudentSigninSettingId+">编辑"); + }else if(obj.event === "del"){ + layer.confirm('是否确定删除该信息?', function (index) { + var ret = Common.postAjax("/jlw/teacherOpenCourseStudentSigninSetting/delete.json",{ids:data.teacherOpenCourseStudentSigninSettingId}); + layer.msg(ret.code == 0?"删除成功!":ret.msg, { + offset: ['50%'], + icon: ret.code == 0?1:2, + time: 1500 //2秒关闭(如果不配置,默认是3秒) + },function (){ + if(ret.code == 0){ + Lib.tableRefresh(); + } + }); + }); + } + }) + } + exports('index',view); + +}); diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/teacherOpenCourseStudentSigninSettingApi.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/teacherOpenCourseStudentSigninSettingApi.js new file mode 100644 index 00000000..194f567b --- /dev/null +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseStudentSigninSetting/teacherOpenCourseStudentSigninSettingApi.js @@ -0,0 +1,18 @@ +/*访问后台的代码*/ +layui.define([], function(exports) { + var api={ + updateTeacherOpenCourseStudentSigninSetting:function(form,callback){ + Lib.submitForm("/jlw/teacherOpenCourseStudentSigninSetting/edit.json",form,{},callback) + }, + addTeacherOpenCourseStudentSigninSetting:function(form,callback){ + Lib.submitForm("/jlw/teacherOpenCourseStudentSigninSetting/add.json",form,{},callback) + }, + del:function(ids,callback){ + Common.post("/jlw/teacherOpenCourseStudentSigninSetting/delete.json",{"ids":ids},function(){ + callback(); + }) + } + + }; + exports('teacherOpenCourseStudentSigninSettingApi',api); +}); \ No newline at end of file diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/add.html new file mode 100644 index 00000000..0947af07 --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/add.html @@ -0,0 +1,82 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/edit.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/edit.html new file mode 100644 index 00000000..fb0169a1 --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/edit.html @@ -0,0 +1,82 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/index.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/index.html new file mode 100644 index 00000000..42193d11 --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninLog/index.html @@ -0,0 +1,29 @@ + + + +
+ + + + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/add.html new file mode 100644 index 00000000..9169c184 --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/add.html @@ -0,0 +1,75 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/edit.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/edit.html new file mode 100644 index 00000000..050e0e8f --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/edit.html @@ -0,0 +1,75 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/index.html b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/index.html new file mode 100644 index 00000000..85ad1537 --- /dev/null +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseStudentSigninSetting/index.html @@ -0,0 +1,29 @@ + + + +
+ + + +