校园自习室预约管理系统

简介: 校园自习室预约管理系统

项目编号:BS-XX-215

一,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:Springboot+Vue

二,项目简介

项目基于Springboot+Vue开发实现了一套学校自习室预约管理平台。用户角色分为学生和管理员两类,学生注册登录后可以在线查看自习室、在校预约和举报、查看公告、在线交流、个人中心信息管理等;管理员登录可以进行学生管理、班级管理、自习室管理、预约管理、座位管理、签到管理、暂时离开管理和系统管理等模块。

三,系统展示

前端首页

自习室信息查看

在线预约和举报

论坛交流

平台公告

个人中心

系统管理员功能管理

四,核心代码展示

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.BanjixinxiEntity;
import com.entity.view.BanjixinxiView;
import com.service.BanjixinxiService;
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("/banjixinxi")
public class BanjixinxiController {
    @Autowired
    private BanjixinxiService banjixinxiService;
    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,BanjixinxiEntity banjixinxi,
    HttpServletRequest request){
        EntityWrapper<BanjixinxiEntity> ew = new EntityWrapper<BanjixinxiEntity>();
    PageUtils page = banjixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, banjixinxi), params), params));
        return R.ok().put("data", page);
    }
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,BanjixinxiEntity banjixinxi, HttpServletRequest request){
        EntityWrapper<BanjixinxiEntity> ew = new EntityWrapper<BanjixinxiEntity>();
    PageUtils page = banjixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, banjixinxi), params), params));
        return R.ok().put("data", page);
    }
  /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( BanjixinxiEntity banjixinxi){
        EntityWrapper<BanjixinxiEntity> ew = new EntityWrapper<BanjixinxiEntity>();
        ew.allEq(MPUtil.allEQMapPre( banjixinxi, "banjixinxi")); 
        return R.ok().put("data", banjixinxiService.selectListView(ew));
    }
   /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(BanjixinxiEntity banjixinxi){
        EntityWrapper< BanjixinxiEntity> ew = new EntityWrapper< BanjixinxiEntity>();
    ew.allEq(MPUtil.allEQMapPre( banjixinxi, "banjixinxi")); 
    BanjixinxiView banjixinxiView =  banjixinxiService.selectView(ew);
    return R.ok("查询班级信息成功").put("data", banjixinxiView);
    }
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        BanjixinxiEntity banjixinxi = banjixinxiService.selectById(id);
        return R.ok().put("data", banjixinxi);
    }
    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        BanjixinxiEntity banjixinxi = banjixinxiService.selectById(id);
        return R.ok().put("data", banjixinxi);
    }
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody BanjixinxiEntity banjixinxi, HttpServletRequest request){
      banjixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
      //ValidatorUtils.validateEntity(banjixinxi);
        banjixinxiService.insert(banjixinxi);
        return R.ok();
    }
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody BanjixinxiEntity banjixinxi, HttpServletRequest request){
      banjixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
      //ValidatorUtils.validateEntity(banjixinxi);
        banjixinxiService.insert(banjixinxi);
        return R.ok();
    }
    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody BanjixinxiEntity banjixinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(banjixinxi);
        banjixinxiService.updateById(banjixinxi);//全部更新
        return R.ok();
    }
    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        banjixinxiService.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<BanjixinxiEntity> wrapper = new EntityWrapper<BanjixinxiEntity>();
    if(map.get("remindstart")!=null) {
      wrapper.ge(columnName, map.get("remindstart"));
    }
    if(map.get("remindend")!=null) {
      wrapper.le(columnName, map.get("remindend"));
    }
    int count = banjixinxiService.selectCount(wrapper);
    return R.ok().put("count", count);
  }
}
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
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 org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
  @Autowired
    private ConfigService configService;
  /**
   * 上传文件
   */
  @RequestMapping("/upload")
  public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
    if (file.isEmpty()) {
      throw new EIException("上传文件不能为空");
    }
    String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
    File path = new File(ResourceUtils.getURL("classpath:static").getPath());
    if(!path.exists()) {
        path = new File("");
    }
    File upload = new File(path.getAbsolutePath(),"/upload/");
    if(!upload.exists()) {
        upload.mkdirs();
    }
    String fileName = new Date().getTime()+"."+fileExt;
    File dest = new File(upload.getAbsolutePath()+"/"+fileName);
    file.transferTo(dest);
    if(StringUtils.isNotBlank(type) && type.equals("1")) {
      ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
      if(configEntity==null) {
        configEntity = new ConfigEntity();
        configEntity.setName("faceFile");
        configEntity.setValue(fileName);
      } else {
        configEntity.setValue(fileName);
      }
      configService.insertOrUpdate(configEntity);
    }
    return R.ok().put("file", fileName);
  }
  /**
   * 下载文件
   */
  @IgnoreAuth
  @RequestMapping("/download")
  public ResponseEntity<byte[]> download(@RequestParam String fileName) {
    try {
      File path = new File(ResourceUtils.getURL("classpath:static").getPath());
      if(!path.exists()) {
          path = new File("");
      }
      File upload = new File(path.getAbsolutePath(),"/upload/");
      if(!upload.exists()) {
          upload.mkdirs();
      }
      File file = new File(upload.getAbsolutePath()+"/"+fileName);
      if(file.exists()){
        /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
          getResponse().sendError(403);
        }*/
        HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
          headers.setContentDispositionFormData("attachment", fileName);    
          return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
    return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
  }
}

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统

