基于javaweb+mysql的精品图书管理系统(前台、后台)(java+SSM+jsp+mysql+maven)

一、项目简述
功能包括: 登录注册,办理借阅。借阅记录,预约借阅,借出未还, 借阅逾期,学生管理,图书管理,书库分类查询搜索。

二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

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

    }
    //    领取操作
    @RequestMapping("/loan/getBespeak")
    public String getBespeak(Model model, Integer id, Integer bookid, Integer userid) throws Exception {
        //通过bookid和userid 借阅表插入借阅记录
        TbRecord tbRecord = new TbRecord();
        tbRecord.setBookId(bookid);
        tbRecord.setUserId(userid);
        this.loan_management.addLoanList(tbRecord);
        //通过id删除预约记录
        this.loan_management.removeOrderList(id);
        //返回借阅列表
        return "redirect:/admin/loan/bespeakList.action";
    }
    //    删除预约记录
    @RequestMapping("/loan/removeBespeak")
    public String removeBespeak(Integer id) throws Exception {
        this.loan_management.removeOrderList(id);
        return "redirect:/admin/loan/bespeakList.action";
        // 插入数据
        recordMapper.insert(record);
        model.addAttribute("successMsg", "借阅成功");
        return "errorMsg";
    }
    //借阅列表显示
    @RequestMapping("/loan/loanList")
    public String loanList(Model model, Integer currentPage) throws Exception {
        TbRecordL tbRecordL = new TbRecordL();
        //如果传入的有页面
        if (currentPage != null) {
            tbRecordL.setCurrentPage(currentPage);
        }
        //查询数据和分页,并返回
        pageL pageL = this.loan_management.getLoanRecord(tbRecordL);
        List<TbRecordL> loanRecordList = (List<TbRecordL>) pageL.getPo();
        model.addAttribute("pageL", pageL);
        model.addAttribute("loanRecordList", loanRecordList);
        return "admin/loan_loanList";
    }
    //借阅列表搜素
    @RequestMapping("/loan/searchLoanList.action")
    public String searchLoanList(Model model, String searchSelect, String searchKeyWord) throws Exception {
        //实例化包装类(包装类中在原有类的基础上添加的column(列名称)和keyword(搜索关键字)两个字段)
        TbRecordSearchL tbRecordSearchL = new TbRecordSearchL();
    }
    //用户列表模糊查询用户信息(用户名)
    @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";
    }
}
图书借阅管理Controller:
    @Autowired
    private TbRecordMapper recordMapper;
    @Autowired
    private Loan_UserInfoList loan_userInfoList;
    @RequestMapping("/loan/to_jieyue_book2")
    public String jieyue_book2(Model model) {
        return "admin/jieshu_book";
    }
    @RequestMapping("/loan/jieyue_book2")
    public String jieyue_book2(HttpSession session, String xuehao, String barcode, Model model) {
        TbLibrary book = tbLibraryMapper.selectByBarcode(barcode);
        if (null == book) {
            model.addAttribute("errorMsg", "图书条形码不存在");
            return "errorMsg";
        }
        TbUser tbUser = tbLibraryMapper.selectByStuNum(xuehao);
        if (null == tbUser) {
            model.addAttribute("errorMsg", "学生学号不存在");
            return "errorMsg";
        }
        //逾期,未归还
        Integer id=tbUser.getId();
        List<TbRecordQueryVo> recordOverdueList = loan_userInfoList.selectRecordOverdue(id);
        for (TbRecordQueryVo vo : recordOverdueList) {
            if (vo.getTicketffee() < 0) {
        record.setBackdate(currentTimeS + 3 * 30 * 24 * 60 * 60); //预约 3个月天 时间
        record.setTicketffee(0f);
        record.setReturnbook(0);
        // 插入数据
        recordMapper.insert(record);
        model.addAttribute("successMsg", "借阅成功");
        return "errorMsg";
    }
    //借阅列表显示
    @RequestMapping("/loan/loanList")
    public String loanList(Model model, Integer currentPage) throws Exception {
        TbRecordL tbRecordL = new TbRecordL();
        //如果传入的有页面
        if (currentPage != null) {
            tbRecordL.setCurrentPage(currentPage);
        }
    @RequestMapping("/loan/searchLoanList.action")
    public String searchLoanList(Model model, String searchSelect, String searchKeyWord) throws Exception {
        //实例化包装类(包装类中在原有类的基础上添加的column(列名称)和keyword(搜索关键字)两个字段)
        TbRecordSearchL tbRecordSearchL = new TbRecordSearchL();
        tbRecordSearchL.setColumn(searchSelect);
        tbRecordSearchL.setKeyWord(searchKeyWord);
        //将查询结果保存到list集合并通过model将对象集合放入request域中
        pageL pageL = this.loan_management.getLoanRecord(tbRecordSearchL);
        List<TbRecordL> loanRecordList = (List<TbRecordL>) pageL.getPo();
        model.addAttribute("loanRecordList", loanRecordList);
        return "admin/loan_loanList";
    }
    //    借阅列表归还状态修改
    @RequestMapping("/loan/changeLoanStatus")
    public String changeLoanStatus(Model model, String recid, String status) throws Exception {
        loanStatusL loanStatusL = new loanStatusL();
        loanStatusL.setId(recid);
        loanStatusL.setStatus(status);
        this.loan_management.changLoanStatus(loanStatusL);
        //返回借阅列表
        return "redirect:/admin/loan/loanList.action";
    }
}
预约记录控制层:
/**
 * 预约记录
    }
    //用户信息修改页面
    @RequestMapping("/loan_editUser")
    public String editUser(Integer id, Model model) {
        TbUser tbUser = loan_userInfoList.updataUserInfo(id);
        model.addAttribute("tbUser", tbUser);
        return "admin/loan_editUser";
    }
    //用户信息修改提交
    @RequestMapping("/editUser")
    public String editUser(TbUser tbUser, Model model) {
        int i = loan_userInfoList.editUser(tbUser);
        if (i > 0) {
            return "redirect:loan_userList.action";
        }
        //进行数据回显
        model.addAttribute("tbUser", tbUser);
        return "admin/loan_editUser";
    }
    //用户删除
    @RequestMapping("/loan_deleteUser")
    public String loan_deleteUser(Integer id) {
        int i = loan_userInfoList.deleteUser(id);
        }
        //查询数据和分页,并返回
        pageL pageL = this.loan_management.getLoanRecord(tbRecordL);
        List<TbRecordL> loanRecordList = (List<TbRecordL>) pageL.getPo();
        model.addAttribute("pageL", pageL);
        model.addAttribute("loanRecordList", loanRecordList);
        return "admin/loan_loanList";
    }
    //借阅列表搜素
    @RequestMapping("/loan/searchLoanList.action")
    public String searchLoanList(Model model, String searchSelect, String searchKeyWord) throws Exception {
        //实例化包装类(包装类中在原有类的基础上添加的column(列名称)和keyword(搜索关键字)两个字段)
        TbRecordSearchL tbRecordSearchL = new TbRecordSearchL();
        tbRecordSearchL.setColumn(searchSelect);
        tbRecordSearchL.setKeyWord(searchKeyWord);
        //将查询结果保存到list集合并通过model将对象集合放入request域中
        pageL pageL = this.loan_management.getLoanRecord(tbRecordSearchL);
        List<TbRecordL> loanRecordList = (List<TbRecordL>) pageL.getPo();
    public String editUser(Integer id, Model model) {
        TbUser tbUser = loan_userInfoList.updataUserInfo(id);
        model.addAttribute("tbUser", tbUser);
        return "admin/loan_editUser";
    }
    //用户信息修改提交
    @RequestMapping("/editUser")
    public String editUser(TbUser tbUser, Model model) {
        int i = loan_userInfoList.editUser(tbUser);
        if (i > 0) {
            return "redirect:loan_userList.action";
        }
        //进行数据回显
        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 "admin/loan_loanList";
    }
    //借阅列表搜素
    @RequestMapping("/loan/searchLoanList.action")
    public String searchLoanList(Model model, String searchSelect, String searchKeyWord) throws Exception {
        //实例化包装类(包装类中在原有类的基础上添加的column(列名称)和keyword(搜索关键字)两个字段)
        TbRecordSearchL tbRecordSearchL = new TbRecordSearchL();
        tbRecordSearchL.setColumn(searchSelect);
        tbRecordSearchL.setKeyWord(searchKeyWord);
        //将查询结果保存到list集合并通过model将对象集合放入request域中
        pageL pageL = this.loan_management.getLoanRecord(tbRecordSearchL);
        List<TbRecordL> loanRecordList = (List<TbRecordL>) pageL.getPo();
        model.addAttribute("loanRecordList", loanRecordList);
        return "admin/loan_loanList";
    }
    //    借阅列表归还状态修改
    @RequestMapping("/loan/changeLoanStatus")
    public String changeLoanStatus(Model model, String recid, String status) throws Exception {
        loanStatusL loanStatusL = new loanStatusL();
        loanStatusL.setId(recid);
        loanStatusL.setStatus(status);
        this.loan_management.changLoanStatus(loanStatusL);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值