作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
基于Springboot+vue图书个性化推荐系统的设计与实现
本系统为分为前后台,包含管理员、学生两种角色,前台为学生登录,后台为管理员登录。
学生:首页、图书信息、好书推荐、图书预约、图书收藏、留言反馈、个人中心等。
管理员:首页、个人中心、学生管理、图书分类管理、图书信息管理、图书预约管理、退换图书管理、管理员管理、留言板管理、系统管理等。
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue + elementui
使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:
前台地址:http://localhost:8080/springbootxs5o6/front/index.html
学生账户:学生1 密码:123456
后台地址
http://localhost:8080/springbootxs5o6/admin/dist/index.html
管理员 abo 密码 abo
学生账户:学生1 密码:123456
注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。
运行截图
论文
前台界面
后台界面
相关代码
TuihuantushuController
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.TuihuantushuEntity;
import com.entity.view.TuihuantushuView;
import com.service.TuihuantushuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 退换图书
* 后端接口
* @author
* @email
* @date 2021-03-05 14:09:24
*/
@RestController
@RequestMapping("/tuihuantushu")
public class TuihuantushuController {
@Autowired
private TuihuantushuService tuihuantushuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,TuihuantushuEntity tuihuantushu, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
tuihuantushu.setXuehao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<TuihuantushuEntity> ew = new EntityWrapper<TuihuantushuEntity>();
PageUtils page = tuihuantushuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tuihuantushu), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,TuihuantushuEntity tuihuantushu, HttpServletRequest request){
EntityWrapper<TuihuantushuEntity> ew = new EntityWrapper<TuihuantushuEntity>();
PageUtils page = tuihuantushuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tuihuantushu), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( TuihuantushuEntity tuihuantushu){
EntityWrapper<TuihuantushuEntity> ew = new EntityWrapper<TuihuantushuEntity>();
ew.allEq(MPUtil.allEQMapPre( tuihuantushu, "tuihuantushu"));
return R.ok().put("data", tuihuantushuService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(TuihuantushuEntity tuihuantushu){
EntityWrapper< TuihuantushuEntity> ew = new EntityWrapper< TuihuantushuEntity>();
ew.allEq(MPUtil.allEQMapPre( tuihuantushu, "tuihuantushu"));
TuihuantushuView tuihuantushuView = tuihuantushuService.selectView(ew);
return R.ok("查询退换图书成功").put("data", tuihuantushuView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
TuihuantushuEntity tuihuantushu = tuihuantushuService.selectById(id);
return R.ok().put("data", tuihuantushu);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
TuihuantushuEntity tuihuantushu = tuihuantushuService.selectById(id);
return R.ok().put("data", tuihuantushu);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody TuihuantushuEntity tuihuantushu, HttpServletRequest request){
tuihuantushu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(tuihuantushu);
tuihuantushuService.insert(tuihuantushu);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody TuihuantushuEntity tuihuantushu, HttpServletRequest request){
tuihuantushu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(tuihuantushu);
tuihuantushuService.insert(tuihuantushu);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody TuihuantushuEntity tuihuantushu, HttpServletRequest request){
//ValidatorUtils.validateEntity(tuihuantushu);
tuihuantushuService.updateById(tuihuantushu);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
tuihuantushuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<TuihuantushuEntity> wrapper = new EntityWrapper<TuihuantushuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
}
int count = tuihuantushuService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
TushufenleiController
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.TushufenleiEntity;
import com.entity.view.TushufenleiView;
import com.service.TushufenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 图书分类
* 后端接口
* @author
* @email
* @date 2021-03-05 14:09:24
*/
@RestController
@RequestMapping("/tushufenlei")
public class TushufenleiController {
@Autowired
private TushufenleiService tushufenleiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,TushufenleiEntity tushufenlei, HttpServletRequest request){
EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();
PageUtils page = tushufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushufenlei), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,TushufenleiEntity tushufenlei, HttpServletRequest request){
EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();
PageUtils page = tushufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushufenlei), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( TushufenleiEntity tushufenlei){
EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( tushufenlei, "tushufenlei"));
return R.ok().put("data", tushufenleiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(TushufenleiEntity tushufenlei){
EntityWrapper< TushufenleiEntity> ew = new EntityWrapper< TushufenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( tushufenlei, "tushufenlei"));
TushufenleiView tushufenleiView = tushufenleiService.selectView(ew);
return R.ok("查询图书分类成功").put("data", tushufenleiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
TushufenleiEntity tushufenlei = tushufenleiService.selectById(id);
return R.ok().put("data", tushufenlei);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
TushufenleiEntity tushufenlei = tushufenleiService.selectById(id);
return R.ok().put("data", tushufenlei);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){
tushufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(tushufenlei);
tushufenleiService.insert(tushufenlei);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){
tushufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(tushufenlei);
tushufenleiService.insert(tushufenlei);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){
//ValidatorUtils.validateEntity(tushufenlei);
tushufenleiService.updateById(tushufenlei);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
tushufenleiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<TushufenleiEntity> wrapper = new EntityWrapper<TushufenleiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = tushufenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
如果也想学习本系统,下面领取。关注并回复:232boot
标签:map,vue,Java,Springboot,tuihuantushu,import,com,tushufenlei,RequestMapping From: https://blog.csdn.net/hanyunlong1989/article/details/143375162