大家好!我是程序猿老A,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
- 开发语言:Java
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/2301_76953549/89117263
论文目录
【如需全文请按文末获取联系】
一、项目简介
宿舍管理系统通过MySQL数据库与Eclipse工具进行开发,宿舍管理系统能够实现宿舍信息管理,宿舍评分管理,学生评分管理,来访登记管理,维修登记管理,班级管理,学生管理等功能。
二、系统设计
2.1软件功能模块设计
管理员功能结构图的绘制结果见图4-1。管理员登录进入本系统操作的功能包括管理宿舍信息,管理学生评分信息,管理宿舍评分信息,管理来访登记信息,管理维修登记信息,管理班级与学生信息等。
学生功能结构图的绘制结果见图4-2。学生登录进入本系统操作的功能包括查看学生评分,查看宿舍评分信息,查看宿舍信息,登记宿舍维修信息,管理宿舍维修信息,查看公告等。
2.2数据库设计
(1)使用Visio这样的常用的实体属性图绘制工具来绘制学生实体属性图,绘制结果见图4-3。
(2)使用Visio这样的常用的实体属性图绘制工具来绘制管理员实体属性图,绘制结果见图4-4。
(4)使用Visio这样的常用的实体属性图绘制工具来绘制宿舍信息实体属性图,绘制结果见图4-6。
(5)绘制的上述实体间存在的联系见图4-7。
三、系统项目部分截图
3.1管理员功能实现
宿舍信息管理
管理员进入如图5-1所示的宿舍信息管理界面之后,管理员点击信息显示栏中最右侧的宿舍评分,修改,删除按钮可依次完成宿舍信息的宿舍评分查看,修改,删除操作。
来访登记管理
管理员进入如图5-2所示的来访登记管理界面之后,管理员点击信息显示栏中最右侧的修改,删除按钮可依次完成来访登记信息的修改,删除等操作,管理员在当前界面也能添加来访登记信息,查询来访登记信息。
学生评分管理
管理员进入如图5-3所示的学生评分管理界面之后,管理员点击信息显示栏右侧的修改,删除按钮可依次完成学生评分信息的修改,删除等操作。学生评分信息包括清洁卫生,文明举止,总得分以及评分时间等信息。
3.2学生功能实现
宿舍信息管理
学生进入如图5-5所示的宿舍信息管理界面之后,学生可以点击信息显示栏右侧的维修登记按钮可以登记宿舍的维修信息,可以在宿舍信息管理界面查询,查看宿舍信息等。
维修登记管理
学生进入如图5-6所示的维修登记管理界面之后,学生可以查询维修登记信息,查询时,需要提供宿舍号或学号才能查询维修登记信息,在维修登记管理界面,学生也能删除维修登记信息。
公告信息查看
学生进入如图5-7所示的公告信息查看界面之后,学生查看公告详细内容,当公告信息比较多时,学生可以使用查询功能来查询公告,查询前需要在查询框中登记标题才可以实现对公告信息的查询。
四、部分核心代码
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.SushexinxiEntity;
import com.entity.view.SushexinxiView;
import com.service.SushexinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 宿舍信息
* 后端接口
* @author
* @email
* @date 2022-03-30 15:36:49
*/
@RestController
@RequestMapping("/sushexinxi")
public class SushexinxiController {
@Autowired
private SushexinxiService sushexinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,SushexinxiEntity sushexinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
sushexinxi.setXuehao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<SushexinxiEntity> ew = new EntityWrapper<SushexinxiEntity>();
PageUtils page = sushexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, sushexinxi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,SushexinxiEntity sushexinxi,
HttpServletRequest request){
EntityWrapper<SushexinxiEntity> ew = new EntityWrapper<SushexinxiEntity>();
PageUtils page = sushexinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, sushexinxi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( SushexinxiEntity sushexinxi){
EntityWrapper<SushexinxiEntity> ew = new EntityWrapper<SushexinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( sushexinxi, "sushexinxi"));
return R.ok().put("data", sushexinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(SushexinxiEntity sushexinxi){
EntityWrapper< SushexinxiEntity> ew = new EntityWrapper< SushexinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( sushexinxi, "sushexinxi"));
SushexinxiView sushexinxiView = sushexinxiService.selectView(ew);
return R.ok("查询宿舍信息成功").put("data", sushexinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
SushexinxiEntity sushexinxi = sushexinxiService.selectById(id);
return R.ok().put("data", sushexinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
SushexinxiEntity sushexinxi = sushexinxiService.selectById(id);
return R.ok().put("data", sushexinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody SushexinxiEntity sushexinxi, HttpServletRequest request){
sushexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(sushexinxi);
sushexinxiService.insert(sushexinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody SushexinxiEntity sushexinxi, HttpServletRequest request){
sushexinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(sushexinxi);
sushexinxiService.insert(sushexinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody SushexinxiEntity sushexinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(sushexinxi);
sushexinxiService.updateById(sushexinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
sushexinxiService.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<SushexinxiEntity> wrapper = new EntityWrapper<SushexinxiEntity>();
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 = sushexinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微❤联系。