学生读取公告
parent
e5e1773731
commit
12951da3c5
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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,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,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,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"></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"></i>刷新</layui:accessButton>
|
||||
<!--# }-->
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
|
||||
layui.use(['index'], function(){
|
||||
var index = layui.index;
|
||||
index.init();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue