学生读取公告

beetlsql3-dev
xuliangtong 2 years ago
parent e5e1773731
commit 12951da3c5

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{BA33ABB7-B246-4DB0-85DE-396EDDB46458}" Label="" LastModificationDate="1670998950" Name="cjks" Objects="1351" Symbols="104" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{BA33ABB7-B246-4DB0-85DE-396EDDB46458}" Label="" LastModificationDate="1670999727" Name="cjks" Objects="1363" Symbols="104" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@ -6778,7 +6778,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1670998074</a:CreationDate>
<a:ModificationDate>1670998076</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((446259,37784), (462583,46932))</a:Rect>
<a:Rect>((446259,37372), (462583,47344))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -21234,7 +21234,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Code>teaching_management</a:Code>
<a:CreationDate>1563157584</a:CreationDate>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1670998950</a:ModificationDate>
<a:ModificationDate>1670999727</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>授课管理-需要对接外部系统</a:Comment>
<a:PhysicalOptions>auto_increment = 1
@ -21319,6 +21319,18 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:DataType>datetime</a:DataType>
</o:Column>
<o:Column Id="o1302">
<a:ObjectID>7D0C51C0-EAEF-4B0E-997C-A2343F5E5A2B</a:ObjectID>
<a:Name>teacher_merge_class_third_status</a:Name>
<a:Code>teacher_merge_class_third_status</a:Code>
<a:CreationDate>1670999693</a:CreationDate>
<a:Creator>lx</a:Creator>
<a:ModificationDate>1670999727</a:ModificationDate>
<a:Modifier>lx</a:Modifier>
<a:Comment>状态 1正常 2删除</a:Comment>
<a:DataType>int(2)</a:DataType>
<a:Length>2</a:Length>
</o:Column>
<o:Column Id="o1303">
<a:ObjectID>C457A2F1-E904-4347-A28E-908BD3775B80</a:ObjectID>
<a:Name>user_id</a:Name>
<a:Code>user_id</a:Code>
@ -21329,7 +21341,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
<a:Comment>后台用户ID</a:Comment>
<a:DataType>bigint</a:DataType>
</o:Column>
<o:Column Id="o1303">
<o:Column Id="o1304">
<a:ObjectID>25EE7584-AFDD-463C-9AD0-F4519BEEE2D7</a:ObjectID>
<a:Name>org_id</a:Name>
<a:Code>org_id</a:Code>
@ -21342,7 +21354,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o1304">
<o:Key Id="o1305">
<a:ObjectID>018846BE-6DA4-4785-A696-D74525BCC497</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
@ -21356,12 +21368,12 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o1304"/>
<o:Key Ref="o1305"/>
</c:PrimaryKey>
</o:Table>
</c:Tables>
<c:DefaultGroups>
<o:Group Id="o1305">
<o:Group Id="o1306">
<a:ObjectID>BFEA4109-96F9-4074-AF58-B84D6574A7FC</a:ObjectID>
<a:Name>PUBLIC</a:Name>
<a:Code>PUBLIC</a:Code>
@ -21372,7 +21384,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
</o:Group>
</c:DefaultGroups>
<c:ChildTraceabilityLinks>
<o:ExtendedDependency Id="o1306">
<o:ExtendedDependency Id="o1307">
<a:ObjectID>ABEFC813-1056-4507-A9A7-809C149B4ABE</a:ObjectID>
<a:CreationDate>1661954753</a:CreationDate>
<a:Creator>lx</a:Creator>
@ -21660,7 +21672,7 @@ COLLATE = utf8_general_ci</a:PhysicalOptions>
</o:ExtendedDependency>
</c:ChildTraceabilityLinks>
<c:TargetModels>
<o:TargetModel Id="o1307">
<o:TargetModel Id="o1308">
<a:ObjectID>5963E417-B2CE-431D-988A-B3493AAE5EE4</a:ObjectID>
<a:Name>MySQL 5.0</a:Name>
<a:Code>MYSQL50</a:Code>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,32 @@
package com.ibeetl.jlw.dao;
import java.util.List;
import java.util.Map;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeStudentQuery;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Component;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.annotation.Update;
/**
* Dao
*/
// 实际可以不用加Repository注解调用的地方注入时候Idea会报红看着难受
@Repository
@SqlResource("jlw.teacherOpenCourseNoticeStudent")
public interface TeacherOpenCourseNoticeStudentDao extends BaseMapper<TeacherOpenCourseNoticeStudent>{
PageQuery<TeacherOpenCourseNoticeStudent> queryByCondition(PageQuery query);
PageQuery<TeacherOpenCourseNoticeStudent> queryByConditionQuery(PageQuery query);
@Update
void deleteTeacherOpenCourseNoticeStudentByIds(String ids);
@Update
int updateGivenByIds(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery);
List<TeacherOpenCourseNoticeStudent> getByIds(String ids);
List<TeacherOpenCourseNoticeStudent> getValuesByQuery(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery);
List<TeacherOpenCourseNoticeStudent> getValuesByQueryNotWithPermission(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery);
}

