——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM前台+后台精品图书管理系统(java+ssm+jsp+mysql)
一、项目简述
功能包括: 登录注册,办理借阅。借阅记录,预约借阅,借出未还, 借阅逾期,学生管理,图书管理,书库分类查询搜索。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax +等等。
——————————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 **/ @Controller @RequestMapping("/user") public class user_userSystemController { @Autowired private user_userSystem user_userSystem; @RequestMapping("/resetPwd") public String resetPassword (Model model, Integer id, String oldPassword, String newPassword, String newPassword2) throws Exception { String msg; String url; if ("" .equals(oldPassword) || oldPassword == null || "" .equals(newPassword) || newPassword == null || "" .equals(newPassword2) || newPassword2 == null ) { msg = "不能有空值" ; url = "/user/user_resetPassword.action" ; model.addAttribute("msg" , msg); model.addAttribute("url" , url); return "user/error" ; } if (!newPassword.equals(newPassword2)) { msg = "两次新密码不一致" ; url = "/user/user_resetPassword.action" ; model.addAttribute("msg" , msg); model.addAttribute("url" , url); return "user/error" ; } TbUserRestInfoL tbUserRestInfoL = new TbUserRestInfoL(); tbUserRestInfoL.setPassword(oldPassword); tbUserRestInfoL.setNewPassword(newPassword); tbUserRestInfoL.setId(id); int result = this .user_userSystem.updateUserPassword(tbUserRestInfoL); if (0 == result) { msg = "未找到该用户!" ; url = "/user/user_resetPassword.action" ; model.addAttribute("msg" , msg); model.addAttribute("url" , url); return "user/error" ; } if (2 == result) {
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 model.addAttribute("tbUser" , tbUser); return "admin/loan_editUser" ; } @RequestMapping("/loan_deleteUser") public String loan_deleteUser (Integer id) { int i = loan_userInfoList.deleteUser(id); if (i > 0 ) { return "redirect:loan_userList.action" ; } return "redirect:loan_userList.action" ; } @RequestMapping("/loan_addUser") public String addUser (TbUser tbUser) { tbUser.setRegisterdate(System.currentTimeMillis()); tbUser.setIsonline(0 ); tbUser.setPassword(tbUser.getUsername()); int i = loan_userInfoList.addUser(tbUser); if (i > 0 ) { System.out.println("添加成功!" ); return "redirect:loan_userList.action" ; } return "redirect:loan_userList.action" ; } @RequestMapping("/loan_selectLikeName") public String Loan_selectLikeName (TbUser tbUser, Model model) { Integer online = null ; TbUserQueryVo tbUserQueryVo = new TbUserQueryVo(); tbUserQueryVo.setTbUser(tbUser); tbUserQueryVo.setOnline(online); List<TbUser> userList = loan_userInfoList.selectLikeName(tbUserQueryVo); model.addAttribute("userList" , userList); return "admin/loan_userList" ; } } package controller.admin.loanList;
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 @Service public class LibraryServiceImpl implements LibraryService { @Autowired private TbLibraryAndManagerMapper libraryAndManagerMapper; @Autowired private TbLibraryMapper libraryMapper; @Autowired private TbCommentMapper commentMapper; @Autowired private TbOrderMapper orderMapper; @Autowired private TbRecordMapper recordMapper; @Autowired private TbReplyMapper replyMapper; @Value("${CURRENT_PAGE}") private String CURRENT_PAGE; @Value("${PAGE_ROWS}") private String PAGE_ROWS; @Value("${FILE_SAVE_PATH}") private String FILE_SAVE_PATH; @Override public PageCount<TblibraryExt> findLibraryByAll (TbLibraryQuery tbLibraryQuery, PageCount pageCount) { if (tbLibraryQuery == null ) { tbLibraryQuery = new TbLibraryQuery(); tbLibraryQuery.setBookname("" ); } if (pageCount == null ) { pageCount = new PageCount(); pageCount.setCurrentPage(Integer.parseInt(CURRENT_PAGE)); pageCount.setPageRows(Integer.parseInt(PAGE_ROWS));
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 private Loan_management loan_management;@RequestMapping("/loan/outTimeList") public String outTimeList (Model model, Integer currentPage) throws Exception { LoanOutTimeL loanOutTimeL = new LoanOutTimeL(); if (currentPage != null ) { loanOutTimeL.setCurrentPage(currentPage); } pageL pageL = this .loan_management.findOutTimeList(loanOutTimeL); List<LoanOutTimeL> outTimeList = (List<LoanOutTimeL>) pageL.getPo(); model.addAttribute("pageL" , pageL); model.addAttribute("outTimeList" , outTimeList); return "admin/loan_outtime" ; } @RequestMapping("/loan/searchOutTimeList") public String searchOutTimeList (Model model, String searchSelect, String searchKeyWord, Integer currentPage) throws Exception { LoanOutTimeL loanOutTimeL = new LoanOutTimeL(); loanOutTimeL.setColumn(searchSelect); loanOutTimeL.setKeyWord(searchKeyWord); if (currentPage != null ) { loanOutTimeL.setCurrentPage(currentPage); } pageL pageL = this .loan_management.findOutTimeList(loanOutTimeL); List<LoanOutTimeL> outTimeList = (List<LoanOutTimeL>) pageL.getPo(); model.addAttribute("pageL" , pageL); model.addAttribute("outTimeList" , outTimeList); return "admin/loan_outtime" ; } @RequestMapping("/loan/outTimeReturnBook") public String returnBook (Model model, String id) throws Exception { loanStatusL loanStatusL = new loanStatusL(); loanStatusL.setId(id); loanStatusL.setStatus("1" ); this .loan_management.changLoanStatus(loanStatusL); return "redirect:/admin/loan/outTimeList.action" ;
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 @Value("${CURRENT_PAGE}") private String CURRENT_PAGE; @Value("${PAGE_ROWS}") private String PAGE_ROWS; @Override public List<TbCategory> getCategoryAll () { TbCategoryExample categoryExample = new TbCategoryExample(); return categoryMapper.selectByExample(categoryExample); } @Override public PageCount<TbCategoryExt> getCategoryAllWithParentName (PageCount pageCount) { TbCategoryExample categoryExample = new TbCategoryExample(); if (pageCount.getCurrentPage() == null ) { pageCount.setCurrentPage(Integer.parseInt(CURRENT_PAGE)); } if (pageCount.getPageRows() == null ) { pageCount.setPageRows(Integer.parseInt(PAGE_ROWS)); } PageHelper.startPage(pageCount.getCurrentPage(), pageCount.getPageRows()); List<TbCategory> categoryList = categoryMapper.selectByExample(categoryExample); PageInfo<TbCategory> pageInfo = new PageInfo<>(categoryList); pageCount.setTotalRows(pageInfo.getTotal()); pageCount.setTotalPages(pageInfo.getPages()); List<TbCategoryExt> categoryExts = new ArrayList<>();
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 pageCount.setPageRows(Integer.parseInt(PAGE_ROWS)); } if (pageCount.getCurrentPage() == null ) { pageCount.setCurrentPage(Integer.parseInt(CURRENT_PAGE)); } if (pageCount.getPageRows() == null ) { pageCount.setPageRows(Integer.parseInt(PAGE_ROWS)); } PageHelper.startPage(pageCount.getCurrentPage(), pageCount.getPageRows()); List<TblibraryExt> tblibraryExts = new ArrayList<>(); if (tbLibraryQuery.getCateId() == 0 ) { tblibraryExts = libraryAndManagerMapper.findAll(tbLibraryQuery); } else { tblibraryExts = libraryAndManagerMapper.findLibraryByCriteria(tbLibraryQuery); } PageInfo<TblibraryExt> pageInfo = new PageInfo<>(tblibraryExts); pageCount.setTotalPages(pageInfo.getPages()); pageCount.setTotalRows(pageInfo.getTotal()); pageCount.setContentList(tblibraryExts); return pageCount; } @Override public TbLibrary findLibraryByBid (int id) { return libraryMapper.selectByPrimaryKey(id); } @Override public String updateOrSaveLibrary (MultipartFile uploadFile, TbLibrary library, HttpServletRequest request) throws IOException { String FILE_SAVE_PATH=request.getSession().getServletContext().getRealPath("/upload/book" );; String fileSavePath = UploadFileUtilsByBook.updateLibrary(uploadFile, FILE_SAVE_PATH);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=581422302105200hh https://javayms.pages.dev?id=581422302105200hh