基于javaweb的SpringBoot校园宿舍管理系统(java+springboot+vue+maven+redis+mysql)

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

540023512402

550023512402

560023512402

570023512402

580023512402

590023512402

基于javaweb的SpringBoot校园宿舍管理系统(java+springboot+vue+maven+redis+mysql)

项目介绍

这个项目是一个基于SpringBoot+Vue的校园宿舍管理系统,前后端分离。 主要有超级管理员和宿舍管理员两种角色;

超级管理员权限包括: 首页; 学生宿舍管理:宿舍管理、学生管理、班级管理、宿舍楼管理; 记录:维修记录、晚归记录、请假记录; 系统管理:用户管理、角色管理、菜单管理、日志管理等。

宿舍管理员权限包括: 首页; 学生宿舍管理:宿舍管理、学生管理、班级管理; 记录:维修记录、晚归记录、请假记录;

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7/8.0版本均可; 5.是否Maven项目:是;

技术栈

1.后端:SpringBoot+Mysql+redis 2.前端:Vue

使用说明

后端项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application-dev.yaml配置文件中的数据库配置改为自己的配置; 4. 运行项目,控制台提示运行成功后再去运行前端项目;

前端项目运行:

  1. 安装好node环境 2. 在dms目录下运行 npm install 安装所需要的包 3. 在dms目录下运行 npm run dev 4. 运行成功后,在浏览器中访问http://localhost:8087,登录账号即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    @PostMapping("/save")
@RequirePermission(permissions = {"leave:save"})
@Log
public Result<?> save(@RequestBody @Validated Leave leave) {
leaveService.save(leave);
return Result.ok("添加成功");
}

@PostMapping("/list")
@RequirePermission(permissions = {"leave:list"})
public Result<PageInfo<Leave>> list(@RequestBody ListQuery<Leave> listQuery,
@RequestHeader(Constant.HEADER_TOKEN) String token) {
SystemUser user = redisUtil.exchange(token).get();
PageInfo<Leave> pageInfo = leaveService.list(listQuery, user.getBuildingId());
return Result.<PageInfo<Leave>>ok().add(pageInfo);
}


@GetMapping("/update/{id}")
@RequirePermission(permissions = {"leave:update"})
@Log
public Result<?> update(@PathVariable Long id) {
leaveService.update(id);
return Result.ok("更新成功");
}


@GetMapping("/delete/{id}")
@RequirePermission(permissions = {"leave:delete"})
@Log
public Result<?> delete(@PathVariable Long id) {
leaveService.delete(id);
return Result.ok("删除成功");
}


@GetMapping("/query/{id}")
@RequirePermission(permissions = {"leave:query"})
public Result<Leave> query(@PathVariable Long id) {
Leave leave = leaveService.query(id);
return Result.<Leave>ok().add(leave);
}

}
package com.hzvtc.myproject.controller;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36