@ -95,7 +95,11 @@ public class TeacherOpenCourseNotice extends BaseEntity{
@LogicDelete(value = 1)
private int delFlag ;
//是否已读
private boolean studentIsRead;
public TeacherOpenCourseNotice(){
}
@ -244,4 +248,13 @@ public class TeacherOpenCourseNotice extends BaseEntity{
public void setTeacherOpenCourseIdsText(String teacherOpenCourseIdsText) {
this.teacherOpenCourseIdsText = teacherOpenCourseIdsText;
}
public Boolean getStudentIsRead() {
return studentIsRead;
}
public void setStudentIsRead(Boolean studentIsRead) {
this.studentIsRead = studentIsRead;
}
}

@ -0,0 +1,130 @@
package com.ibeetl.jlw.entity;
import javax.validation.constraints.NotNull;
import com.ibeetl.admin.core.entity.BaseEntity;
import org.beetl.sql.annotation.entity.*;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.admin.core.annotation.Dict;
import java.math.BigDecimal;
import java.util.Date;
/*
* ---
* gen by Spring Boot2 Admin 2022-12-21
*/
public class TeacherOpenCourseNoticeStudent extends BaseEntity{
//已阅ID
@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
// @SeqID(name = ORACLE_CORE_SEQ_NAME)
@AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.TeacherOpenCourseNoticeStudent")
private Long teacherOpenCourseNoticeStudentId ;
//通知公告ID
private Long teacherOpenCourseNoticeId ;
//学生ID
private Long studentId ;
//创建时间
private Date createTime ;
//组织ID
private Long orgId ;
//用户ID
private Long userId ;
public TeacherOpenCourseNoticeStudent(){
}
/**ID
*@return
*/
public Long getTeacherOpenCourseNoticeStudentId(){
return teacherOpenCourseNoticeStudentId;
}
/**ID
*@param teacherOpenCourseNoticeStudentId
*/
public void setTeacherOpenCourseNoticeStudentId(Long teacherOpenCourseNoticeStudentId){
this.teacherOpenCourseNoticeStudentId = teacherOpenCourseNoticeStudentId;
}
/**ID
*@return
*/
public Long getTeacherOpenCourseNoticeId(){
return teacherOpenCourseNoticeId;
}
/**ID
*@param teacherOpenCourseNoticeId
*/
public void setTeacherOpenCourseNoticeId(Long teacherOpenCourseNoticeId){
this.teacherOpenCourseNoticeId = teacherOpenCourseNoticeId;
}
/**ID
*@return
*/
public Long getStudentId(){
return studentId;
}
/**ID
*@param studentId
*/
public void setStudentId(Long studentId){
this.studentId = studentId;
}
/**
*@return
*/
public Date getCreateTime(){
return createTime;
}
/**
*@param createTime
*/
public void setCreateTime(Date createTime){
this.createTime = createTime;
}
/**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;
}
}

@ -1,16 +1,21 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ibeetl.admin.core.entity.CoreUser;
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.TeacherOpenCourseNoticeDao;
import com.ibeetl.jlw.entity.SchoolClass;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import com.ibeetl.jlw.entity.TeacherOpenCourseNoticeStudent;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeStudentQuery;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
@ -22,7 +27,9 @@ import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* Service
@ -35,17 +42,41 @@ import java.util.List;
@Slf4j
public class TeacherOpenCourseNoticeService extends CoreBaseService<TeacherOpenCourseNotice> implements DeleteResourcesBy{
@Autowired private TeacherOpenCourseNoticeStudentService noticeStudentService;
@Autowired private TeacherOpenCourseNoticeDao teacherOpenCourseNoticeDao;
@Autowired private StudentService studentService;
public PageQuery<TeacherOpenCourseNotice>queryByCondition(PageQuery query){
PageQuery ret = teacherOpenCourseNoticeDao.queryByCondition(query);
queryListAfter(ret.getList());
List<TeacherOpenCourseNotice> list = ret.getList();
queryListAfter(list);
return ret;
}
public PageQuery<TeacherOpenCourseNotice>queryByConditionQuery(PageQuery query){
public PageQuery<TeacherOpenCourseNotice>queryByConditionQuery(PageQuery query, CoreUser coreUser){
PageQuery ret = teacherOpenCourseNoticeDao.queryByConditionQuery(query);
queryListAfter(ret.getList());
List<TeacherOpenCourseNotice> list = ret.getList();
if (coreUser.isStudent()) {
if (CollectionUtil.isNotEmpty(list)) {
Long id = coreUser.getId();
Student student = studentService.getByUserId(id);
if (student != null) {
Long studentId = student.getStudentId();
List<Long> collect = list.stream().map(TeacherOpenCourseNotice::getTeacherOpenCourseNoticeId).collect(Collectors.toList());
TeacherOpenCourseNoticeStudentQuery studentQuery = new TeacherOpenCourseNoticeStudentQuery();
studentQuery.setTeacherOpenCourseNoticeIdPlural(CollectionUtil.join(collect, ","));
List<TeacherOpenCourseNoticeStudent> noticeStudents = noticeStudentService.getValuesByQueryNotWithPermission(studentQuery);
for (TeacherOpenCourseNotice teacherOpenCourseNotice : list) {
TeacherOpenCourseNoticeStudent noticeStudent = noticeStudents.stream().filter(v -> v.getStudentId().equals(studentId) && v.getTeacherOpenCourseNoticeId()
.equals(teacherOpenCourseNotice.getTeacherOpenCourseNoticeId())).findFirst().orElse(null);
teacherOpenCourseNotice.setStudentIsRead(noticeStudent != null);
}
}
}
}
queryListAfter(list);
return ret;
}
@ -166,4 +197,25 @@ public class TeacherOpenCourseNoticeService extends CoreBaseService<TeacherOpenC
public void deleteTeacherOpenCourseAllRelatedByTeacherOpenCourseId(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId) {
log.info("需要实现删除操作!");
}
public void insertStudentRead(TeacherOpenCourseNotice teacherOpenCourseNotice, CoreUser coreUser) {
TeacherOpenCourseNoticeStudentQuery query = new TeacherOpenCourseNoticeStudentQuery();
query.setTeacherOpenCourseNoticeId(teacherOpenCourseNotice.getTeacherOpenCourseNoticeId());
Student student = studentService.getByUserId(coreUser.getId());
if (student == null) {
return;
}
query.setStudentId(student.getStudentId());
List<TeacherOpenCourseNoticeStudent> noticeStudents = noticeStudentService.getValuesByQueryNotWithPermission(query);
if (CollectionUtil.isEmpty(noticeStudents)){
TeacherOpenCourseNoticeStudent noticeStudent = new TeacherOpenCourseNoticeStudent();
noticeStudent.setStudentId(student.getStudentId());
noticeStudent.setTeacherOpenCourseNoticeId(teacherOpenCourseNotice.getTeacherOpenCourseNoticeId());
noticeStudent.setCreateTime(new Date());
noticeStudent.setUserId(coreUser.getId());
noticeStudent.setOrgId(coreUser.getOrgId());
noticeStudentService.insert(noticeStudent);
}
}
}

@ -0,0 +1,171 @@
package com.ibeetl.jlw.service;
import java.io.*;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.math.BigDecimal;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.TeacherOpenCourseNoticeStudentDao;
import com.ibeetl.jlw.entity.TeacherOpenCourseNoticeStudent;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeStudentQuery;
import com.ibeetl.jlw.entity.FileEntity;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.core.SqlId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.beans.factory.annotation.Autowired;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
/**
* Service
* ID使insert(*,true)
*/
@Service
@Transactional
@Validated
public class TeacherOpenCourseNoticeStudentService extends CoreBaseService<TeacherOpenCourseNoticeStudent>{
@Autowired private TeacherOpenCourseNoticeStudentDao teacherOpenCourseNoticeStudentDao;
public PageQuery<TeacherOpenCourseNoticeStudent>queryByCondition(PageQuery query){
PageQuery ret = teacherOpenCourseNoticeStudentDao.queryByCondition(query);
queryListAfter(ret.getList());
return ret;
}
public PageQuery<TeacherOpenCourseNoticeStudent>queryByConditionQuery(PageQuery query){
PageQuery ret = teacherOpenCourseNoticeStudentDao.queryByConditionQuery(query);
queryListAfter(ret.getList());
return ret;
}
public void deleteByList(List list){
String ids = "";
ToolUtils.deleteNullList(list);
for(int i=0;null != list && i<list.size();i++){
ids += list.get(i).toString()+(i==list.size()-1?"":",");
}
if(StringUtils.isNotBlank(ids)){
teacherOpenCourseNoticeStudentDao.deleteTeacherOpenCourseNoticeStudentByIds(ids);
}
}
public void deleteTeacherOpenCourseNoticeStudent(String ids){
try {
teacherOpenCourseNoticeStudentDao.deleteTeacherOpenCourseNoticeStudentByIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除学生阅读公告通知中间表失败", e);
}
}
public String addAll(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
String msg = "";
List<TeacherOpenCourseNoticeStudent> teacherOpenCourseNoticeStudentList = new ArrayList<>();
try {
teacherOpenCourseNoticeStudentList = JSON.parseArray(teacherOpenCourseNoticeStudentQuery.getTeacherOpenCourseNoticeStudentJsonStr(), TeacherOpenCourseNoticeStudent.class);
} catch (Exception e) {
try {
teacherOpenCourseNoticeStudentList.add(JSONObject.parseObject(teacherOpenCourseNoticeStudentQuery.getTeacherOpenCourseNoticeStudentJsonStr(), TeacherOpenCourseNoticeStudent.class));
} catch (Exception e1) {}
}
ToolUtils.deleteNullList(teacherOpenCourseNoticeStudentList);
if(null != teacherOpenCourseNoticeStudentList && teacherOpenCourseNoticeStudentList.size()>0){
for(int i=0;i<teacherOpenCourseNoticeStudentList.size();i++){
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentList.get(i);
teacherOpenCourseNoticeStudent.setUserId(teacherOpenCourseNoticeStudentQuery.getUserId());
teacherOpenCourseNoticeStudent.setOrgId(teacherOpenCourseNoticeStudentQuery.getOrgId());
}
insertBatch(teacherOpenCourseNoticeStudentList);
}
return msg;
}
public JsonResult add(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
String msg = "";
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentQuery.pojo();
teacherOpenCourseNoticeStudentDao.insert(teacherOpenCourseNoticeStudent);
teacherOpenCourseNoticeStudentQuery.setTeacherOpenCourseNoticeStudentId(teacherOpenCourseNoticeStudent.getTeacherOpenCourseNoticeStudentId());
JsonResult jsonResult = new JsonResult();
jsonResult.setData(teacherOpenCourseNoticeStudent.getTeacherOpenCourseNoticeStudentId());//自增的ID丢进去
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
jsonResult.setMsg(msg);
return jsonResult;
}
public String edit(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
String msg = "";
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentQuery.pojo();
teacherOpenCourseNoticeStudentDao.updateTemplateById(teacherOpenCourseNoticeStudent);
return msg;
}
public String updateGivenByIds(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
String msg = "";
if(StringUtils.isNotBlank(teacherOpenCourseNoticeStudentQuery.get_given())){
boolean flag = teacherOpenCourseNoticeStudentDao.updateGivenByIds(teacherOpenCourseNoticeStudentQuery) > 0;
if(!flag){
msg = "更新指定参数失败";
}
}else{
msg = "指定参数为空";
}
return msg;
}
public List<TeacherOpenCourseNoticeStudent> getValues (Object paras){
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseNoticeStudent.getTeacherOpenCourseNoticeStudentValues"), TeacherOpenCourseNoticeStudent.class, paras);
}
public List<TeacherOpenCourseNoticeStudent> getValuesByQuery (TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
return teacherOpenCourseNoticeStudentDao.getValuesByQuery(teacherOpenCourseNoticeStudentQuery);
}
public List<TeacherOpenCourseNoticeStudent> getValuesByQueryNotWithPermission (TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
return teacherOpenCourseNoticeStudentDao.getValuesByQueryNotWithPermission(teacherOpenCourseNoticeStudentQuery);
}
public TeacherOpenCourseNoticeStudent getInfo (Long teacherOpenCourseNoticeStudentId){
TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery = new TeacherOpenCourseNoticeStudentQuery();
teacherOpenCourseNoticeStudentQuery.setTeacherOpenCourseNoticeStudentId(teacherOpenCourseNoticeStudentId);
List<TeacherOpenCourseNoticeStudent> list = teacherOpenCourseNoticeStudentDao.getValuesByQuery(teacherOpenCourseNoticeStudentQuery);
if(null != list && list.size()>0){
return list.get(0);
}else{
return null;
}
}
public TeacherOpenCourseNoticeStudent getInfo (TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery){
List<TeacherOpenCourseNoticeStudent> list = teacherOpenCourseNoticeStudentDao.getValuesByQuery(teacherOpenCourseNoticeStudentQuery);
if(null != list && list.size()>0){
return list.get(0);
}else{
return null;
}
}
}

@ -56,7 +56,7 @@ public class TeacherOpenCourseNoticeController{
return JsonResult.failMessage("请登录后再操作");
}else{
PageQuery page = condition.getPageQuery();
teacherOpenCourseNoticeService.queryByConditionQuery(page);
teacherOpenCourseNoticeService.queryByConditionQuery(page, coreUser);
return JsonResult.success(page);
}
}
@ -119,10 +119,10 @@ public class TeacherOpenCourseNoticeController{
/* 后台接口 */
@PostMapping(MODEL + "/list.json")
@Function("teacherOpenCourseNotice.query")
public JsonResult<PageQuery> list(TeacherOpenCourseNoticeQuery condition){
// @Function("teacherOpenCourseNotice.query")
public JsonResult<PageQuery> list(TeacherOpenCourseNoticeQuery condition, @SCoreUser CoreUser coreUser){
PageQuery page = condition.getPageQuery();
teacherOpenCourseNoticeService.queryByCondition(page);
teacherOpenCourseNoticeService.queryByConditionQuery(page, coreUser);
return JsonResult.success(page);
}
@ -192,9 +192,12 @@ public class TeacherOpenCourseNoticeController{
@GetMapping(MODEL + "/view.json")
@Function("teacherOpenCourseNotice.query")
public JsonResult<TeacherOpenCourseNotice>queryInfo(Long teacherOpenCourseNoticeId) {
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.queryById( teacherOpenCourseNoticeId);
// @Function("teacherOpenCourseNotice.query")
public JsonResult<TeacherOpenCourseNotice>queryInfo(Long teacherOpenCourseNoticeId, @SCoreUser CoreUser coreUser) {
TeacherOpenCourseNotice teacherOpenCourseNotice = teacherOpenCourseNoticeService.queryById(teacherOpenCourseNoticeId);
if (coreUser.isStudent() && teacherOpenCourseNotice != null) {
teacherOpenCourseNoticeService.insertStudentRead(teacherOpenCourseNotice, coreUser);
}
return JsonResult.success(teacherOpenCourseNotice);
}

@ -0,0 +1,230 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.lang.Assert;
import cn.jlw.Interceptor.RFile;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.Interceptor.GetFile;
import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.util.ConvertUtil;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
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.validation.annotation.Validated;
import com.ibeetl.admin.console.web.dto.DictExcelImportData;
import com.ibeetl.admin.console.web.query.UserQuery;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.web.query.*;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Autowired;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
/**
* ---
* 线
*/
@RestController
@Validated
public class TeacherOpenCourseNoticeStudentController{
private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/jlw/teacherOpenCourseNoticeStudent";
private static final String API = "/api/teacherOpenCourseNoticeStudent";
@Autowired private TeacherOpenCourseNoticeStudentService teacherOpenCourseNoticeStudentService;
@Autowired FileService fileService;
/* 前端接口 */
@PostMapping(API + "/getPageList.do")
public JsonResult<PageQuery> getPageList(TeacherOpenCourseNoticeStudentQuery condition,@SCoreUser CoreUser coreUser){
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
PageQuery page = condition.getPageQuery();
teacherOpenCourseNoticeStudentService.queryByConditionQuery(page);
return JsonResult.success(page);
}
}
@GetMapping(API + "/getInfo.do")
public JsonResult<TeacherOpenCourseNoticeStudent>getInfo(TeacherOpenCourseNoticeStudentQuery param,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentService.getInfo(param);
return JsonResult.success(teacherOpenCourseNoticeStudent);
}
}
@GetMapping(API + "/getList.do")
public JsonResult<List<TeacherOpenCourseNoticeStudent>>getList(TeacherOpenCourseNoticeStudentQuery param,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
List<TeacherOpenCourseNoticeStudent>list = teacherOpenCourseNoticeStudentService.getValuesByQuery(param);
return JsonResult.success(list);
}
}
/* 后台页面 */
@GetMapping(MODEL + "/index.do")
@Function("teacherOpenCourseNoticeStudent.query")
public ModelAndView index() {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNoticeStudent/index.html") ;
view.addObject("search", TeacherOpenCourseNoticeStudentQuery.class.getName());
return view;
}
@GetMapping(MODEL + "/edit.do")
@Function("teacherOpenCourseNoticeStudent.edit")
public ModelAndView edit(Long teacherOpenCourseNoticeStudentId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNoticeStudent/edit.html");
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentService.queryById(teacherOpenCourseNoticeStudentId);
view.addObject("teacherOpenCourseNoticeStudent", teacherOpenCourseNoticeStudent);
return view;
}
@GetMapping(MODEL + "/add.do")
@Function("teacherOpenCourseNoticeStudent.add")
public ModelAndView add(Long teacherOpenCourseNoticeStudentId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseNoticeStudent/add.html");
if(null != teacherOpenCourseNoticeStudentId){
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentService.queryById(teacherOpenCourseNoticeStudentId);
view.addObject("teacherOpenCourseNoticeStudent", teacherOpenCourseNoticeStudent);
}else {
view.addObject("teacherOpenCourseNoticeStudent", new TeacherOpenCourseNoticeStudent());
}
return view;
}
/* 后台接口 */
@PostMapping(MODEL + "/list.json")
@Function("teacherOpenCourseNoticeStudent.query")
public JsonResult<PageQuery> list(TeacherOpenCourseNoticeStudentQuery condition){
PageQuery page = condition.getPageQuery();
teacherOpenCourseNoticeStudentService.queryByCondition(page);
return JsonResult.success(page);
}
@PostMapping(MODEL + "/addAll.json")
@Function("teacherOpenCourseNoticeStudent.add")
public JsonResult addAll(TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery,@SCoreUser CoreUser coreUser){
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
teacherOpenCourseNoticeStudentQuery.setUserId(coreUser.getId());
teacherOpenCourseNoticeStudentQuery.setOrgId(coreUser.getOrgId());
String msg = teacherOpenCourseNoticeStudentService.addAll(teacherOpenCourseNoticeStudentQuery);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("新增失败,"+msg);
}
}
}
@PostMapping(MODEL + "/add.json")
@Function("teacherOpenCourseNoticeStudent.add")
public JsonResult add(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery, BindingResult result,@SCoreUser CoreUser coreUser){
if(result.hasErrors()){
return JsonResult.failMessage(result);
}else{
teacherOpenCourseNoticeStudentQuery.setUserId(coreUser.getId());
teacherOpenCourseNoticeStudentQuery.setOrgId(coreUser.getOrgId());
return teacherOpenCourseNoticeStudentService.add(teacherOpenCourseNoticeStudentQuery);
}
}
@PostMapping(MODEL + "/edit.json")
@Function("teacherOpenCourseNoticeStudent.edit")
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) TeacherOpenCourseNoticeStudentQuery teacherOpenCourseNoticeStudentQuery, BindingResult result) {
if(result.hasErrors()){
return JsonResult.failMessage(result);
}else {
Assert.notNull(getUser(), "请登录后再操作");
teacherOpenCourseNoticeStudentQuery.setUserId(null);
teacherOpenCourseNoticeStudentQuery.setOrgId(null);
String msg = teacherOpenCourseNoticeStudentService.edit(teacherOpenCourseNoticeStudentQuery);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败,"+msg);
}
}
}
@GetMapping(MODEL + "/view.json")
@Function("teacherOpenCourseNoticeStudent.query")
public JsonResult<TeacherOpenCourseNoticeStudent>queryInfo(Long teacherOpenCourseNoticeStudentId) {
TeacherOpenCourseNoticeStudent teacherOpenCourseNoticeStudent = teacherOpenCourseNoticeStudentService.queryById( teacherOpenCourseNoticeStudentId);
return JsonResult.success(teacherOpenCourseNoticeStudent);
}
@GetMapping(MODEL + "/getValues.json")
@Function("teacherOpenCourseNoticeStudent.query")
public JsonResult<List<TeacherOpenCourseNoticeStudent>>getValues(TeacherOpenCourseNoticeStudentQuery param) {
List<TeacherOpenCourseNoticeStudent>list = teacherOpenCourseNoticeStudentService.getValuesByQuery(param);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/delete.json")
@Function("teacherOpenCourseNoticeStudent.delete")
@ResponseBody
public JsonResult delete(String ids) {
teacherOpenCourseNoticeStudentService.deleteTeacherOpenCourseNoticeStudent(ids);
return JsonResult.success();
}
}

