——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot教务管理系统(java+springboot+thymeleaf+layui+html+mysql+maven)
项目介绍
1.系统默认超级管理员账号为admin,默认密码为123456 系统配置:用户管理、角色管理、权限管理 默认已配置好基本数据:用户默认只有一个超级管理员,角色有三种:管理员、教师、学生,权限已按照角色分配完成。 2.系统建设 a.建设简介: 学校建设需要按照系部 > 专业 > 年级 > 班级的顺序进行建设。每项管理均提供精确/条件查询,可快速定位所需信息。 b.系部建设 c.专业建设 d.年级建设 3,课目建设 a.课目介绍 b.添加必修课目 c.添加选修课目 d.课目启动与暂停 4.教师管理 a.教师授课管理 b.录入教师 c.教师信息查询 5.学生管理: a,退学信息 b.录入学生 c.学生信息查询 6.成绩管理 a.学生成绩管理 b.教师成绩管理 7.校园新闻: a,新闻管理
b.发布新闻
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7版本;
技术栈
后端:SpringBoot+Thymeleaf
前端:HTML+CSS+jQuery+LayUI
使用说明 运行项目,输入localhost:8080/home 登录 管理员账号/密码:admin/123456 教师账号/密码:2020001/123456 学生账号/密码:15020002/123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 @RequestMapping("findalltch") @ResponseBody public Object findAllTch (TeacherDB teacherDB, Integer page, Integer limit) { PageHelper.startPage(page, limit); List<TeacherDB> listAll = tchCourseService.findAllTch(teacherDB); PageInfo pageInfo = new PageInfo(listAll); Map<String, Object> tchData = new HashMap<String, Object>(); tchData.put("code" , 0 ); tchData.put("msg" , "" ); tchData.put("count" , pageInfo.getTotal()); tchData.put("data" , pageInfo.getList()); return tchData; } @RequestMapping("findalltchbyname") @ResponseBody public Object findAllTchByName (Integer page, Integer limit) { PageHelper.startPage(page, limit); List<TeacherDB> listAll = tchCourseService.findAllTchByName(); PageInfo pageInfo = new PageInfo(listAll); Map<String, Object> tchData = new HashMap<String, Object>(); tchData.put("code" , 0 ); tchData.put("msg" , "" ); tchData.put("count" , pageInfo.getTotal()); tchData.put("data" , pageInfo.getList()); return tchData; } @RequestMapping("findallcoursebymajorname") @ResponseBody public Object findAllCourseByMajorName (TchCourseVO tchCourseVO,Integer page, Integer limit) { PageHelper.startPage(page, limit); List<TeacherDB> listAll = tchCourseService.findAllCourseByMajorName(tchCourseVO); PageInfo pageInfo = new PageInfo(listAll); Map<String, Object> csData = new HashMap<String, Object>(); csData.put("code" , 0 ); csData.put("msg" , "" ); csData.put("count" , pageInfo.getTotal()); csData.put("data" , pageInfo.getList()); return csData; } @RequestMapping("findtchcourseclassname")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 response.setHeader("Cache-Control" , "no-cache" ); response.setDateHeader("Expires" , 0 ); String verifyCode = captchaProducer.createText(); request.getSession().setAttribute(Constants.VALIDATE_CODE, verifyCode); LOGGER.info("本次生成的验证码为[" + verifyCode + "],已存放到HttpSession中" ); response.setContentType("image/jpeg" ); BufferedImage bufferedImage = captchaProducer.createImage(verifyCode); ImageIO.write(bufferedImage, "JPEG" , response.getOutputStream()); } @PostMapping("admin/login") @SysLog("用户登录") @ResponseBody public ResponseEntity adminLogin (HttpServletRequest request) { String username = request.getParameter("username" ); String password = request.getParameter("password" ); String rememberMe = request.getParameter("rememberMe" ); String code = request.getParameter("code" ); String driver = request.getParameter("driver" ); String errorMsg = null ; if (StringUtils.isBlank(driver)){ if (StringUtils.isBlank(username) || StringUtils.isBlank(password)){ return ResponseEntity.failure("用户名或者密码不能为空" ); }else if (StringUtils.isBlank(code)){ return ResponseEntity.failure("验证码不能为空" ); } HttpSession session = request.getSession(); if (session == null ){ return ResponseEntity.failure("session超时" ); } String trueCode = (String)session.getAttribute(Constants.VALIDATE_CODE); if (StringUtils.isBlank(trueCode)){ return ResponseEntity.failure("验证码超时" ); } if (StringUtils.isBlank(code) || !trueCode.toLowerCase().equals(code.toLowerCase())){ return ResponseEntity.failure("验证码错误" ); }else { Subject user = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username,password,Boolean.valueOf(rememberMe)); try { user.login(token); }catch (IncorrectCredentialsException e) { errorMsg = "用户名密码错误!" ; }catch (UnknownAccountException e) { errorMsg = "账户不存在!" ; }catch (LockedAccountException e) { errorMsg = "账户已被锁定!" ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 return "view/student/addStudent" ; } @RequestMapping("addStudent") @ResponseBody public LayuiResult<StudentDB> addStudent (StudentVO studentVO, String birthday, String tertime) throws Exception { LayuiResult<StudentDB> result= new LayuiResult<>(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd" ); Date date1=format.parse(birthday); Date date2=format.parse(tertime); studentVO.setSbirthday(date1); studentVO.setEntertime(date2); Integer year = addStudentService.selectStuYear(studentVO.getClassid()); if (year !=0 ){ Integer fenge = addStudentService.stuSegmentation(studentVO.getClassid()); } int stui = addStudentService.selStuid(studentVO.getGid()); studentVO.setStuid(String.valueOf(stui)); studentVO.setSid(stui); Integer addStudent = addStudentService.addStudent(studentVO); String stuid = studentVO.getStuid(); Integer sid = addStudentService.selectSid(stuid); Integer mid = studentVO.getMid(); List<CourseDB> selCourse = addStudentService.selCourse(mid); for (CourseDB cou : selCourse){ Integer addStuCourse = addStudentService.addStuCourse(sid,cou.getCid()); System.out.println(addStuCourse); } Integer selClassinfo = addStudentService.selecteClassinfo(studentVO.getClassid()); Integer selGrade = addStudentService.selecteGrade(studentVO.getGid()); Integer selMajor = addStudentService.selecteMajor(studentVO.getMid()); Integer selDepartment = addStudentService.selecteDepartment(studentVO.getDid()); List<StudentDB> stu = addStudentService.selectMessage(stuid);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 public Object findAllWeeks (Integer page, Integer limit) { PageHelper.startPage(page, limit); List<WeeksDB> listAll = tchCourseService.findAllWeeks(); PageInfo pageInfo = new PageInfo(listAll); Map<String, Object> wData = new HashMap<String, Object>(); wData.put("code" , 0 ); wData.put("msg" , "" ); wData.put("count" , pageInfo.getTotal()); wData.put("data" , pageInfo.getList()); return wData; } @RequestMapping("findallschedule") @ResponseBody public Object findAllSchedule (Integer page, Integer limit) { PageHelper.startPage(page, limit); List<ScheduleDB> listAll = tchCourseService.findAllSchedule(); PageInfo pageInfo = new PageInfo(listAll); Map<String, Object> sData = new HashMap<String, Object>(); sData.put("code" , 0 ); sData.put("msg" , "" ); sData.put("count" , pageInfo.getTotal()); sData.put("data" , pageInfo.getList()); return sData; } @RequestMapping("addonetchcourse") @ResponseBody public Object addOneTchCourse (TchCourseVO tchCourseVO) { int flag = tchCourseService.findTchCourseFlag(tchCourseVO); if (flag>0 ){ return false ; }else {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 }else { Subject user = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username,password,Boolean.valueOf(rememberMe)); try { user.login(token); }catch (IncorrectCredentialsException e) { errorMsg = "用户名密码错误!" ; }catch (UnknownAccountException e) { errorMsg = "账户不存在!" ; }catch (LockedAccountException e) { errorMsg = "账户已被锁定!" ; }catch (UserTypeAccountException e) { errorMsg = "账户不是管理用户!" ; } if (StringUtils.isBlank(errorMsg)) { ResponseEntity responseEntity = new ResponseEntity(); responseEntity.setSuccess(Boolean.TRUE); responseEntity.setAny("url" ,"index" ); return responseEntity; }else { return ResponseEntity.failure(errorMsg); } } }else { if (StringUtils.isBlank(username) || StringUtils.isBlank(password)){ return ResponseEntity.failure("用户名或者密码不能为空" ); } Subject user = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(username,password,Boolean.valueOf(rememberMe)); try { user.login(token); }catch (IncorrectCredentialsException e) { errorMsg = "用户名或密码错误!" ; }catch (UnknownAccountException e) { errorMsg = "账户不存在!" ; }catch (LockedAccountException e) { errorMsg = "账户已被锁定!" ; }catch (UserTypeAccountException e) { errorMsg = "账户不是管理用户!" ; } if (StringUtils.isBlank(errorMsg)) { ResponseEntity responseEntity = new ResponseEntity(); responseEntity.setSuccess(Boolean.TRUE); responseEntity.setAny("url" ,"index" ); return responseEntity; }else {
——————————PayStart——————————
项目链接: https://javayms.github.io?id=531422312105200jd https://javayms.pages.dev?id=531422312105200jd