SpringBoot前后端分离图书馆座位预约系统
java团长
共 6583字,需浏览 14分钟
·
2022-04-11 16:31
前言
本系统主要分为前后和后台页面,前台页面主要功能有:首页,座位信息,交流论坛,公告信息,个人中心,后台管理。后台页面分为:首页,个人中心,学生管理,教师管理,座位信息管理,座位预约管理,班级信息管理,签到信息管理,离开信息管理,座位暂离管理,举报信息管理,信用分管理,信用加分管理,信用减分管理,交流论坛,系统管理等功能。
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7
使用框架:springboot+vue
JDK版本:jdk1.8
系统实现
前台功能模块
首页
![](https://filescdn.proginn.com/f412b65a00a538cc816744049bbd68c3/ded7498831d29eddbbf72d0ed6ff7603.webp)
座位信息
![](https://filescdn.proginn.com/e20449d07aa7c12e779512cc181d997b/f90db1a12e7e63f2903f217ae884b26a.webp)
![](https://filescdn.proginn.com/64dfb148c8aa02a0395fd558619b4307/8207a7ddc822ee77a060a2cd37a69d60.webp)
交流论坛
![](https://filescdn.proginn.com/a1b4c6d40380bdf4178327f4719c6610/094e0766e70b3644eec1fd42d772504d.webp)
![](https://filescdn.proginn.com/2a4a7aec1926ddf949b0129960d39762/dee8b9a216f4d64bdf975de0b8acd517.webp)
公告信息
![](https://filescdn.proginn.com/dafbddceea07775c2889e9d5941af553/88e4e52e1dc141df5292c9099986c577.webp)
个人中心
![](https://filescdn.proginn.com/928d8f9caead16731ef762181dd90e7a/4f20e7517fa807e16cab10df158f7ef1.webp)
学生后台模块
首页
![](https://filescdn.proginn.com/9d7d18e916abf1cb12c43409e50e3081/ec3e030a07125f1cbb45edc89a215d10.webp)
座位预约管理
![](https://filescdn.proginn.com/535774c471cdb74bcc63c7143bc0b41c/1ddfeaf9b29958debfa33c97ca28707b.webp)
![](https://filescdn.proginn.com/438d9c934bab5f4f7af17af83bd76201/48bfe99d2bbcabca42df3f69222a7715.webp)
签到信息管理
![](https://filescdn.proginn.com/d6c4c18aa34a4c9be419e75d5a28f62e/157be0ff12068b5620ddb6490635ef39.webp)
![](https://filescdn.proginn.com/ecaafba41382ffe72c37bb1f9f7edf10/add0f1ccebfecabc58236d65434a0cbc.webp)
签到信息管理
![](https://filescdn.proginn.com/167f6a4e6e972832574c96b5e069e804/b0cb4d06677b0b9c8335e3060d62b743.webp)
管理员后台模块
![](https://filescdn.proginn.com/ec05ad1584ea03560d6b52baca17d015/8d479ed10a591b7435b4575997d710ff.webp)
系统管理
![](https://filescdn.proginn.com/9fc500046c104e1fa885e77392b0762c/274fc7f8cde02e85fe7ced2c0d7c5424.webp)
部分代码:
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.format.annotation.DateTimeFormat;
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.ZuoweizanliEntity;
import com.entity.view.ZuoweizanliView;
import com.service.ZuoweizanliService;
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-04-16 20:36:41
*/
@RestController
@RequestMapping("/zuoweizanli")
public class ZuoweizanliController {
@Autowired
private ZuoweizanliService zuoweizanliService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,ZuoweizanliEntity zuoweizanli,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
zuoweizanli.setXuehao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = zuoweizanliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zuoweizanli), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,ZuoweizanliEntity zuoweizanli, HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = zuoweizanliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zuoweizanli), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZuoweizanliEntity zuoweizanli){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( zuoweizanli, "zuoweizanli"));
return R.ok().put("data", zuoweizanliService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZuoweizanliEntity zuoweizanli){
EntityWrapper< ZuoweizanliEntity> ew = new EntityWrapper< ZuoweizanliEntity>();
ew.allEq(MPUtil.allEQMapPre( zuoweizanli, "zuoweizanli"));
ZuoweizanliView zuoweizanliView = zuoweizanliService.selectView(ew);
return R.ok("查询座位暂离成功").put("data", zuoweizanliView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZuoweizanliEntity zuoweizanli = zuoweizanliService.selectById(id);
return R.ok().put("data", zuoweizanli);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZuoweizanliEntity zuoweizanli = zuoweizanliService.selectById(id);
return R.ok().put("data", zuoweizanli);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZuoweizanliEntity zuoweizanli, HttpServletRequest request){
zuoweizanli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zuoweizanli);
zuoweizanliService.insert(zuoweizanli);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZuoweizanliEntity zuoweizanli, HttpServletRequest request){
zuoweizanli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zuoweizanli);
zuoweizanliService.insert(zuoweizanli);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZuoweizanliEntity zuoweizanli, HttpServletRequest request){
//ValidatorUtils.validateEntity(zuoweizanli);
zuoweizanliService.updateById(zuoweizanli);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zuoweizanliService.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 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 wrapper = new EntityWrapper();
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 = zuoweizanliService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
评论