开发工具:IDEA、微信小程序
服务器:Tomcat9.0, jdk1.8
项目构建:maven
数据库:mysql5.7
前端技术:vue、uniapp
服务端技术:springboot+mybatis-plus
本系统分微信小程序和管理后台两部分,项目采用前后端分离
系统主要分为两个角色:管理员和普通用户。
1.普通用户(小程序):登录、注册、首页、搜索图书、借阅、收藏、图书分类、座位查询与预订、我的收藏、借阅查询、退出登录等功能。
2.管理员(后台):登录、首页、用户管理、图书分类、借阅管理、图书管理、阅览室管理、座位管理、收藏管理、系统管理(管理员管理、角色管理、菜单管理、系统日志)、退出登录、修改密码等功能的管理
文档截图:
微信小程序截图:
后台截图:
package io.renren.modules.renren.controller;import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;import com.alibaba.druid.sql.visitor.functions.Now;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.modules.renren.entity.BookManagerEntity;
import io.renren.modules.renren.service.BookManagerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import io.renren.modules.renren.entity.BookBorrowEntity;
import io.renren.modules.renren.service.BookBorrowService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;import javax.annotation.Resource;@RestController
@RequestMapping("renren/bookborrow")
public class BookBorrowController {@Autowiredprivate BookBorrowService bookBorrowService;@Resourceprivate BookManagerService bookManagerService;/*** 列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params){PageUtils page = bookBorrowService.queryPage(params);return R.ok().put("page", page);}@RequestMapping("/list2")public R list2(Integer userId,Integer bookState,@RequestParam Map<String, Object> params){PageUtils page = bookBorrowService.queryPage2(userId,bookState,params);return R.ok().put("page", page);}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Integer id){BookBorrowEntity bookBorrow = bookBorrowService.getById(id);return R.ok().put("bookBorrow", bookBorrow);}/*** 保存*/@RequestMapping("/save")public R save(@RequestBody BookBorrowEntity bookBorrow){BookBorrowEntity book=bookBorrowService.getById(bookBorrow.getBookId());List<BookBorrowEntity> list=bookBorrowService.list(new QueryWrapper<BookBorrowEntity>().eq("book_id",bookBorrow.getBookId()));if (list.size()>0){if (list.get(0).getBookState()==1){return R.error();}}Date a= new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 3);SimpleDateFormat dateFormat2=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String aaa=dateFormat2.format(a);bookBorrow.setBookReamrk(aaa);bookBorrowService.save(bookBorrow);BookManagerEntity bk=new BookManagerEntity();bk.setBookState(1);bookManagerService.update(bk,new QueryWrapper<BookManagerEntity>().eq("id",bookBorrow.getBookId()));return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody BookBorrowEntity bookBorrow){BookManagerEntity bk=new BookManagerEntity();bk.setBookState(0);bookManagerService.update(bk,new QueryWrapper<BookManagerEntity>().eq("id",bookBorrow.getBookId()));bookBorrow.setUpdateDate(new Date());bookBorrow.setBookState(0);//归还bookBorrowService.updateById(bookBorrow);return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){bookBorrowService.removeByIds(Arrays.asList(ids));return R.ok();}}
package io.renren.modules.renren.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.renren.modules.renren.entity.BookSeatEntity;
import io.renren.modules.renren.service.BookSeatService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
@RestController
@RequestMapping("renren/bookseat")
public class BookSeatController {
@Autowired
private BookSeatService bookSeatService;
/**
* 座位列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = bookSeatService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 座位列表
*/
@RequestMapping("/list2")
public R list2(@RequestParam Map<String, Object> params){
PageUtils page = bookSeatService.queryPage2(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Integer id){
BookSeatEntity bookSeat = bookSeatService.getById(id);
return R.ok().put("bookSeat", bookSeat);
}
/**
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody BookSeatEntity bookSeat){
bookSeat.setSeatState(0);
bookSeatService.save(bookSeat);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody BookSeatEntity bookSeat){
bookSeat.setMakeDate(new Date());
bookSeatService.updateById(bookSeat);
return R.ok();
}
@RequestMapping("/update2")
public R update2(@RequestBody BookSeatEntity bookSeat){
QueryWrapper<BookSeatEntity> qw=new QueryWrapper<>();
qw.eq("user_id",bookSeat.getUserId());
qw.eq("seat_state",1);
List<BookSeatEntity> count = bookSeatService.list(qw);
if (count.size()>0){
return R.error().put("zwId",count.get(0).getSeatRemark()).put("roomId",count.get(0).getRoomId()).put("id",count.get(0).getId());
}
bookSeat.setMakeDate(new Date());
bookSeatService.updateById(bookSeat);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
bookSeatService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}