基于java图书馆借阅管理系统

图书馆借阅管理系统是基于java编程语言和mysql数据库设计,本系统分为读者用户和管理员两个角色,其中用户可以注册后登陆系统,查看图书信息,在线借阅图书,查看借阅历史记录,热门图书,在线反馈等;管理员登陆后,可以管理图书,用户,借阅信息,图书分类,反馈等信息。本设计功能齐全,界面整洁,功能齐全,适合作为java毕业设计和课程设计参考学习。


一.技术环境

jdk版本:1.8 及以上
IDE工具:eclipse
java框架:servlet+jsp
数据库: mysql 及5.5 以上
编程语言: Java
tomcat: 8.0 及以上
详细技术:HTML+CSS+JS+JSP+JAVA+SERVLET+MYSQL+JQUERY


二.项目文件(项目获取请看文末官网)


三.系统功能


四.代码示例

package com.lmu.controller;/*** 用户新增*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.Pager;
import com.lmu.utils.UserUtils;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.awt.event.FocusEvent;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;@Controller("userController")
@Scope("prototype")
public class UserController extends ActionSupport implements ModelDriven<User> {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Integer userId;private Map<String, Object> map = new HashMap();/*** list** @return*/public String list() throws IOException {User user1 = UserUtils.getUser();if (user1 == null || user1.getId() == null){ActionContext.getContext().put("login", 1);return SUCCESS;}Pager<User> pagers = null;Role role = user1.getRole();if (role.getEnName().equals("admin")) {pagers = userService.getList(user);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("user", user1);ActionContext.getContext().put("role", role);ActionContext.getContext().put("bean", user);return SUCCESS;} else if (role.getEnName().equals("xs") || role.getEnName().equals("js")) {pagers = userService.getList(user1);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("bean", user);return SUCCESS;}return null;}/*** 跳转add** @return*/public String add() {Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 查询修改** @return*/public String edit() {User bean = userService.findById(userId);Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("bean", bean);ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 审核** @return*/public void updateSh() throws IOException {user.setIsSh(1);userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}/*** 更新** @return*/public String update() throws IOException {if (user.getPass().equals("")){user.setPass(null);}userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);return SUCCESS;}/*** 保存** @return*/public void save() throws IOException {if (userService.getUser(user) != null){map.put("flag", false);map.put("url", "login_login.do");JsonUtils.toJson(map);} else {user.setTime(new Date());userService.save(user);map.put("flag", true);map.put("url", "login_login.do");JsonUtils.toJson(map);}}public void delete() throws IOException {User user1 = userService.findById(userId);user1.setIsDelete(1);userService.update(user1);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}@Overridepublic User getModel() {if (user == null) {user = new User();}return user;}public Integer getUserId() {return userId;}public void setUserId(Integer userId) {this.userId = userId;}public User getUser() {return user;}public void setUser(User user) {this.user = user;}
}
package com.lmu.controller;
/*** 和登陆有关的都在这里*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.UserUtils;import org.apache.commons.collections.map.HashedMap;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.io.IOException;
import java.util.HashMap;
import java.util.Map;@Controller("loginController")
@Scope("prototype")
public class LoginController extends ActionSupport {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Map<String, Object> map = new HashMap();public User getUser() {return user;}public void setUser(User user) {this.user = user;}public UserService getUserService() {return userService;}public void setUserService(UserService userService) {this.userService = userService;}/*** 用户登陆* @return*/public void index() throws IOException {User user1 = userService.getUser(user);if (user1 != null){if (user1.getIsSh() == 1){if (user1.getRole().getEnName().equals("admin")){ActionContext.getContext().getSession().put("user", user1);}if (user1.getRole().getEnName().equals("js")){ActionContext.getContext().getSession().put("user1", user1);}if (user1.getRole().getEnName().equals("xs")){ActionContext.getContext().getSession().put("user2", user1);}map.put("flag", 1);map.put("url", "login_indexs.do");map.put("id", user1.getId());JsonUtils.toJson(map);} else {map.put("flag", 2);JsonUtils.toJson(map);}} else {map.put("flag", 3);JsonUtils.toJson(map);}}public String indexs() throws IOException {User u = UserUtils.getUser();if (u != null){ActionContext.getContext().put("user", u);String ss = u.getRole().getEnName();ActionContext.getContext().put("role", u.getRole().getEnName());}return SUCCESS;}//登陆页面public String login() {return SUCCESS;}//退出public String tuichu() {ActionContext ac = ActionContext.getContext();Map session = ac.getSession();session.remove("userName");session.remove("userId");ServletActionContext.getRequest().getSession().invalidate();return "login";}}

五.项目截图