相关文章
|
5月前
|
SQL 关系型数据库 MySQL
【超级详细】MySQL下载 | MySQL安装教程 | MySQL数据库安装使用全攻略
MySQL是开源、高性能的关系型数据库,支持SQL标准,广泛用于网站后台、应用开发与数据分析。它免费稳定、跨平台(Windows/Linux/macOS),社区资源丰富。当前主流版本为MySQL 8.0(新特性强),5.7为长期支持版。
|
9月前
|
小程序 Java 关系型数据库
基于微信小程序的自习室座位预约系统
本文探讨了基于微信小程序的自习室预约管理系统的设计与实现。针对传统管理模式效率低、资源浪费等问题,系统采用Java语言、SSM框架、MySQL数据库和B/S结构,结合微信小程序的便捷性,实现座位在线预约、实时更新与智能管理,提升资源利用率与用户体验,推动智慧校园建设。
|
8月前
|
关系型数据库 MySQL 数据库
【2026最新】MySQL8下载安装全流程教程(附安装包+图文步骤)
MySQL 8是Oracle推出的开源关系型数据库,支持Windows、macOS、Linux系统,免费下载安装。以高效、安全存储结构化数据著称,适用于个人博客到大型电商、金融系统。相比PostgreSQL、SQL Server等,MySQL在功能、性能与易用性间实现良好平衡,安装简便、文档丰富,主流编程语言支持完善,中小团队无需专职DBA即可快速上手,是国内云厂商广泛支持的首选数据库之一。
4088 10
|
10月前
|
人工智能 JavaScript IDE
别用"战术勤奋"掩盖"战略懒惰":AI时代的降维竞品分析
5%的产品死于"盲视"。本文不仅是一套竞品分析AI指令,更是一次从战术勤奋到战略觉醒的认知升级。教你如何利用AI构建全天候商业情报雷达,寻找巨头缝隙中的差异化生存之道,实现商业战场的降维打击。
884 7
|
人工智能 Ubuntu Unix
第 1 章 Linux 快速入门
Mainline 表示主线开发版本,Stable 表示稳定版本,稳定版本主要由 mainline 测试通过而发布。Longterm 表示长期支持版,会持续更新及 Bug 修复,如果长期版本被标记为 EOL(End of Life),则表示不再提供更新。
385 0
|
数据安全/隐私保护 Python
Python3,10行代码,给pdf文件去水印,再也不用花费冤枉钱了。
Python3,10行代码,给pdf文件去水印,再也不用花费冤枉钱了。
34793 1
Python3,10行代码,给pdf文件去水印,再也不用花费冤枉钱了。
|
人工智能 Java 程序员
HarmonyOS 模拟器报未开启 Hyper-V解决方法
今日在开发Harmony NEXT版本元服务时,遇到模拟器无法启动的问题,报错为未开启Hyper-V。通过进入Windows设置,启用Hyper-V和虚拟机平台功能,并使用PowerShell命令`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All`成功解决问题,重启后模拟器恢复正常。
1657 0
|
人工智能 运维 安全
阿里云研发副总裁蔡德忠受邀参加乌镇峰会,畅谈AI与下一代互联网
2024年乌镇峰会“下一代互联网论坛”近日举办,主题为“创新驱动,安全赋能,共筑开放与安全的下一代互联网”。阿里云智能集团研发副总裁,基础设施网络研发负责人蔡德忠受邀参与圆桌讨论,并就人工智能(AI)与下一代互联网的融合发展分享了前瞻性见解。
|
监控 安全 数据挖掘
BPM业务流程管理是什么?有哪些值得推荐的BPM工具?
本文介绍了业务流程管理(BPM)的概念、历史发展及三种类型:以集成为中心、以人为中心和以文档为中心。随后推荐了五款 BPM 工具:板栗看板、Pega、Appian、K2 和 Bonitasoft,分别强调它们在界面设计、规则引擎、低代码开发、灵活集成和开源定制等方面的优势。企业可根据自身需求选择合适的工具优化业务流程。
2324 2
BPM业务流程管理是什么?有哪些值得推荐的BPM工具?