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






基于javaweb的SSM自习室图书馆座位预约管理系统(java+ssm+jsp+easyui+mysql)
项目介绍
一款由jsp+ssm+mysql实现的图书馆预约占座管理系统,前端采用的是当下最流行的easyui框架,后台用的ssm(spring、springMVC、mybaits)框架.添加学生和教师时会自动在用户表中注册,定时任务会定时生成座位信息,阅览室分类中可设置信用等级,学生被扣分后信用等级低于相应的值后不能预约相应的阅览室座位.本项目分为管理员、教师、学生三种角色。
管理员角色包含以下功能: 管理员登陆,用户管理,师生信息管理,阅览室管理,信用积分管理,交流管理,信息统计,图书推荐等功能。
教师角色包含以下功能: 教师角色登陆,个人信息管理,管理学生的信用积分等功能。
学生角色包含以下功能: 学生账号登陆,阅览室信息查看,信息积分查看,选座位,选座管理,通知信息管理,信息交流,图书推荐等功能。
环境需要
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+easyUI
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中config.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 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| @Autowired private UserService<User> userService;
@RequestMapping("teacherIndex") public String index(){ return "info/teacher"; }
@RequestMapping("teacherList") public void teacherList(HttpServletRequest request,HttpServletResponse response){ try { page = Integer.parseInt(request.getParameter("page")); rows = Integer.parseInt(request.getParameter("rows")); teacher = new Teacher(); teacher.setPage((page-1)*rows); teacher.setRows(rows); teacher.setName(request.getParameter("name")); teacher.setNo(request.getParameter("no")); User currentUser = (User)request.getSession().getAttribute("currentUser"); if(currentUser.getRoleId()==2){ teacher.setNo(currentUser.getUserName()); } List<Teacher> list = teacherService.findTeacher(teacher); int total = teacherService.countTeacher(teacher); JSONObject jsonObj = new JSONObject(); jsonObj.put("total",total ); jsonObj.put("rows", list); WriterUtil.write(response,jsonObj.toString()); } catch (Exception e) { e.printStackTrace(); } }
@RequestMapping("reserveTeacher") public void reserve(HttpServletRequest request,HttpServletResponse response,Teacher teacher) { JSONObject result = new JSONObject(); result.put("success", true); String id = request.getParameter("id"); try { if(StringUtil.isNotEmpty(id)){ teacher.setId(Integer.parseInt(id)); teacherService.updateTeacher(teacher);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
@Controller @RequestMapping("seat") public class SeatController {
private int page; private int rows; @Autowired private SeatService<Seat> seatService; private Seat seat; @Autowired private RoomService<Room> roomService; @Autowired private ChoiceService<Choice> choiceService; private Choice choice; @Autowired private ScoreService<Score> scoreService; private Score score;
|
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
| if (sonNum == 1) { menu = new Menu(); menu.setMenuId(Integer.parseInt(parentId)); menu.setState("open"); menuService.updateMenu(menu); menuService.deleteMenu(Integer.parseInt(menuId)); } else { menuService.deleteMenu(Integer.parseInt(menuId)); } result.put("success", true); } } catch (Exception e) { e.printStackTrace(); result.put("errorMsg", "对不起,删除失败!"); } WriterUtil.write(response, result.toString()); }
} package dingzhen.controller;
@Controller @RequestMapping("log")
|
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
| public static Date getNextDay(Date date,int day) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DAY_OF_MONTH, day); date = calendar.getTime(); return date; } } package dingzhen.util;
@Component @Controller public class SeatUtil { @Autowired private SeatService<Seat> seatService; @Autowired private RoomService<Room> roomService; @Autowired private ChoiceService<Choice> choiceService; @Scheduled(cron = "0 0 23 * * ?") @RequestMapping("addSeat") public void generateNextDay(){ System.out.println("生成座位1"); addNewSeat(1);
|
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
| }
@RequestMapping("friendList") public void list(HttpServletRequest request,HttpServletResponse response){ try { User currentUser = (User)request.getSession().getAttribute("currentUser"); String currentStudentno = currentUser.getUserName(); choice = new Choice(); choice.setStudentno(currentStudentno); List<Choice> currentList = choiceService.findChoice(choice); String currentKeyword = ""; if(currentList != null && currentList.size() >0){ currentKeyword = currentList.get(0).getSeatkeyword(); currentKeyword = currentKeyword.substring(11, 20); Choice c = new Choice(); c.setSeatkeyword(currentKeyword); c.setStudentno(currentStudentno); Date today = new Date(); Date lastDay = getNextDay(today, -20); c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(lastDay)); c.setPipeishu(3); List<Choice> friendList = choiceService.findFriend(c); List<Student> friendStudent = new ArrayList<Student>(); if(friendList == null || friendList.size()==0){ } else if (friendList.size() > 10) { for(int i=0;i<10;i++){ Choice friendChoice = friendList.get(i); String friendStudentno = friendChoice.getStudentno(); student = studentService.findOneStudentByno(friendStudentno); friendStudent.add(student); } } else { for(int i=0;i<friendList.size();i++){ Choice friendChoice = friendList.get(i); String friendStudentno = friendChoice.getStudentno();
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=151122582008200va
https://javayms.pages.dev?id=151122582008200va