基于javaweb+SSM的情缘图书馆管理系统(java+SSM+Tomcat+Maven+mysql)

基于SSM的情缘图书馆管理系统。SSM框架,适合java初学者。

主要功能包括:

图书编目管理:图书编目、编目维护;

图书信息管理:图书录入、图书信息;

图书借阅管理:借阅图书、借阅信息、归还、续借;

读者管理:办证、读者信息、读者类别、证件操作;

系统管理:权限信息、用户权限;

软件架构

  1. SSM+Tomcat8.5+Maven3.6.3+JDK1.8+MySQL5.7请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

    @ResponseBody
    public TbCategory toUpdatePage(int id) {
        return libraryCategoryService.getCategoryById(id);
    }
}
前台页面列表显示处理:
@Controller
@RequestMapping("/user/ch")
public class UserBookController {
    // 注入
    @Autowired
    private LibraryService libraryService;
    @Autowired
    private LibraryCategoryService libraryCategoryService;
    @Autowired
    private CommentService commentService;
    @Autowired
    private TbOrderMapper orderMapper;
    @Autowired
    private TbRecordMapper recordMapper;
    @Value("${LOGIN_USER}")
    private String LOGIN_USER;  // 当前登录用户的 session 存储 属性名
    @RequestMapping("/user_bookList")
    public String toLibraryListByCid(TbLibraryQuery libraryQuery, PageCount pageCount, Model model, HttpSession session) {
            return "errorMsg";
        }
        // 获取 session 中的用户信息
        ActiveUser activeUser = (ActiveUser) session.getAttribute("activeUser");
        TbUser tbUser = new TbUser();
        tbUser.setId(activeUser.getUserid());
        order.setUserId(tbUser.getId());
        // 插入数据
        libraryService.jieyueBookById(order);
        return "redirect:/user/ch/bookId.action?id=" + order.getBookId();
    }
    @RequestMapping("/commitInfo")
    @ResponseBody
    public String commitComment(HttpSession session, TbComment comment) {
        // 获取 session 中的用户信息
        ActiveUser activeUser = (ActiveUser) session.getAttribute("activeUser");
        TbUser tbUser = new TbUser();
        tbUser.setId(activeUser.getUserid());
        comment.setUserId(tbUser.getId());
        libraryService.addCommentInfo(comment);
        model.addAttribute("commentExts", commentExts);
        return "/user/bookDetail";
    }
    /**
     * 用于 借阅 图书  操作
     *
     * @param session 用于 取 用户信息
     * @param order   用户借阅关联信息
     * @return
     */
    @RequestMapping("/jieyue_book")
    public String jieyueBook(HttpSession session, Model model, String oid, String kkid, TbOrder order) {
        if (null != kkid) {
            TbRecord tbRecord = recordMapper.selectByPrimaryKey(Integer.valueOf(kkid));
            tbRecord.setReturnbook(2); //2代表挂失
            recordMapper.updateByPrimaryKey(tbRecord);
            model.addAttribute("successMsg", "图书挂失成功");
            return "errorMsg";
        }
                model.addAttribute("url", url);
            }
            //判断两次密码是否不一致
            if (!pwd.equals(passwd2)) {
                msg = "您输入的两次密码不一致!";
                url = "/login.action";
                model.addAttribute("msg", msg);
                model.addAttribute("url", url);
            }
            //判断手机号是否为空
            if (!"".equals(tel) || tel == null) {
                msg = "手机号不能为空!";
                url = "/login.action";
                model.addAttribute("msg", msg);
                model.addAttribute("url", url);
            }
            //判断验证码是否错误
            if (!validateCode.equals(authcode)) {
                msg = "您输入的验证码错误!";
                url = "/login.action";
                model.addAttribute("msg", msg);
                model.addAttribute("url", url);
                return "user/error";
            }
    @RequestMapping(value = "/updateCategory", method = RequestMethod.POST)
    public String updateCategory(TbCategory category) {
        return "redirect:/admin/ch/loan_BookClassify.action";
    }
    @RequestMapping("/toUpdatePage")
    @ResponseBody
    public TbCategory toUpdatePage(int id) {
        return libraryCategoryService.getCategoryById(id);
    }
}
前台页面列表显示处理:
@Controller
@RequestMapping("/user/ch")
            return "user/error";
        } else {
            msg = "参数错误!";
            url = "/login.action";
            model.addAttribute("msg", msg);
            model.addAttribute("url", url);
            return "user/error";
        }
    }
    //账号退出登录
    @RequestMapping("/logout")
    public String logout(HttpSession session) throws Exception {
        session.invalidate();
        return "redirect:/login.action";
    }
    //    管理员登录
    @RequestMapping("/adminlogin")
    public String adminlogin(Model model, HttpSession session, String adminuser, String adminpassword) throws Exception {
    }
    /**
     * 修改 类目关系
     *
     * @param category
     * @return
     */
    @RequestMapping(value = "/updateCategory", method = RequestMethod.POST)
    public String updateCategory(TbCategory category) {
        return "redirect:/admin/ch/loan_BookClassify.action";
    }
    @RequestMapping("/toUpdatePage")
    @ResponseBody
    public TbCategory toUpdatePage(int id) {
        return libraryCategoryService.getCategoryById(id);
    }
}
前台页面列表显示处理:
@Controller
@RequestMapping("/user/ch")
public class UserBookController {
    // 注入
    @Autowired
    private LibraryService libraryService;
    @Autowired
    //注入
    @Autowired
    private LibraryCategoryService libraryCategoryService;
    /**
     * 添加 图书类目
     *
     * @param category 图书类目信息
     * @param session  添加人
     * @return url
     * @author hiseico
     */
    @RequestMapping(value = "/addCategory", method = RequestMethod.POST)
    public String addCategory(TbCategory category, HttpSession session, Model model) {
        List<TbCategory> categoryList = libraryCategoryService.getCategoryAll();
        boolean is = false;
        for (TbCategory tbCategory : categoryList) {
            if (category.getCatname().equals(tbCategory.getCatname())) {
                is = true;
                break;
            }
        }
        if (!is) {
            // 添加 数据到 数据库,并 修改 父类目
            libraryCategoryService.addBookCategory(category, session);
        } else {
            model.addAttribute("errorMsg", "类目已经存在");
            return "errorMsg";
    @Value("${LOGIN_USER}")
    private String LOGIN_USER;  // 当前登录用户的 session 存储 属性名
    @RequestMapping("/user_bookList")
    public String toLibraryListByCid(TbLibraryQuery libraryQuery, PageCount pageCount, Model model, HttpSession session) {
        if (libraryQuery == null || libraryQuery.getCateId() == null) {
            libraryQuery = new TbLibraryQuery();
            libraryQuery.setCateId((Integer) session.getAttribute("currentCategory"));
        }
        // 根据 类目 id
        // 若 当前 类目 为 父类目 则获取 其 下面 的 所有子类目
        // 若 当前 类目 为 子类目 则获取 其 同级 类目
        List<TbCategory> categoryList = libraryCategoryService.getCategoryByCid(libraryQuery.getCateId());
        // 获取当前类目信息
        TbCategory currentCategory = libraryCategoryService.getCategoryById(libraryQuery.getCateId());
        // 按照条件进行查询
        PageCount<TblibraryExt> libraryPageCount = libraryService.findLibraryByAll(libraryQuery, pageCount);
            tbUser = this.login_loginValidation.findUserByUserName(user);
            activeUser.setUserid(tbUser.getId());
            activeUser.setUsername(tbUser.getUsername());
            activeUser.setHeadImg(tbUser.getHeadimg());
            session.setAttribute("activeUser", activeUser);
            msg = "注册成功!正在为您登录,请稍候...";
            url = "/user/userSystem.action";
            model.addAttribute("msg", msg);
            model.addAttribute("url", url);
            return "user/error";
        } else {
            msg = "参数错误!";
            url = "/login.action";
            model.addAttribute("msg", msg);
            model.addAttribute("url", url);
            return "user/error";
        }
    }
    //账号退出登录
    @RequestMapping("/logout")
    public String logout(HttpSession session) throws Exception {
        session.invalidate();
        return "redirect:/login.action";
    }
    //    管理员登录
    @RequestMapping("/adminlogin")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
springmvc是一种基于Spring框架的MVC(Model View Controller)开发模式的Web开发框架。它能够帮助开发者更好地管理请求和响应,让开发过程更加简洁和灵活。MyBatis是一个优秀的持久层框架,可以与Spring相结合进行数据库操作。它能够通过注解或XML配置文件实现数据库的增删改查操作,使开发者能够高效地操作数据库。电商项目是一种在线购物平台,用户可以浏览商品信息、下单购买、查看订单等。Java商城源码是这种电商项目的实现代码,通过使用SpringMVC和MyBatis,能够快速搭建一个完整的电商网站。 SSM框架是指Spring+SpringMVC+MyBatis的组合,是一种常用的JavaWeb开发框架。Spring是一个轻量级的开源框架,提供了很多实用的功能,包括IOC(控制反转)和AOP(面向切面编程)等。SpringMVC是基于Spring的MVC框架,可以实现请求的分发和处理。MyBatis是一个持久层框架,可以与SpringMVC结合使用,完成数据库的操作。Maven是一种软件项目管理工具,可以自动下载和配置项目所需的第三方库和工具。 对于这个电商项目的Java商城源码,使用SSM框架和Maven进行开发是一个不错的选择。首先,可以使用Maven来管理项目所需的依赖库,避免手动下载和配置的繁琐过程。其次,使用Spring来提供IOC容器和AOP功能,可以简化开发过程,并且使代码更加易于维护。然后,使用SpringMVC来处理请求和响应,实现网站的跳转和业务逻辑的处理。最后,使用MyBatis来完成与数据库的交互,实现商品信息的增删改查等功能。 综上所述,使用SSM框架和Maven进行开发的电商项目Java商城源码,能够快速搭建一个完整的电商网站,实现商品的展示、购买和订单的管理等功能。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值