@ -0,0 +1,133 @@
package com.ibeetl.jlw.web.query;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.jlw.entity.TeacherOpenCourseNoticeStudent;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.Tool;
import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*/
public class TeacherOpenCourseNoticeStudentQuery extends PageParam {
@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
@Query(name = "已阅ID", display = false)
private Long teacherOpenCourseNoticeStudentId;
@Query(name = "通知公告ID", display = false)
private Long teacherOpenCourseNoticeId;
@Query(name = "学生ID", display = false)
private Long studentId;
@Query(name = "创建时间", display = false)
private Date createTime;
@Query(name = "组织ID", display = false)
private Long orgId;
@Query(name = "用户ID", display = false)
private Long userId;
private String teacherOpenCourseNoticeStudentIdPlural;
private String teacherOpenCourseNoticeIdPlural;
private String studentIdPlural;
private String orgIdPlural;
private String userIdPlural;
private String teacherOpenCourseNoticeStudentJsonStr;//json格式
private String _given;//指定更新的特定字段,多个逗号隔开
public Long getTeacherOpenCourseNoticeStudentId(){
return teacherOpenCourseNoticeStudentId;
}
public void setTeacherOpenCourseNoticeStudentId(Long teacherOpenCourseNoticeStudentId ){
this.teacherOpenCourseNoticeStudentId = teacherOpenCourseNoticeStudentId;
}
public Long getTeacherOpenCourseNoticeId(){
return teacherOpenCourseNoticeId;
}
public void setTeacherOpenCourseNoticeId(Long teacherOpenCourseNoticeId ){
this.teacherOpenCourseNoticeId = teacherOpenCourseNoticeId;
}
public Long getStudentId(){
return studentId;
}
public void setStudentId(Long studentId ){
this.studentId = studentId;
}
public Date getCreateTime(){
return createTime;
}
public void setCreateTime(Date createTime ){
this.createTime = createTime;
}
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 TeacherOpenCourseNoticeStudent pojo(){
TeacherOpenCourseNoticeStudent pojo = new TeacherOpenCourseNoticeStudent();
pojo.setTeacherOpenCourseNoticeStudentId(this.getTeacherOpenCourseNoticeStudentId());
pojo.setTeacherOpenCourseNoticeId(this.getTeacherOpenCourseNoticeId());
pojo.setStudentId(this.getStudentId());
pojo.setCreateTime(this.getCreateTime());
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
return pojo;
}
public String getTeacherOpenCourseNoticeStudentIdPlural(){
return teacherOpenCourseNoticeStudentIdPlural;
}
public void setTeacherOpenCourseNoticeStudentIdPlural(String teacherOpenCourseNoticeStudentIdPlural){
this.teacherOpenCourseNoticeStudentIdPlural = teacherOpenCourseNoticeStudentIdPlural;
}
public String getTeacherOpenCourseNoticeIdPlural(){
return teacherOpenCourseNoticeIdPlural;
}
public void setTeacherOpenCourseNoticeIdPlural(String teacherOpenCourseNoticeIdPlural){
this.teacherOpenCourseNoticeIdPlural = teacherOpenCourseNoticeIdPlural;
}
public String getStudentIdPlural(){
return studentIdPlural;
}
public void setStudentIdPlural(String studentIdPlural){
this.studentIdPlural = studentIdPlural;
}
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 getTeacherOpenCourseNoticeStudentJsonStr(){
return teacherOpenCourseNoticeStudentJsonStr;
}
public void setTeacherOpenCourseNoticeStudentJsonStr(String teacherOpenCourseNoticeStudentJsonStr ){
this.teacherOpenCourseNoticeStudentJsonStr = teacherOpenCourseNoticeStudentJsonStr;
}
public String get_given() {
return _given;
}
public void set_given(String _given) {
this._given = _given;
}
}