/**
*/
@RestController
@RequestMapping("/depart")
public class DepartApplicationController {
@Autowired
private DepartApplicationService departApplicationService;
@Autowired
private StudentService studentService;
@Autowired
private RedisUtil redisUtil;
@Autowired
private SystemUserService systemUserService;

@PostMapping("/listMy")
public Result<PageInfo<DepartApplication>> listMyApplication(@RequestBody ListQuery<DepartApplication> listQuery,
@RequestHeader(Constant.HEADER_TOKEN) String token) {
Long id = redisUtil.get(token);
PageHelper.startPage(listQuery.getPage(), listQuery.getRows());
List<DepartApplication> list = departApplicationService.listMyApplication(id);
PageInfo<DepartApplication> pageInfo = new PageInfo<>(list);
return Result.<PageInfo<DepartApplication>>ok().add(pageInfo);
}

@PostMapping("/listMyFlow")
public Result<PageInfo<DepartApplicationUser>> listMyFlow(@RequestBody ListQuery<DepartApplication> listQuery,
@RequestHeader(Constant.HEADER_TOKEN) String token) {
Long id = redisUtil.get(token);
PageHelper.startPage(listQuery.getPage(), listQuery.getRows());
List<DepartApplicationUser> list = departApplicationService.listMyFlow(id);
PageInfo<DepartApplicationUser> pageInfo = new PageInfo<>(list);
return Result.<PageInfo<DepartApplicationUser>>ok().add(pageInfo);
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


/**
*/
@RestController
@RequestMapping("/system/role")
public class SystemRoleController {
@Autowired
private SystemRoleService systemRoleService;

@Autowired
private SystemFunctionService systemFunctionService;

@GetMapping("/listInSelect")
@RequirePermission(permissions = {"system:role:list"})
public Result<List<SystemRole>> listInSelect() {
return Result.<List<SystemRole>>ok().add(systemRoleService.listAll(new SystemRole()));
}

@PostMapping("/saveOrUpdate")
@RequirePermission(permissions = {"system:role:save", "system:role:update"})
@Log("添加修改角色")
public Result<?> saveOrUpdate(@RequestBody @Validated SystemRole role) {
systemRoleService.saveOrUpdate(role);
return Result.ok("操作成功");
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30


/**
*/
@RestController
@RequestMapping("/depart")
public class DepartApplicationController {
@Autowired
private DepartApplicationService departApplicationService;
@Autowired
private StudentService studentService;
@Autowired
private RedisUtil redisUtil;
@Autowired
private SystemUserService systemUserService;

@PostMapping("/listMy")
public Result<PageInfo<DepartApplication>> listMyApplication(@RequestBody ListQuery<DepartApplication> listQuery,
@RequestHeader(Constant.HEADER_TOKEN) String token) {
Long id = redisUtil.get(token);
PageHelper.startPage(listQuery.getPage(), listQuery.getRows());
List<DepartApplication> list = departApplicationService.listMyApplication(id);
PageInfo<DepartApplication> pageInfo = new PageInfo<>(list);
return Result.<PageInfo<DepartApplication>>ok().add(pageInfo);
}

@PostMapping("/listMyFlow")
public Result<PageInfo<DepartApplicationUser>> listMyFlow(@RequestBody ListQuery<DepartApplication> listQuery,
@RequestHeader(Constant.HEADER_TOKEN) String token) {
Long id = redisUtil.get(token);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
private RoomService roomService;


@GetMapping("/listAll")
@RequirePermission(permissions = {"manage:building:list"})
public Result<List<Building>> listAll() {
List<Building> list = buildingService.listAll();
return Result.<List<Building>>ok().add(list);
}

@GetMapping("/list")
@RequirePermission(permissions = {"manage:building:list"})
public Result<List<Building>> list() {
List<Building> list = buildingService.list();
return Result.<List<Building>>ok().add(list);
}

@GetMapping("delete")
@RequirePermission(permissions = {"manage:building:delete"})
@Log("删除building")
public Result<?> delete(@RequestParam("id") Long id) {
List<Room> list = roomService.listByBuildingId(id);
if (list.size() > 0) {
throw new HttpException(HttpCode.FAILED, "该节点下或子节点还有寝室,无法删除");
}
buildingService.delete(id);
return Result.ok("删除成功");
}

@GetMapping("/query")
@RequirePermission(permissions = {"manage:building:query"})
public Result<Building> query(@RequestParam("id") Long id) {
Building building = buildingService.query(id).orElseThrow(() -> new HttpException(HttpCode.FAILED, "该数据不存在"));
return Result.<Building>ok().add(building);
}

@PostMapping("/saveOrUpdate")
@RequirePermission(permissions = {"manage:building:save","manage:building:update"})
@Log
public Result<?> saveOrUpdate(@RequestBody @Validated Building building) {
if (building.getId() == null) {
buildingService.save(building);
} else {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    public Result<List<Building>> list() {
List<Building> list = buildingService.list();
return Result.<List<Building>>ok().add(list);
}

@GetMapping("delete")
@RequirePermission(permissions = {"manage:building:delete"})
@Log("删除building")
public Result<?> delete(@RequestParam("id") Long id) {
List<Room> list = roomService.listByBuildingId(id);
if (list.size() > 0) {
throw new HttpException(HttpCode.FAILED, "该节点下或子节点还有寝室,无法删除");
}
buildingService.delete(id);
return Result.ok("删除成功");
}

@GetMapping("/query")
@RequirePermission(permissions = {"manage:building:query"})
public Result<Building> query(@RequestParam("id") Long id) {
Building building = buildingService.query(id).orElseThrow(() -> new HttpException(HttpCode.FAILED, "该数据不存在"));
return Result.<Building>ok().add(building);
}

@PostMapping("/saveOrUpdate")
@RequirePermission(permissions = {"manage:building:save","manage:building:update"})
@Log
public Result<?> saveOrUpdate(@RequestBody @Validated Building building) {
if (building.getId() == null) {
buildingService.save(building);
} else {
if (building.getId().equals(building.getParentId())) {
throw new HttpException(HttpCode.FAILED, "父节点不能为自己");
}
buildingService.update(building);
}
return Result.ok("操作成功");
}
}
package com.hzvtc.myproject.controller;


项目链接:
https://javayms.github.io?id=161122532008200qe
https://javayms.pages.dev?id=161122532008200qe