基于javaweb,ssm学生宿舍系统(带论文)

news2025/7/5 11:06:48

开发工具:IDEA

服务器:Tomcat8.0, jdk1.8

项目构建:maven

数据库:mysql5.7

系统分前后台,非前后端分离

前端技术:vue.js+elementUI等框架实现

服务端技术:spring+springmvc+mybatis(ssm框架)

系统主要分学生和管理员,两个角色

系统的功能有:登录、注册、修改密码、退出登录,个人中心、学生管理、房间信息管理、来访信息管理、物品报修管理、维修进程管理、公告信息管理

学生截图:

 

 

 

 

 

 

 

 

管理员截图: 

 

 

 

 

 

 

 

 

 

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.FangjianxinxiEntity;
import com.entity.view.FangjianxinxiView;

import com.service.FangjianxinxiService;
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-20 17:25:51
 */
@RestController
@RequestMapping("/fangjianxinxi")
public class FangjianxinxiController {
    @Autowired
    private FangjianxinxiService fangjianxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,FangjianxinxiEntity fangjianxinxi, 
		HttpServletRequest request){

        EntityWrapper<FangjianxinxiEntity> ew = new EntityWrapper<FangjianxinxiEntity>();
		PageUtils page = fangjianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangjianxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,FangjianxinxiEntity fangjianxinxi, HttpServletRequest request){
        EntityWrapper<FangjianxinxiEntity> ew = new EntityWrapper<FangjianxinxiEntity>();
		PageUtils page = fangjianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangjianxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( FangjianxinxiEntity fangjianxinxi){
       	EntityWrapper<FangjianxinxiEntity> ew = new EntityWrapper<FangjianxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( fangjianxinxi, "fangjianxinxi")); 
        return R.ok().put("data", fangjianxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(FangjianxinxiEntity fangjianxinxi){
        EntityWrapper< FangjianxinxiEntity> ew = new EntityWrapper< FangjianxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( fangjianxinxi, "fangjianxinxi")); 
		FangjianxinxiView fangjianxinxiView =  fangjianxinxiService.selectView(ew);
		return R.ok("查询房间信息成功").put("data", fangjianxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        FangjianxinxiEntity fangjianxinxi = fangjianxinxiService.selectById(id);
        return R.ok().put("data", fangjianxinxi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        FangjianxinxiEntity fangjianxinxi = fangjianxinxiService.selectById(id);
        return R.ok().put("data", fangjianxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody FangjianxinxiEntity fangjianxinxi, HttpServletRequest request){
    	fangjianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(fangjianxinxi);

        fangjianxinxiService.insert(fangjianxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody FangjianxinxiEntity fangjianxinxi, HttpServletRequest request){
    	fangjianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(fangjianxinxi);

        fangjianxinxiService.insert(fangjianxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody FangjianxinxiEntity fangjianxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(fangjianxinxi);
        fangjianxinxiService.updateById(fangjianxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        fangjianxinxiService.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<FangjianxinxiEntity> wrapper = new EntityWrapper<FangjianxinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = fangjianxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

 

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.GonggaoxinxiEntity;
import com.entity.view.GonggaoxinxiView;

import com.service.GonggaoxinxiService;
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-20 17:25:51
 */
@RestController
@RequestMapping("/gonggaoxinxi")
public class GonggaoxinxiController {
    @Autowired
    private GonggaoxinxiService gonggaoxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,GonggaoxinxiEntity gonggaoxinxi, 
      HttpServletRequest request){

        EntityWrapper<GonggaoxinxiEntity> ew = new EntityWrapper<GonggaoxinxiEntity>();
      PageUtils page = gonggaoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gonggaoxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,GonggaoxinxiEntity gonggaoxinxi, HttpServletRequest request){
        EntityWrapper<GonggaoxinxiEntity> ew = new EntityWrapper<GonggaoxinxiEntity>();
      PageUtils page = gonggaoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gonggaoxinxi), params), params));
        return R.ok().put("data", page);
    }

   /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( GonggaoxinxiEntity gonggaoxinxi){
           EntityWrapper<GonggaoxinxiEntity> ew = new EntityWrapper<GonggaoxinxiEntity>();
       ew.allEq(MPUtil.allEQMapPre( gonggaoxinxi, "gonggaoxinxi")); 
        return R.ok().put("data", gonggaoxinxiService.selectListView(ew));
    }

    /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(GonggaoxinxiEntity gonggaoxinxi){
        EntityWrapper< GonggaoxinxiEntity> ew = new EntityWrapper< GonggaoxinxiEntity>();
      ew.allEq(MPUtil.allEQMapPre( gonggaoxinxi, "gonggaoxinxi")); 
      GonggaoxinxiView gonggaoxinxiView =  gonggaoxinxiService.selectView(ew);
      return R.ok("查询公告信息成功").put("data", gonggaoxinxiView);
    }
   
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        GonggaoxinxiEntity gonggaoxinxi = gonggaoxinxiService.selectById(id);
        return R.ok().put("data", gonggaoxinxi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        GonggaoxinxiEntity gonggaoxinxi = gonggaoxinxiService.selectById(id);
        return R.ok().put("data", gonggaoxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody GonggaoxinxiEntity gonggaoxinxi, HttpServletRequest request){
       gonggaoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(gonggaoxinxi);

        gonggaoxinxiService.insert(gonggaoxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody GonggaoxinxiEntity gonggaoxinxi, HttpServletRequest request){
       gonggaoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(gonggaoxinxi);

        gonggaoxinxiService.insert(gonggaoxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody GonggaoxinxiEntity gonggaoxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(gonggaoxinxi);
        gonggaoxinxiService.updateById(gonggaoxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        gonggaoxinxiService.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<GonggaoxinxiEntity> wrapper = new EntityWrapper<GonggaoxinxiEntity>();
      if(map.get("remindstart")!=null) {
         wrapper.ge(columnName, map.get("remindstart"));
      }
      if(map.get("remindend")!=null) {
         wrapper.le(columnName, map.get("remindend"));
      }


      int count = gonggaoxinxiService.selectCount(wrapper);
      return R.ok().put("count", count);
   }
   


}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/18563.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

基于stm32单片机的输入捕获测量脉宽Proteus仿真

资料编号&#xff1a;109 下面是相关功能视频演示&#xff1a; 109-基于stm32的输入捕获测量脉宽Proteus仿真(源码仿真全套资料)功能介绍&#xff1a; 采用stm32单片机作为主控&#xff0c;采用单片机的GPIO进行输入捕获&#xff0c;可以测量按键按下的低电平脉宽时间&#x…

云原生系列七【轻松入门容器基础操作】

✅作者简介&#xff1a; CSDN内容合伙人&#xff0c;全栈领域新星创作者&#xff0c;阿里云专家博主&#xff0c;华为云享专家博主&#xff0c;掘金后端评审团成员 &#x1f495;前言&#xff1a; 最近云原生领域热火朝天&#xff0c;那么云原生是什么&#xff1f;何为云原生&a…

驱动——串口工具点灯实验

通过串口工具输入命令&#xff0c;操作LED灯的点亮与熄灭 要求&#xff1a; 1&#xff09;分部实现注册字符设备驱动 2&#xff09;自动创建设备节点 3&#xff09;通过结构体对led灯地址进行映射 4&#xff09;次设备号完成私有数据传参 代码实现&#xff1a; 1、头文件…

如何使用闲置的云服务器搭建一个属于自己的私人云网盘(可道云kodbox)

你是否有过网盘下载速度只有十几KB&#xff0c;时不时出现网盘的文件被删除的问题&#xff0c;不如自己搭建一个云网盘吧&#xff0c;只需要一云服务器&#xff0c;即可搭建一个跟某度云一样的云盘。可以自由下载&#xff0c;不限制网速&#xff0c;随时都可上传下载。这篇文章…

[附源码]SSM计算机毕业设计在线文献查阅系统JAVA

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Redis应用问题解决(缓存穿透、击穿、雪崩、分布式锁)

Redis应用问题解决(缓存穿透、击穿、雪崩、分布式锁) 缓存穿透 问题描述 当系统中引入redis缓存后&#xff0c;一个请求进来后&#xff0c;会先从redis缓存中查询&#xff0c;缓存有就直接返回&#xff0c;缓存中没有就去db中查询&#xff0c;db中如果有就会将其丢到缓存中&…

Dockerfile构建SpringBoot项目

【1】将SpringBoot项目打包 jar包-->用JDK运行(我们这里打成jar包)war包-->用Tomcat运行 MySQL的url配置 1.useSSLfalse MySQL 8.0 以上版本不需要建立 SSL 连接的&#xff0c;需要显示关闭 2.allowPublicKeyRetrievaltrue 允许客户端从服务器获取公钥。 3.serverTime…

git3:github的使用

1.github创建远程库 创建远程库 名字一般与本地库的名字相同推送远程库push poll https://github.com/likejin123/gitdemo.git 可以创建别名&#xff0c;因为连接太长git remote -v 查看别名 当前没有别名 git remote add gitdemo https://github.com/likejin123/gitdemo.gitg…

初阶数据结构学习记录——여덟 二叉树

树 顾名思义&#xff0c;结构即为树&#xff0c;由一个根节点分出多个节点&#xff0c;这几个节点再继续往下连接其他节点形成一个个子树。不过这棵树是根朝上&#xff0c;叶朝下的。一个根不限制连接多少个节点&#xff0c;把第二层的几个节点也看成根节点&#xff0c;最终形…

2011年408大题总结

2011年408大题第41题第42题第43题第44题第45题第46题第47题第41题 关键信息&#xff1a;有向带权、上三角、行为主序 就可以解决第一二小问 关键路径&#xff1a;最长 0 1 2 3 5&#xff0c;长度为16 第42题 一如既往的暴力 最简单的思路&#xff0c;合并取中位数 所以用数组就…

[附源码]java毕业设计拾穗在线培训考试系统

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Android App开发动画特效中帧动画和电影淡入淡出动画的讲解及实战(附源码和演示视频 简单易懂)

需要图片集和源码请点赞关注收藏后评论区留言~~~ 一、帧动画 Android的动画分为三类&#xff0c;帧动画&#xff0c;补间动画和属性动画。其中帧动画是实现原理最简单的一种&#xff0c;跟现实生活中的电影胶卷类似&#xff0c;都是在短时间内连续播放多张图片&#xff0c;从而…

Request和Response

目录 1、Request和Response的概述 2、Request对象 2.1、Request继承体系 2.2、Request获取请求数据 2.2.1 获取请求行数据 2.2.2 获取请求头数据 2.2.3 获取请求体数据 2.2.4、获取请求参数的通用方式 2.3 IDEA快速创建Servlet 2.4、请求参数中文乱码问题 2.4.1、POS…

认识Spring

1.1 Spring的历程 早期的 Java EE 使用 EJB 为核心的开发方式,但是这种开发方式在实际开发环境中存在诸多问题: 使用复杂, 代码臃肿, 移植性差等.于是"Spring 之父" Rod Johnson 在其畅销书《Expert One-on-One J2EE Design and Development》中使用一个3万行代码的…

MySQL8.0优化 - 锁 - 按加锁的方式划分:显示锁、隐式锁

文章目录学习资料锁的不同角度分类锁的分类图如下按加锁的方式划分&#xff1a;显示锁、隐式锁隐式锁显式锁学习资料 【MySQL数据库教程天花板&#xff0c;mysql安装到mysql高级&#xff0c;强&#xff01;硬&#xff01;-哔哩哔哩】 【阿里巴巴Java开发手册】https://www.w3…

[附源码]计算机毕业设计JAVA基于Java的快递驿站管理系统

[附源码]计算机毕业设计JAVA基于Java的快递驿站管理系统 项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; S…

车联网解决方案-最新全套文件

车联网解决方案-最新全套文件一、建设背景面临的挑战1、平台难以支撑高并发接入2、海量数据难以挖掘价值3、缺乏使能套件&#xff0c;开发效率低4、车联网的安全难以保证二、建设架构三、建设方案四、获取 - 车联网全套最新解决方案合集一、建设背景 面临的挑战 1、平台难以支…

Teams Tab App 代码深入浅出 - 配置页面

上一篇文章我们使用Teams Toolkit 来创建、运行 tab app。这篇文章我们深入来分析看一下tab app 的代码。 先打开代码目录&#xff0c;可以看到在 src 目录下有入口文件 index.tsx&#xff0c;然后在 components 目录下有更多的一些 tsx 文件&#xff0c;tsx 是 typescript的一…

实战十二:基于FM算法针对用户商品购买和浏览记录预测用户的行为 代码+数据

1.案例知识点 推荐系统任务描述:通过用户的历史行为(比如浏览记录、购买记录等等)准确的预测出用户未来的行为;好的推荐系统不仅如此,而且能够拓展用户的视野,帮助他们发现可能感兴趣的却不容易发现的item;同时将埋没在长尾中的好商品推荐给可能感兴趣的用户。FM推荐方法…

Qt5开发从入门到精通——第十一篇二节(Qt5 事件处理及实例——键盘事件及实例)

提示&#xff1a;欢迎小伙伴的点评✨✨&#xff0c;相互学习c/c应用开发。&#x1f373;&#x1f373;&#x1f373; 博主&#x1f9d1;&#x1f9d1; 本着开源的精神交流Qt开发的经验、将持续更新续章&#xff0c;为社区贡献博主自身的开源精神&#x1f469;‍&#x1f680; 文…