基于javaweb+mysql的ssm在线宿舍管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM在线宿舍管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
项目介绍
本项目包含管理员、宿舍管理员、学生三种角色;
管理员角色包含以下功能: 管理员登录,院系管理,专业管理,年级管理,班级管理,学生设置,宿舍管理员管理,宿舍楼管理,宿舍管理,床位管理,学生入住登记,学生退房管理等功能。
宿舍管理员角色包含以下功能: 宿舍管理员管理,宿舍楼管理,宿舍管理,床位管理,入住登记,退房管理,个人信息修改等功能。
学生角色包含以下功能: 学生角色登录,我入住的床位,个人信息修改等功能。
环境需要
1.运行环境:java jdk 1.7,注:该项目仅支持jdk1.7,不支持1.8及以上版本; 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+bootstrap+jquery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中config/jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/ 登录
注意事项 该项目仅支持jdk1.7,不支持1.8及以上版本;
private DormServiceI dormServiceI;
/**
* 跳转宿舍楼信息管理页面
* @return
*/
@GetMapping("/view")
public String getDormView() {
return "dorm/dorm";
/**
* 宿舍楼信息列表-带分页
* @param pageable
* @return
return staffServiceI.updatePwd(id, oldPwd, newPwd);
/**
* 员工管理列表-分页
* @param pageable
* @param searchName
* @param searchDorm
* @return
*/
@GetMapping("/list")
@ResponseBody
public Page<Staffinfo> getStuInfo(@PageableDefault Pageable pageable, String searchName, String searchDorm) {
return staffServiceI.findStaffs(pageable, searchName, searchDorm);
/**
return dormServiceI.findDorms(pageable);
/**
* 获取宿舍列表
* @param session
* @return
*/
@GetMapping("/getDorms")
@ResponseBody
public List<Dorm> getDorms(HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return dormServiceI.getDorms(user.getStaffinfo());
/**
return "stu/repairView";
/**
* 查询学生报修列表
* @param pageable
* @param session
* @return
*/
@GetMapping("/repairInfo")
@ResponseBody
public Page<Repair> getRepairInfo(@PageableDefault Pageable pageable, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
@GetMapping("/repairInfo")
@ResponseBody
public Page<Repair> getRepairInfo(@PageableDefault Pageable pageable, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findRepair(pageable, user.getStuinfo().getId());
/**
* 添加报修
* @param repair
* @param session
* @return
*/
public Page<Repair> getRepairHistory(@PageableDefault Pageable pageable, HttpSession session, String reason) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return staffServiceI.findRepairHistory(pageable, reason, user.getStaffinfo());
宿舍楼信息管理控制层:
@Controller
@RequestMapping("/dorm")
public class DormController {
@Autowired
private DormServiceI dormServiceI;
/**
* 跳转宿舍楼信息管理页面
model.addAttribute("stuinfo", new ObjectMapper().writeValueAsString(stuinfo));
return "stu/infoView";
/**
* 学生更新密码
* @param session
* @param model
* @return
*/
@GetMapping("/updatePwd")
public String updatePwd(HttpSession session, Model model) {
return "stu/repairView";
/**
* 查询学生报修列表
* @param pageable
* @param session
* @return
*/
@GetMapping("/repairInfo")
@ResponseBody
public Page<Repair> getRepairInfo(@PageableDefault Pageable pageable, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findRepair(pageable, user.getStuinfo().getId());
/**
* 添加报修
* @param repair
* @param session
* @return
*/
@PostMapping("/createRepair")
@ResponseBody
public Boolean createRepair(Repair repair, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
Stuinfo stuinfo = stuServiceI.findById(user.getUsername());
return staffServiceI.importExcel(file);
/**
* 重置密码
* @param staffId
* @return
*/
@GetMapping("/resetPwd")
@ResponseBody
public Boolean resetPwd(String staffId) {
return staffServiceI.resetPwd(staffId);
*/
@GetMapping("/repairHistoryView")
public String repairHistoryView() {
return "stu/repairHistory";
/**
* 查询历史报修记录列表
* @param pageable
* @param session
* @return
*/
@GetMapping("/repairHistory")
* @param session
* @param searchId
* @param searchDormName
* @return
*/
@GetMapping("/list")
@ResponseBody
public Page<Stuinfo> getStuInfo(@PageableDefault Pageable pageable, HttpSession session, String searchId, String searchDormName) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findStus(pageable, user, searchId, searchDormName);
/**
* 导入文件-学生信息
@GetMapping("/del")
@ResponseBody
public Boolean del(String staffId) {
return staffServiceI.del(staffId);
/**
* 更新员工信息
* @param staffinfo
* @return
*/
@PostMapping("/update")
@ResponseBody
if (list.size() > 0 ){
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("历史保修单", "历史保修单表1"), Repair.class, list);
ExportExcelUtil.downLoadExcel(response, "历史保修单", workbook);
/**
* 处理报修
* @param repairId
* @return
*/
@GetMapping("/dealRepairProcess")
@ResponseBody
public Boolean dealRepairProcess(String repairId) {
return staffServiceI.dealRepairProcess(repairId);
/**
*/
@GetMapping("/view")
public String getStaffView() {
return "staff/staff";
/**
* 跳转到员工详情页面
* @param session
* @param model
* @return
* @throws Exception
*/
@GetMapping("/infoView")
public String getInfoView(HttpSession session, Model model) throws Exception {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
public Page<Repair> getRepairInfo(@PageableDefault Pageable pageable, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findRepair(pageable, user.getStuinfo().getId());
/**
* 添加报修
* @param repair
* @param session
* @return
*/
@PostMapping("/createRepair")
@ResponseBody
* @param ids
* @return
*/
@PostMapping("/batchDeal")
@ResponseBody
public Boolean batchDeal(@RequestBody List<String> ids) {
return staffServiceI.batchDeal(ids);
/**
* 处理未处理报修单
* @param repairId
* @return
@ResponseBody
public Boolean del(Stuinfo stuinfo) {
return stuServiceI.update(stuinfo);
/**
* 跳转申请报修页面
* @return
*/
@GetMapping("/repairView")
public String repairView() {
return "stu/repairView";
/**
* 查询学生报修列表
* @param pageable
* @param session
public Boolean del(Stuinfo stuinfo) {
return stuServiceI.update(stuinfo);
/**
* 跳转申请报修页面
* @return
*/
@GetMapping("/repairView")
public String repairView() {
return "stu/repairView";
/**
* 查询学生报修列表
* @param pageable
* @param session
return "stu/stu";
/**
* @param session
* @param response
*/
@PostMapping("/exportInfo")
public void exportInfo(HttpSession session, HttpServletResponse response) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
List<Stuinfo> list = stuServiceI.findAll(user);
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("学生信息", "学生信息表1"), Stuinfo.class, list);
ExportExcelUtil.downLoadExcel(response, "学生信息表", workbook);
/**
* 跳转学生个人主页
* @param searchDormName
* @return
*/
@GetMapping("/list")
@ResponseBody
public Page<Stuinfo> getStuInfo(@PageableDefault Pageable pageable, HttpSession session, String searchId, String searchDormName) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findStus(pageable, user, searchId, searchDormName);
/**
* 导入文件-学生信息
@ResponseBody
public Page<Repair> getRepairHistory(@PageableDefault Pageable pageable, HttpSession session, String reason) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return staffServiceI.findRepairHistory(pageable, reason, user.getStaffinfo());
宿舍楼信息管理控制层:
@Controller
@RequestMapping("/dorm")
public class DormController {
@Autowired
private DormServiceI dormServiceI;
/**
* 跳转宿舍楼信息管理页面
* @return
*/
@ResponseBody
public Page<Repair> getRepairInfo(@PageableDefault Pageable pageable, HttpSession session) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
return stuServiceI.findRepair(pageable, user.getStuinfo().getId());
/**
* 添加报修
* @param repair
* @param session
* @return
*/
@PostMapping("/createRepair")
@ResponseBody
@PostMapping("/updatePwd")
@ResponseBody
public Boolean updatePwd(String id, String oldPwd, String newPwd) {
return staffServiceI.updatePwd(id, oldPwd, newPwd);
/**
* 员工管理列表-分页
* @param pageable
* @param searchName
* @param searchDorm
* @return
*/
@GetMapping("/list")
@ResponseBody
@GetMapping("/updatePwd")
public String updatePwd(HttpSession session, Model model) {
UserExpand user = (UserExpand) session.getAttribute("LOGIN_USER");
Staffinfo staffinfo = staffServiceI.findById(user.getUsername());
model.addAttribute("id", staffinfo.getId());
return "staff/updatePwd";
/**
* 修改手机号
* @param staffinfo
* @return
*/
@PostMapping("/updatePhone")
@ResponseBody
* 修改密码
* @return
*/
@PostMapping("/updatePwd")
@ResponseBody
public Boolean updatePwd(String id, String oldPwd, String newPwd) {
return staffServiceI.updatePwd(id, oldPwd, newPwd);
/**
* 员工管理列表-分页
* @param pageable
* @param searchName
* @param searchDorm