——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于javaweb的SSM+Maven教室预约管理系统(java+jsp+ssm+bootstrap+javascript+mysql)
项目介绍
本项目包含管理员与用户两种角色;
管理员角色包含以下功能: 管理员登陆,教室信息管理,预约审核,预约记录查询,注册用户等功能。
用户角色包含以下功能: 用户登录,教室信息查询,预约记录查询,预约教室,个人信息修改等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery+bootstrap
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
——————————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
| List<ReservationVo> list = null;
PagingVO pagingVO = new PagingVO(); pagingVO.setTotalCount(reservationService.reservationNoPassCount()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = reservationService.findRejectRecord(pagingVO); } else { pagingVO.setToPageNo(page); list = reservationService.findRejectRecord(pagingVO); }
model.addAttribute("recordList", list); model.addAttribute("pagingVo", pagingVO);
return "/admin/showRecordReject"; }
@RequestMapping(value = "/userRegister", method = {RequestMethod.GET}) public String userRegister(Model model) throws Exception { return "/admin/userRegister"; }
@RequestMapping(value = "/userRegister",method = RequestMethod.POST) public String userRegister(User user) throws Exception{ if(user.getId()!=null && user.getId()!="" && user.getPassword()!=null && user.getPassword()!=""){ user.setUsername(user.getId()); userService.addNewUser(user); } return "redirect:/admin/userRegister"; } } package com.em.controller;
|
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
|
@RequestMapping(value = "/addRoom", method = {RequestMethod.GET}) public String addRoom(Model model) throws Exception {
return "/admin/addRoom"; }
@RequestMapping(value = "/addRoom", method = {RequestMethod.POST}) public String addRoom(Room room, Model model) throws Exception {
roomService.add(room);
return "redirect:/admin/showRoom"; }
@RequestMapping(value = "/editRoom", method = {RequestMethod.GET}) public String editRoomUI(Integer id, Model model) throws Exception { if (id == null) { return "redirect:/admin/showRoom"; } Room room = roomService.findById(id); model.addAttribute("roomList", room);
return "/admin/editRoom"; }
@RequestMapping(value = "/editRoom", method = {RequestMethod.POST}) public String editRoom(Room room) throws Exception { roomService.updateById(room);
return "redirect:/admin/showRoom"; }
@RequestMapping(value = "/showUser", method = {RequestMethod.GET}) private String showUser(Model model,HttpServletRequest request) throws Exception { String id = String.valueOf(request.getSession().getAttribute("admin")); User user = userService.findUserById(id); model.addAttribute("object", user); return "/admin/showUser"; }
@RequestMapping(value = "/changeUser", method = {RequestMethod.POST}) private String changeUser(String password, String username, Model model,HttpServletRequest request) throws Exception { String id = String.valueOf(request.getSession().getAttribute("admin"));
|
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
|
@Controller @RequestMapping("/admin") public class AdminController {
@Resource(name = "roomServiceImpl") private RoomService roomService;
@Resource(name = "reservationServiceImpl") private ReservationService reservationService;
@Resource(name = "userServiceImpl") private UserService userService;
@RequestMapping("/showRoom") public String showRoom(Model model, Integer page) throws Exception {
List<Room> list = null; PagingVO pagingVO = new PagingVO(); pagingVO.setTotalCount(roomService.roomCount()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = roomService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = roomService.findByPaging(page); }
model.addAttribute("roomList", list); model.addAttribute("pagingVO", pagingVO);
return "/admin/showRoom";
|
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
| @RequestMapping(value = "/userRegister", method = {RequestMethod.GET}) public String userRegister(Model model) throws Exception { return "/admin/userRegister"; }
@RequestMapping(value = "/userRegister",method = RequestMethod.POST) public String userRegister(User user) throws Exception{ if(user.getId()!=null && user.getId()!="" && user.getPassword()!=null && user.getPassword()!=""){ user.setUsername(user.getId()); userService.addNewUser(user); } return "redirect:/admin/userRegister"; } } package com.em.controller;
@Controller @RequestMapping("/ordinary") public class OrdinaryController {
|
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
|
@RequestMapping("/showRoom") public String showRoom(Model model, Integer page) throws Exception {
List<Room> list = null; PagingVO pagingVO = new PagingVO(); pagingVO.setTotalCount(roomService.roomCount()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = roomService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = roomService.findByPaging(page); }
model.addAttribute("roomList", list); model.addAttribute("pagingVO", pagingVO);
return "/ordinary/showRoom"; }
@RequestMapping(value = "/queryRoom", method = {RequestMethod.POST}) private String queryRoom(String findByName, Model model) throws Exception {
List<Room> list = roomService.findByName(findByName);
model.addAttribute("roomList", list); return "/ordinary/showRoom"; }
@RequestMapping(value = "/showUser", method = {RequestMethod.GET}) private String showUser(Model model,HttpServletRequest request) throws Exception { String id = String.valueOf(request.getSession().getAttribute("user")); User user = userService.findUserById(id);
|
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
| if (page == null || page == 0) { pagingVO.setToPageNo(1); list = roomService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = roomService.findByPaging(page); }
model.addAttribute("roomList", list); model.addAttribute("pagingVO", pagingVO);
return "/admin/showRoom"; }
@RequestMapping(value = "/queryRoom", method = {RequestMethod.POST}) private String queryRoom(String findByName, Model model) throws Exception {
List<Room> list = roomService.findByName(findByName);
model.addAttribute("roomList", list); return "/admin/showRoom"; }
@RequestMapping(value = "/addRoom", method = {RequestMethod.GET}) public String addRoom(Model model) throws Exception {
return "/admin/addRoom"; }
@RequestMapping(value = "/addRoom", method = {RequestMethod.POST}) public String addRoom(Room room, Model model) throws Exception {
roomService.add(room);
return "redirect:/admin/showRoom"; }
@RequestMapping(value = "/editRoom", method = {RequestMethod.GET}) public String editRoomUI(Integer id, Model model) throws Exception { if (id == null) { return "redirect:/admin/showRoom"; } Room room = roomService.findById(id); model.addAttribute("roomList", room);
return "/admin/editRoom"; }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=011122532008200pr
https://javayms.pages.dev?id=011122532008200pr