基于java图书馆借阅管理系统获取(java毕业设计)相关推荐

  1. 基于php在线考试管理系统获取(php毕业设计)

    基于php在线考试管理系统 在线考试管理系统是基于php编程语言,Thinkphp框架设计,mysql数据库设计,本设计拥有考生和管理员两个角色,其中考生可以注册和登陆系统,进行在线考试,提交试卷,查 ...

  2. 基于Java的图书馆借阅管理系统的设计与实现--毕业开题报告

    基于Java的图书馆借阅管理系统的设计与实现–开题报告 这个先写一版开题报告,后续有时间给大家提供论文 . 题目:基于Java的图书馆借阅管理系统的设计与实现 一.选题依据 1.国内外有关的研究动态 ...

  3. 基于javaweb的图书馆借阅管理系统(java+springboot+bootstrap+html+mysql)

    基于javaweb的图书馆借阅管理系统(java+springboot+bootstrap+html+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/my ...

  4. 基于JAVA图书馆借阅系统计算机毕业设计源码+数据库+lw文档+系统+部署

    基于JAVA图书馆借阅系统计算机毕业设计源码+数据库+lw文档+系统+部署 基于JAVA图书馆借阅系统计算机毕业设计源码+数据库+lw文档+系统+部署 本源码技术栈: 项目架构:B/S架构 开发语言: ...

  5. 基于java图书借阅管理系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署

    基于java图书借阅管理系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署 基于java图书借阅管理系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署 开发语言:Jav ...

  6. 基于JAVA图书馆座位预约系统计算机毕业设计源码+数据库+lw文档+系统+部署

    基于JAVA图书馆座位预约系统计算机毕业设计源码+数据库+lw文档+系统+部署 基于JAVA图书馆座位预约系统计算机毕业设计源码+数据库+lw文档+系统+部署 本源码技术栈: 项目架构:B/S架构 开 ...

  7. 【计算机毕业设计】图书馆借阅管理系统

    一.系统截图(需要演示视频可以私聊) 摘  要 21世纪的今天,随着社会的不断发展与进步,人们对于信息科学化的认识,已由低层次向高层次发展,由原来的感性认识向理性认识提高,管理工作的重要性已逐渐被人们 ...

  8. Android项目:基于Android图书馆借阅系统app毕业设计(计算机毕业设计)

    目前,大多数基于Android平台的移动图书馆的主要功能集成了传统的馆藏图书查询.图书预约.图书续借等功能,较好地满足了人们随时随地访问图书馆的需要.但是,整个图书系统仍处在初期阶段,仍存在一些不足和 ...

  9. 微信小程序毕业设计 基于微信图书馆借阅小程序系统开题报告功能参考

    微信小程序毕业设计 基于微信图书馆借阅小程序系统开题报告功能参考 下面是功能实现效果图:大家可以参考

最新文章

  1. numpy.savetxt()保存两列
  2. 姚班系创业公司宸镜科技再获新融资,漆子超、陈启峰联手,OPPO入股加持“元宇宙”概念要火?...
  3. python制作缩略图
  4. (译)如何使用cocos2d来制作一个打地鼠的游戏:第一部分
  5. 一些简单网络命令用法
  6. 修改xp boot.ini文件
  7. php图片显示框,【转】php让图片弹出下载框的方法
  8. 操作系统进程(作业)调度常见算法详解
  9. MSSQL调优实战一 乱建聚集索引的后果
  10. centos tomcat部署
  11. webpack5学习与实战-(八)-配置打包后的文件名
  12. 弯管机编程软件电脑版_乐高Wedo2.0电脑版下载
  13. SAP ABAP开发入门-徐春波-专题视频课程
  14. 操作系统复习笔记--第十一、十二章 文件系统的实现与大容量存储结构
  15. 软件质量(六大要素及其分析)
  16. WIN7激活工具拒绝访问cannot open file C:\OEMSF解决方法
  17. 企业邮箱的好处有哪些?企业邮箱使用场景
  18. 轻型异常在线检测器LODA:Lightweight on-line detector of anomalies
  19. 15.7 项目:多线程 XKCD 下载程序
  20. springsecurity 配置

热门文章

  1. 任务二:Crypto学习
  2. Adobe Acrobat XI Pro安装
  3. 妙不可言,Sklearn 做异常检测这么简单
  4. MySQL制定启动配置文件_mysql指定配置文件启动
  5. 宁波栎社机场停车场怎么收费,栎社机场停车场收费标准
  6. 多层高速PCB设计学习笔记(五)四层板实战(下)之阻抗控制计算(SI9000)
  7. 冰封王座人工只能_OpenAI狂虐Dota大神Dendi,AI称霸游戏界这事你咋看
  8. S1000D规范导读
  9. 锐评美赛2021C、D、E题 o奖论文
  10. 论文笔记—假名—Pseudonym Changing at Social Spots: An Effective Strategy for Location Privacy in VANETs