@ -0,0 +1,271 @@
queryByCondition
===
* 根据不为空的参数进行分页查询
select
@pageTag(){
t.*
@}
from teacher_open_course_notice_student t
where 1=1
@//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("teacherOpenCourseNoticeStudent.query")#
@if(!isEmpty(teacherOpenCourseNoticeStudentId)){
and t.teacher_open_course_notice_student_id =#teacherOpenCourseNoticeStudentId#
@}
@if(!isEmpty(teacherOpenCourseNoticeStudentIdPlural)){
and find_in_set(t.teacher_open_course_notice_student_id,#teacherOpenCourseNoticeStudentIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseNoticeId)){
and t.teacher_open_course_notice_id =#teacherOpenCourseNoticeId#
@}
@if(!isEmpty(teacherOpenCourseNoticeIdPlural)){
and find_in_set(t.teacher_open_course_notice_id,#teacherOpenCourseNoticeIdPlural#)
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(createTime)){
and t.create_time =#createTime#
@}
@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_notice_student t
where 1=1
@if(!isEmpty(teacherOpenCourseNoticeStudentId)){
and t.teacher_open_course_notice_student_id =#teacherOpenCourseNoticeStudentId#
@}
@if(!isEmpty(teacherOpenCourseNoticeStudentIdPlural)){
and find_in_set(t.teacher_open_course_notice_student_id,#teacherOpenCourseNoticeStudentIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseNoticeId)){
and t.teacher_open_course_notice_id =#teacherOpenCourseNoticeId#
@}
@if(!isEmpty(teacherOpenCourseNoticeIdPlural)){
and find_in_set(t.teacher_open_course_notice_id,#teacherOpenCourseNoticeIdPlural#)
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(createTime)){
and t.create_time =#createTime#
@}
@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#)
@}
deleteTeacherOpenCourseNoticeStudentByIds
===
* 批量删除
delete from teacher_open_course_notice_student where find_in_set(teacher_open_course_notice_student_id,#ids#)
getByIds
===
select * from teacher_open_course_notice_student where find_in_set(teacher_open_course_notice_student_id,#ids#)
updateGivenByIds
===
* 批量更新指定字段,无论此字段是否有值
update teacher_open_course_notice_student
set
@if(contain("teacherOpenCourseNoticeId",_given)){
@if(isEmpty(teacherOpenCourseNoticeId)){
teacher_open_course_notice_id = null ,
@}else{
teacher_open_course_notice_id = #teacherOpenCourseNoticeId# ,
@}
@}
@if(contain("studentId",_given)){
@if(isEmpty(studentId)){
student_id = null ,
@}else{
student_id = #studentId# ,
@}
@}
@if(contain("createTime",_given)){
@if(isEmpty(createTime)){
create_time = null ,
@}else{
create_time = #createTime# ,
@}
@}
@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_notice_student_id = teacher_open_course_notice_student_id
where find_in_set(teacher_open_course_notice_student_id,#teacherOpenCourseNoticeStudentIdPlural#)
getTeacherOpenCourseNoticeStudentValues
===
* 根据不为空的参数进行查询
select t.*
from teacher_open_course_notice_student t
where 1=1
@if(!isEmpty(teacherOpenCourseNoticeStudentId)){
and t.teacher_open_course_notice_student_id =#teacherOpenCourseNoticeStudentId#
@}
@if(!isEmpty(teacherOpenCourseNoticeId)){
and t.teacher_open_course_notice_id =#teacherOpenCourseNoticeId#
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(createTime)){
and t.create_time =#createTime#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
getValuesByQuery
===
* 根据不为空的参数进行查询
select t.*
from teacher_open_course_notice_student t
where 1=1 and #function("teacherOpenCourseNoticeStudent.query")#
@if(!isEmpty(teacherOpenCourseNoticeStudentId)){
and t.teacher_open_course_notice_student_id =#teacherOpenCourseNoticeStudentId#
@}
@if(!isEmpty(teacherOpenCourseNoticeStudentIdPlural)){
and find_in_set(t.teacher_open_course_notice_student_id,#teacherOpenCourseNoticeStudentIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseNoticeId)){
and t.teacher_open_course_notice_id =#teacherOpenCourseNoticeId#
@}
@if(!isEmpty(teacherOpenCourseNoticeIdPlural)){
and find_in_set(t.teacher_open_course_notice_id,#teacherOpenCourseNoticeIdPlural#)
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(createTime)){
and t.create_time =#createTime#
@}
@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#)
@}
getValuesByQueryNotWithPermission
===
* 根据不为空的参数进行查询(不包含权限)
select t.*
from teacher_open_course_notice_student t
where 1=1
@if(!isEmpty(teacherOpenCourseNoticeStudentId)){
and t.teacher_open_course_notice_student_id =#teacherOpenCourseNoticeStudentId#
@}
@if(!isEmpty(teacherOpenCourseNoticeStudentIdPlural)){
and find_in_set(t.teacher_open_course_notice_student_id,#teacherOpenCourseNoticeStudentIdPlural#)
@}
@if(!isEmpty(teacherOpenCourseNoticeId)){
and t.teacher_open_course_notice_id =#teacherOpenCourseNoticeId#
@}
@if(!isEmpty(teacherOpenCourseNoticeIdPlural)){
and find_in_set(t.teacher_open_course_notice_id,#teacherOpenCourseNoticeIdPlural#)
@}
@if(!isEmpty(studentId)){
and t.student_id =#studentId#
@}
@if(!isEmpty(studentIdPlural)){
and find_in_set(t.student_id,#studentIdPlural#)
@}
@if(!isEmpty(createTime)){
and t.create_time =#createTime#
@}
@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#)
@}

@ -0,0 +1,38 @@
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseNoticeStudentApi'], function(exports) {
var form = layui.form;
var teacherOpenCourseNoticeStudentApi = layui.teacherOpenCourseNoticeStudentApi;
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 teacherOpenCourseNoticeStudentId = $("#addForm input[name='teacherOpenCourseNoticeStudentId']").val();
if(!$.isEmpty(teacherOpenCourseNoticeStudentId)){
teacherOpenCourseNoticeStudentApi.updateTeacherOpenCourseNoticeStudent($('#addForm'),function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
}else{
teacherOpenCourseNoticeStudentApi.addTeacherOpenCourseNoticeStudent($('#addForm'),function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
}
});
});
$("#addButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('add',view);
});

@ -0,0 +1,23 @@
layui.define(['table', 'teacherOpenCourseNoticeStudentApi'], function(exports) {
var teacherOpenCourseNoticeStudentApi = layui.teacherOpenCourseNoticeStudentApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"teacherOpenCourseNoticeStudentTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些学生阅读公告通知中间表?",function(){
var ids =Common.concatBatchId(data,"teacherOpenCourseNoticeStudentId");
teacherOpenCourseNoticeStudentApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});

@ -0,0 +1,28 @@
layui.define([ 'form', 'laydate', 'table','teacherOpenCourseNoticeStudentApi'], function(exports) {
var form = layui.form;
var teacherOpenCourseNoticeStudentApi = layui.teacherOpenCourseNoticeStudentApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#updateButton").click(function(){
form.on('submit(form)', function(){
teacherOpenCourseNoticeStudentApi.updateTeacherOpenCourseNoticeStudent($('#updateForm'),function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
});
});
$("#updateButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('edit',view);
});

@ -0,0 +1,164 @@
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var teacherOpenCourseNoticeStudentTable = null;
var view ={
init:function(){
var that = this
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),teacherOpenCourseNoticeStudentTable)
that.initToolBar();
}
},
initTable:function(){
var sx_ = localStorage.getItem("teacherOpenCourseNoticeStudentTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
teacherOpenCourseNoticeStudentTable = table.render({
elem : '#teacherOpenCourseNoticeStudentTable',
height : Lib.getTableHeight(1),
cellMinWidth: 100,
method : 'post',
url : Common.ctxPath + '/jlw/teacherOpenCourseNoticeStudent/list.json' // 数据接口
,page : Lib.tablePage // 开启分页
,toolbar: '#toolbar_teacherOpenCourseNoticeStudent' //自定义头部左侧工具栏
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏
,limit : 10,
cols : [ [ // 表头
{
type : 'checkbox',
},
{
field : 'teacherOpenCourseNoticeStudentId',
title : '已阅ID',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['teacherOpenCourseNoticeStudentId'])?false:sx_['teacherOpenCourseNoticeStudentId'],
width : 60,
},
{
field : 'teacherOpenCourseNoticeId',
title : '通知公告ID',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['teacherOpenCourseNoticeId'])?false:sx_['teacherOpenCourseNoticeId'],
},
{
field : 'studentId',
title : '学生ID',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['studentId'])?false:sx_['studentId'],
},
{
field : 'createTime',
title : '创建时间',
align:"center",
hideField :false,
hide:$.isEmpty(sx_['createTime'])?false:sx_['createTime'],
},
{
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 = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button>';
htm += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
return htm;
}
}
] ]
});
table.on('checkbox(teacherOpenCourseNoticeStudentTable)', function(obj){
var teacherOpenCourseNoticeStudent = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
})
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),teacherOpenCourseNoticeStudentTable,form);
},
initToolBar:function(){
toolbar = {
add: function () {
var url = "/jlw/teacherOpenCourseNoticeStudent/add.do";
Common.openDlg(url,"学生阅读公告通知中间表管理>新增");
},
edit: function () {
var data = Common.getOneFromTable(table,"teacherOpenCourseNoticeStudentTable");
if(data==null){
return ;
}
var url = "/jlw/teacherOpenCourseNoticeStudent/add.do?teacherOpenCourseNoticeStudentId="+data.teacherOpenCourseNoticeStudentId;
Common.openDlg(url,"学生阅读公告通知中间表管理>"+data.teacherOpenCourseNoticeStudentId+">编辑");
},
del: function () {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
},
search: function () {
Lib.doSearchForm($("#searchForm"), teacherOpenCourseNoticeStudentTable, 1);
view.initToolBar()
},
refresh: function () {
searchForm.reset();
Lib.doSearchForm($("#searchForm"), teacherOpenCourseNoticeStudentTable, 1);
view.initToolBar()
},
}
//触发事件
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}, initTableTool: table.on('tool(teacherOpenCourseNoticeStudentTable)', function (obj) {
var data = obj.data;
if (obj.event === 'edit') {
var url = "/jlw/teacherOpenCourseNoticeStudent/add.do?teacherOpenCourseNoticeStudentId="+data.teacherOpenCourseNoticeStudentId;
Common.openDlg(url,"学生阅读公告通知中间表管理>"+data.teacherOpenCourseNoticeStudentId+">编辑");
}else if(obj.event === "del"){
layer.confirm('是否确定删除该信息?', function (index) {
var ret = Common.postAjax("/jlw/teacherOpenCourseNoticeStudent/delete.json",{ids:data.teacherOpenCourseNoticeStudentId});
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);
});

@ -0,0 +1,18 @@
/*访问后台的代码*/
layui.define([], function(exports) {
var api={
updateTeacherOpenCourseNoticeStudent:function(form,callback){
Lib.submitForm("/jlw/teacherOpenCourseNoticeStudent/edit.json",form,{},callback)
},
addTeacherOpenCourseNoticeStudent:function(form,callback){
Lib.submitForm("/jlw/teacherOpenCourseNoticeStudent/add.json",form,{},callback)
},
del:function(ids,callback){
Common.post("/jlw/teacherOpenCourseNoticeStudent/delete.json",{"ids":ids},function(){
callback();
})
}
};
exports('teacherOpenCourseNoticeStudentApi',api);
});

@ -0,0 +1,56 @@
<!--# layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseNoticeStudent/"}){ -->
<form class="layui-form" id="addForm">
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">通知公告ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherOpenCourseNoticeId" name="teacherOpenCourseNoticeId" value="${teacherOpenCourseNoticeStudent.teacherOpenCourseNoticeId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">学生ID</label>
<div class="layui-input-inline">
<input type="text" id="studentId" name="studentId" value="${teacherOpenCourseNoticeStudent.studentId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">
<input type="text" id="createTime" name="createTime" value="${teacherOpenCourseNoticeStudent.createTime,"yyyy-MM-dd"}" class="layui-input input-date" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${teacherOpenCourseNoticeStudent.orgId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherOpenCourseNoticeStudent.userId}" class="layui-input" >
</div>
</div>
</div>
</div>
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="teacherOpenCourseNoticeStudentId" value="${teacherOpenCourseNoticeStudent.teacherOpenCourseNoticeStudentId}" />
<layui:submitButtons id="addButton" buttonType="" showExamine="2" />
</form>
<!--#} -->
<script>
layui.use(['add'], function(){
var teacherOpenCourseNoticeStudentAdd = layui.add
teacherOpenCourseNoticeStudentAdd.init();
});
</script>

@ -0,0 +1,56 @@
<!--# layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseNoticeStudent/"}){ -->
<form class="layui-form" id="updateForm">
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">通知公告ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherOpenCourseNoticeId" name="teacherOpenCourseNoticeId" value="${teacherOpenCourseNoticeStudent.teacherOpenCourseNoticeId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">学生ID</label>
<div class="layui-input-inline">
<input type="text" id="studentId" name="studentId" value="${teacherOpenCourseNoticeStudent.studentId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">
<input type="text" id="createTime" name="createTime" value="${teacherOpenCourseNoticeStudent.createTime,"yyyy-MM-dd"}" class="layui-input input-date" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${teacherOpenCourseNoticeStudent.orgId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${teacherOpenCourseNoticeStudent.userId}" class="layui-input" >
</div>
</div>
</div>
</div>
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="teacherOpenCourseNoticeStudentId" value="${teacherOpenCourseNoticeStudent.teacherOpenCourseNoticeStudentId}" />
<layui:submitButtons id="updateButton" buttonType="" showExamine="2" />
</form>
<!--#} -->
<script>
layui.use(['edit'], function(){
var teacherOpenCourseNoticeStudentEdit = layui.edit
teacherOpenCourseNoticeStudentEdit.init();
});
</script>

@ -0,0 +1,29 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/teacherOpenCourseNoticeStudent/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<table id="teacherOpenCourseNoticeStudentTable" lay-filter="teacherOpenCourseNoticeStudentTable"></table>
<!--#} -->
<script type="text/html" id="toolbar_teacherOpenCourseNoticeStudent">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!--# if(core.searchIsShow(search)) {-->
<layui:accessButton function="teacherOpenCourseNoticeStudent.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
<layui:accessButton function="teacherOpenCourseNoticeStudent.add" action="add">添加</layui:accessButton>
<layui:accessButton function="teacherOpenCourseNoticeStudent.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="teacherOpenCourseNoticeStudent.del" action="del">删除</layui:accessButton>
<!--# if(!isEmpty(search)) {-->
<layui:accessButton function="teacherOpenCourseNoticeStudent.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
</div>
</div>
</script>
<script>
layui.use(['index'], function(){
var index = layui.index;
index.init();
});
</script>
Loading…
Cancel
Save