java项目-图书馆管理系统源码

这篇具有很好参考价值的文章主要介绍了java项目-图书馆管理系统源码。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

 

项目介绍

本毕业设计运用了使用技术:spring mvc+spring+hibernate,数据库使用了当前较为流行的Mysql5.7。根据本校图书馆的工作流程与实际的需求和特色,本系统需满足以下几个方面的要求:

1.对新书进行登记入库、下架管理;
2.对借书读者信息提供维护功能;
3.提供图书借书、续借、还书功能;
4.提供图书超期未还自动扣款功能;
5.提供数据导入功能。

共22张表

环境需要

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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 

6.数据库:MySql 5.7版本;

技术栈

1. spring mvc+spring+hibernate

2. JSP+easyUI+BootStrap+JQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 将项目中dbconfig.properties配置文件中的数据库配置改为自己的配置
3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;

4. 运行项目,输入localhost:8080/xxx 登录 

运行截图

java项目-图书馆管理系统源码

java项目-图书馆管理系统源码 

java项目-图书馆管理系统源码 

java项目-图书馆管理系统源码 

java项目-图书馆管理系统源码 

java项目-图书馆管理系统源码 

代码相关

图书管理控制器

@Controller
@RequestMapping("/tBBookController")
public class TBBookController extends BaseController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(TBBookController.class);

	@Autowired
	private TBBookServiceI tBBookService;
	@Autowired
	private SystemService systemService;


	/**
	 * 图书表列表 页面跳转
	 * 
	 * @return
	 */
	@RequestMapping(params = "tBBook")
	public ModelAndView tBBook(HttpServletRequest request) {
		return new ModelAndView("buss/book/tBBookList");
	}

	/**
	 * 出版社表列表 页面跳转
	 * 
	 * @return
	 */
	@RequestMapping(params = "press")
	public ModelAndView press(HttpServletRequest request) {
		return new ModelAndView("buss/book/press");
	}
	
	/**
	 * 出版社显示列表
	 * 
	 * @param request
	 * @param response
	 * @param dataGrid
	 */
	@RequestMapping(params = "datagridPress")
	public void datagridPress(TBPressEntity tbPress, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
		CriteriaQuery cq = new CriteriaQuery(TBPressEntity.class, dataGrid);
		com.bjpowernode.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tbPress, request.getParameterMap());
		this.systemService.getDataGridReturn(cq, true);
		TagUtil.datagrid(response, dataGrid);
	}
	
	/**
	 * easyui AJAX请求数据
	 * 
	 * @param request
	 * @param response
	 * @param dataGrid
	 * @param user
	 */

	@RequestMapping(params = "datagrid")
	public void datagrid(TBBookEntity tBBook,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
		CriteriaQuery cq = new CriteriaQuery(TBBookEntity.class, dataGrid);
		//查询条件组装器
		com.bjpowernode.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tBBook, request.getParameterMap());
		try{
		//自定义追加查询条件
		}catch (Exception e) {
			throw new BusinessException(e.getMessage());
		}
		cq.add();
		this.tBBookService.getDataGridReturn(cq, true);
		TagUtil.datagrid(response, dataGrid);
	}

	/**
	 * 删除图书表
	 * 
	 * @return
	 */
	@RequestMapping(params = "doDel")
	@ResponseBody
	public AjaxJson doDel(TBBookEntity tBBook, HttpServletRequest request) {
		AjaxJson j = new AjaxJson();
		tBBook = systemService.getEntity(TBBookEntity.class, tBBook.getId());
		String message = "图书表删除成功";
		try{
			tBBookService.delete(tBBook);
			systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
		}catch(Exception e){
			e.printStackTrace();
			message = "图书表删除失败";
			throw new BusinessException(e.getMessage());
		}
		j.setMsg(message);
		return j;
	}
	
	/**
	 * 批量删除图书表
	 * 
	 * @return
	 */
	 @RequestMapping(params = "doBatchDel")
	@ResponseBody
	public AjaxJson doBatchDel(String ids,HttpServletRequest request){
		AjaxJson j = new AjaxJson();
		String message = "图书表删除成功";
		try{
			for(String id:ids.split(",")){
				TBBookEntity tBBook = systemService.getEntity(TBBookEntity.class, 
				id
				);
				tBBookService.delete(tBBook);
				systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
			}
		}catch(Exception e){
			e.printStackTrace();
			message = "图书表删除失败";
			throw new BusinessException(e.getMessage());
		}
		j.setMsg(message);
		return j;
	}


	/**
	 * 添加图书表
	 * 
	 * @param ids
	 * @return
	 */
	@RequestMapping(params = "doAdd")
	@ResponseBody
	public AjaxJson doAdd(TBBookEntity tBBook, HttpServletRequest request) {
		AjaxJson j = new AjaxJson();
		String message = "图书表添加成功";
		try{
			tBBook.setStatus(Globals.BOOK_RETURN);
			tBBookService.save(tBBook);
			systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
		}catch(Exception e){
			e.printStackTrace();
			message = "图书表添加失败";
			throw new BusinessException(e.getMessage());
		}
		j.setMsg(message);
		return j;
	}
	
	/**
	 * 更新图书表
	 * 
	 * @param ids
	 * @return
	 */
	@RequestMapping(params = "doUpdate")
	@ResponseBody
	public AjaxJson doUpdate(TBBookEntity tBBook, HttpServletRequest request) {
		AjaxJson j = new AjaxJson();
		String message = "图书表更新成功";
		TBBookEntity t = tBBookService.get(TBBookEntity.class, tBBook.getId());
		try {
			MyBeanUtils.copyBeanNotNull2Bean(tBBook, t);
			tBBookService.saveOrUpdate(t);
			systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
		} catch (Exception e) {
			e.printStackTrace();
			message = "图书表更新失败";
			throw new BusinessException(e.getMessage());
		}
		j.setMsg(message);
		return j;
	}
	

	/**
	 * 图书表新增页面跳转
	 * 
	 * @return
	 */
	@RequestMapping(params = "goAdd")
	public ModelAndView goAdd(TBBookEntity tBBook, HttpServletRequest req) {
		if (StringUtil.isNotEmpty(tBBook.getId())) {
			tBBook = tBBookService.getEntity(TBBookEntity.class, tBBook.getId());
			req.setAttribute("tBBookPage", tBBook);
		}
		return new ModelAndView("buss/book/tBBook-add");
	}
	/**
	 * 图书表编辑页面跳转
	 * 
	 * @return
	 */
	@RequestMapping(params = "goUpdate")
	public ModelAndView goUpdate(TBBookEntity tBBook, HttpServletRequest req) {
		if (StringUtil.isNotEmpty(tBBook.getId())) {
			tBBook = tBBookService.getEntity(TBBookEntity.class, tBBook.getId());
			req.setAttribute("tBBookPage", tBBook);
		}
		return new ModelAndView("buss/book/tBBook-update");
	}
	
	/**
	 * 统计集合页面
	 * 
	 * @return
	 */
	@RequestMapping(params = "bookStatisticTabs")
	public ModelAndView bookStatisticTabs(HttpServletRequest request) {
		return new ModelAndView("buss/book/tBBookReport");
	}
	
	/**
	 * 报表数据生成
	 * 
	 * @return
	 */
	@RequestMapping(params = "bookCount")
	@ResponseBody
	public List<Highchart> bookCount(HttpServletRequest request,String reportType, HttpServletResponse response) {
		List<Highchart> list = new ArrayList<Highchart>();
		Highchart hc = new Highchart();
		StringBuffer sb = new StringBuffer();
		sb.append("SELECT booktype ,count(booktype) FROM TBBookEntity group by booktype");
		List bookTypeList = systemService.findByQueryString(sb.toString());
		Long count = systemService.getCountForJdbc("SELECT COUNT(1) FROM T_B_book WHERE 1=1");
		List lt = new ArrayList();
		hc = new Highchart();
		hc.setName("图书种类统计");
		hc.setType(reportType);
		Map<String, Object> map;
		String hql = "from TSType where typegroupid='" + Globals.TYPEGROUP_ID+ "'";
		List<TSType> typeList = systemService.findByQueryString(hql);
		Map<String, String> typeMap = new HashMap<String, String>();
		if(typeList.size() > 0){
			for(TSType type : typeList){
				typeMap.put(type.getTypecode(), type.getTypename());
			}
		}
		if (bookTypeList.size() > 0) {
			for (Object object : bookTypeList) {
				
				map = new HashMap<String, Object>();
				Object[] obj = (Object[]) object;
				map.put("name", typeMap.get(obj[0]));
				map.put("y", obj[1]);
				Long groupCount = (Long) obj[1];
				Double  percentage = 0.0;
				if (count != null && count.intValue() != 0) {
					percentage = new Double(groupCount)/count;
				}
				map.put("percentage", percentage*100);
				lt.add(map);
			}
		}
		hc.setData(lt);
		list.add(hc);
		return list;
	}
	
	/**
	 * 报表打印
	 * @param request
	 * @param response
	 * @throws IOException
	 */
	@RequestMapping(params = "export")
	public void export(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String type = request.getParameter("type");
		String svg = request.getParameter("svg");
		String filename = request.getParameter("filename");

		filename = filename == null ? "chart" : filename;
		ServletOutputStream out = response.getOutputStream();
		try {
			if (null != type && null != svg) {
				svg = svg.replaceAll(":rect", "rect");
				String ext = "";
				Transcoder t = null;
				if (type.equals("image/png")) {
					ext = "png";
					t = new PNGTranscoder();
				} else if (type.equals("image/jpeg")) {
					ext = "jpg";
					t = new JPEGTranscoder();
				} else if (type.equals("application/pdf")) {
					ext = "pdf";
					t = (Transcoder) new PDFTranscoder();
				} else if (type.equals("image/svg+xml"))
					ext = "svg";
				response.addHeader("Content-Disposition",
						"attachment; filename=" + new String(filename.getBytes("GBK"),"ISO-8859-1") + "." + ext);
				response.addHeader("Content-Type", type);

				if (null != t) {
					TranscoderInput input = new TranscoderInput(
							new StringReader(svg));
					TranscoderOutput output = new TranscoderOutput(out);

					try {
						t.transcode(input, output);
					} catch (TranscoderException e) {
						out
								.print("Problem transcoding stream. See the web logs for more details.");
						e.printStackTrace();
					}
				} else if (ext.equals("svg")) {
					// out.print(svg);
					OutputStreamWriter writer = new OutputStreamWriter(out,
							"UTF-8");
					writer.append(svg);
					writer.close();
				} else
					out.print("Invalid type: " + type);
			} else {
				response.addHeader("Content-Type", "text/html");
				out
						.println("Usage:\n\tParameter [svg]: The DOM Element to be converted."
								+ "\n\tParameter [type]: The destination MIME type for the elment to be transcoded.");
			}
		} finally {
			if (out != null) {
				out.flush();
				out.close();
			}
		}
	}
	
	/**
	 * 图书导入
	 * 
	 * @return
	 */
	@RequestMapping(params = "upload")
	public ModelAndView upload(HttpServletRequest req) {
		return new ModelAndView("buss/book/bookUpload");
	}
	
	/**
	 * 图书导入
	 * @param request
	 * @param response
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(params = "importExcel", method = RequestMethod.POST)
	@ResponseBody
	public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
		AjaxJson j = new AjaxJson();
		
		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
		Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
		for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
			MultipartFile file = entity.getValue();// 获取上传文件对象
			ImportParams params = new ImportParams();
			try {
				List<TBBookEntity> listBooks = 
					(List<TBBookEntity>)ExcelImportUtil.importExcelByIs(file.getInputStream(),TBBookEntity.class,params);
				for (TBBookEntity book : listBooks) {
					if(book != null && book.getBookname() != null){
						book.setStatus(Globals.BOOK_RETURN);
						tBBookService.save(book);
					}
				}
				j.setMsg("文件导入成功!");
			} catch (Exception e) {
				j.setMsg("文件导入失败!");
				logger.error(ExceptionUtil.getExceptionMessage(e));
			}finally{
				try {
					file.getInputStream().close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		return j;
	}
}

 

如果也想学习本系统,下面领取。回复:003ssh 文章来源地址https://www.toymoban.com/news/detail-478554.html

到了这里,关于java项目-图书馆管理系统源码的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • java毕业设计——基于java+Java Swing+sqlserver的图书馆书库管理系统设计与实现(毕业论文+程序源码)——图书馆书库管理系统

    大家好,今天给大家介绍基于java+Java Swing+sqlserver的图书馆书库管理系统设计与实现,文章末尾附有本毕业设计的论文和源码下载地址哦。需要下载开题报告PPT模板及论文答辩PPT模板等的小伙伴,可以进入我的博客主页查看左侧最下面栏目中的自助下载方法哦 文章目录: 毕业

    2024年02月03日
    浏览(33)
  • 基于JAVA图书馆管理系统设计与实现

    【后台管理员功能】 广告管理:设置小程序首页轮播图广告和链接 留言列表:所有用户留言信息列表,支持删除 会员列表:查看所有注册会员信息,支持删除 资讯分类:录入、修改、查看、删除资讯分类 录入资讯:录入资讯标题、内容等信息 管理资讯:查看已录入资讯列

    2024年02月13日
    浏览(39)
  • Java语言------图书馆管理系统(入门简略版)

    目录 一.图书管理系统分析 1.1系统设计要求  1.2设计思路 二.操作代码的实现  2.1书架书籍代码实现 2.2用户操作代码实现 2.2.1增加书籍 2.2.2移除书籍 2.2.3查询书籍 2.2.4展示书架书籍信息 2.2.5借阅书籍代码 2.2.6归还图书代码 2.2.7退出系统 3.用户登录操作  四.主函数的调用 总结

    2023年04月13日
    浏览(37)
  • 用Java开发一个简单的图书馆管理系统

    图书馆管理系统是一种用于管理图书馆材料、用户和借还书记录等信息的软件系统。Java是一种流行的编程语言,它可以用于开发图书馆管理系统。在本篇文章中,我们将介绍如何使用Java编写一个简单的图书馆管理系统。 在设计系统时,需要考虑到各种各样的因素,例如系统

    2024年02月08日
    浏览(43)
  • 图书馆管理系统【GUI/Swing+MySQL】(Java课设)

    Swing窗口类型+Mysql数据库存储数据 适合作为Java课设!!! jdk1.8+Mysql8.0+Idea或eclipse+jdbc  本系统源码地址:https://download.csdn.net/download/qq_50954361/87682509 更多Java课设系统:更多Java课设系统 更多Java课设系统运行效果展示:更多Java课设系统运行效果展示  部署教程地址:Java课设部

    2023年04月19日
    浏览(33)
  • Java连接数据库实现图书馆管理系统(详细教程)

    该功能用到的软件为 IDEA 、Navicat 、云服务器(非必须) 源码下载 https://www.aliyundrive.com/s/UTz8pNxobGK 在自己的服务器或者电脑本机安装数据库系统,本次系统演示的数据库版本为5.6。 1.创建图书管理数据库library 字符集为:utf8 -utf8_general_ci 2.设计好将要使用的sql语句 视图、存储

    2024年02月06日
    浏览(36)
  • 33基于Java简单实现图书馆借书管理系统设计与实现

    本章节给大家介绍一个基于Java简单实现图书馆借书管理系统的设计与实现 项目总体分为俩种角色,分别是管理员和阅读者,管理员可以登录系统中,进行图书管理,上架下架图书,对用户进行管理、对读者进行管理、查看借阅记录管理等,读者角色可以登录系统查询图书信息

    2024年02月03日
    浏览(39)
  • 基于Java的图书馆借阅管理系统的设计与实现--毕业开题报告

    基于Java的图书馆借阅管理系统的设计与实现–开题报告 这个先写一版开题报告,后续有时间给大家提供论文 。 题目:基于Java的图书馆借阅管理系统的设计与实现 图书馆是一个信息系统,它收集、处理、组织、存储、选择、控制、转换重要的信息和知识载体,并将其传递给

    2024年02月03日
    浏览(101)
  • 前后端分离项目-基于springboot+vue的图书馆管理系统的设计与实现(内含代码+文档+报告)

    博主介绍:✌全网粉丝10W+,前互联网大厂软件研发、集结硕博英豪成立工作室。专注于计算机相关专业毕业设计项目实战6年之久,选择我们就是选择放心、选择安心毕业✌ 🍅 由于篇幅限制,想要获取完整文章或者源码,或者代做,拉到文章底部即可看到个人VX。 🍅 2023年

    2024年02月07日
    浏览(37)
  • 基于javaweb+mysql的jsp+servlet图书图书馆管理系统(java+jsp+layui+bootstrap+servlet+mysql)

    基于javaweb+mysql的jsp+servlet图书图书馆管理系统(java+jsp+layui+bootstrap+servlet+mysql) 运行环境 Java≥8、MySQL≥5.7、Tomcat≥8 开发工具 eclipse/idea/myeclipse/sts等均可配置运行 适用 课程设计,大作业,毕业设计,项目练习,学习演示等 功能说明 基于javaweb+mysql的JSP+Servlet图书图书馆管理系统

    2024年02月04日
    浏览(43)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包