基于javaweb的SpringBoot教室图书馆预约管理系统(java+springboot+jpa+vue+maven+mysql)

运行环境

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

开发工具

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

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

适用

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

功能说明

030023252402

040023252402

050023252402

070023252402

080023252402

090023252402

100023252402

基于javaweb的SpringBoot教室图书馆预约管理系统(java+springboot+jpa+vue+maven+mysql)

项目简介:

这是一个前后端分离的教室预约和查看系统项目,能够实现以教室为单位活动的预约和取消,能够以视图形式显示,附带图书馆和公告管理器功能。

主要采用Vue.js+SpringBoot 技术栈开发

使用技术点

  • 前端:VueElementUIaxiosEchartjQurey * 后端:SpringBootSpring Data + JPAhibernateMySQLShiro

使用说明:

  1. 在mysql数据库中创建数据库testmeeting行项目,将自动注入数据。如需关闭此功能,请将 application.properties 中的 spring.datasource.initialization-mode=always 代码注释。同样,可以通过使用项目sql目录下testmeeting直接导入数 据库数据结构与内容,可根据需要自行使用。2. 数据库配置在后端项目的 src\main\resources 目录下的application.properties 文件中,mysql 版本为 8.0以上版本 。 3. 在IntelliJ IDEA中运行后端项目,为了保证项目成功运行,可以右键点击 pom.xml 选择 maven -> reimport ,并重启项目。 至此,服务端就启动成功了,同时,运行前端项目,访问 http://localhost:8080 ,即可进入登录页面,默认账号是 admin,密码是 123 4. 项目使用了虹软公司的人脸识别SDK与百度的人体分析SDk: * 虹软的SDK请自行前往官网获取,获取后建议将SDK导入到src/main/resources/lib-sdk目录下,然后在src/main/java/utils目录下新建SdkParameter.java文件,填入appId和key以及引擎和算法等文件位置。 * 百度人体分析SDk已在maven中引用,但是app_id等请前往百度云AI开发者平台自行获取,该项目中表示位置为SdkParameter.java文件。 * 以上内容不必要,可以删除并注释对应接口与服务即可。 —-

二次开发请注意:

  • 进入前端项目根目录中,在命令行依次输入如下命令: text # 安装依赖 npm install # 在 localhost:8080 启动项目 npm run dev * 由于在前端项目中已经配置了端口转发,将数据转发到SpringBoot上,因此项目启动之后,在浏览器中输入 http://localhost:8080 就可以访问我们的前端项目了,所有的请求通过端口转发将数据传到 SpringBoot 中(注意此时不要关闭 SpringBoot 项目)。 * 最后可以用 IDEA / WebStorm 等工具打开前端项目,继续开发,开发完成后,当项目要上线时,依然进入到 wj-vue 目录,然后执行如下命令: text npm run build * 该命令执行成功之后,前端项目目录下生成一个 dist 文件夹,可以将该文件夹中的两个文件staticindex.html 拷贝到前端项目中 resources/static/ 目录下,然后直接运行前端项目,访问 http://localhost:8443

实际上是把前端打包后作为静态文件,但不推荐使用这种方式。

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
 * @return 封装好的活动数量
*/
@RequestMapping("/meeting/count")
public Result getAllCount() {
return ResultFactory.buildSuccessResult(meetingService.CountByAllMeeting());
}

/**
* 获取指定用户的活动
*
* @param requestUser 要查找的用户
* @return 封装好活动信息列表
*/
@RequestMapping("/meeting/get/user")
public Result getAllMeetingByUsername(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuId(requestUser.getUsername()));
}

/**
* 获取管理员的活动
*
* @return 封装好的管理员活动
*/
@RequestMapping("/meeting/get/admin")
public Result getAllMeetingByAdmin() {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuId("admin"));
}

/**
* 查询用户可用的活动
*
* @param requestUser 要查询的用户
* @return 封装好的用户
*/
@RequestMapping("/meeting/get/user_used")
public Result getAllMeetingByUsernameUsable(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdUsable(requestUser.getUsername()));
}

/**
* 取消活动
*
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
    @PostMapping("api/admin/content/article")
public Result saveArticle(@RequestBody @Valid JotterArticle article) {
jotterArticleService.addOrUpdate(article);
return ResultFactory.buildSuccessResult("保存成功");
}

/**
* 分页功能
* @param size 数量
* @param page 页码数
* @return 封装页面数据
*/
@GetMapping("/api/article/{size}/{page}")
public Result listArticles(@PathVariable("size") int size, @PathVariable("page") int page) {
return ResultFactory.buildSuccessResult(jotterArticleService.list(page - 1, size));
}

/**
* 查看指定ID的文章
* @param id 文章、公告的iD
* @return 封装的文章或者公告
*/
@GetMapping("/api/article/{id}")
public Result getOneArticle(@PathVariable("id") int id) {
return ResultFactory.buildSuccessResult(jotterArticleService.findById(id));
}

/**
* 删除文章或者公告
* @param id 要删除的ID
* @return 封装好的删除结果
*/
@DeleteMapping("/api/admin/content/article/{id}")
public Result deleteArticle(@PathVariable("id") int id) {
jotterArticleService.delete(id);
return ResultFactory.buildSuccessResult("删除成功");
}
}
//package com.shencangblue.design.icrs.config;
//
//
//
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
            return ResultFactory.buildSuccessResult(bookService.Search(keywords));
}
}

/**
* 获取某个分类的书籍
* @param cid 分类ID
* @return 封装的书籍
*/
@GetMapping("/api/categories/{cid}/books")
public Result listByCategory(@PathVariable("cid") int cid) {
if (0 != cid) {
return ResultFactory.buildSuccessResult(bookService.listByCategory(cid));
} else {
return ResultFactory.buildSuccessResult(bookService.list());
}
}

/**
* 上传书籍封面
* @param file 数据封面
* @return 书籍的链接
*/
@PostMapping("/api/admin/content/books/covers")
public String coversUpload(MultipartFile file) {
String folder = "D:/workspace/img";
File imageFolder = new File(folder);
File f = new File(imageFolder, StringUtils.getRandomString(6) + file.getOriginalFilename()
.substring(file.getOriginalFilename().length() - 4));
if (!f.getParentFile().exists())
f.getParentFile().mkdirs();
try {
file.transferTo(f);
String imgURL = "http://localhost:8443/api/file/" + f.getName();
return imgURL;
} catch (IOException e) {
e.printStackTrace();
return "";
}
}

}
package com.shencangblue.design.icrs.filter;



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
    public String coversUpload(MultipartFile file) {
AipBodyAnalysis client =BDAipBodyAnalysis.getClient();
String folder = "D:/workspace/img";
File imageFolder = new File(folder);
File f = new File(imageFolder, StringUtils.getRandomString(6) + file.getOriginalFilename()
.substring(file.getOriginalFilename().length() - 4));
if (!f.getParentFile().exists())
f.getParentFile().mkdirs();
try {
file.transferTo(f);
// String imgURL = "http://localhost:8443/api/file/" + f.getName();
// return imgURL;
return classRoomService.analysisPeople(client ,f);
} catch (IOException e) {
e.printStackTrace();
return "-1";
}
}


}
package com.shencangblue.design.icrs.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
37
38
39
40
41
@GetMapping("/api/admin/role")
public Result listRoles() {
return ResultFactory.buildSuccessResult(adminRoleService.listWithPermsAndMenus());
}

/**
* 获取角色状态
* @param requestRole 要查询的角色
* @return 封装好的消息
*/
@PutMapping("/api/admin/role/status")
public Result updateRoleStatus(@RequestBody AdminRole requestRole) {
AdminRole adminRole = adminRoleService.updateRoleStatus(requestRole);
String message = "用户" + adminRole.getNameZh() + "状态更新成功";
return ResultFactory.buildSuccessResult(message);
}

/**
* 修改角色信息
* @param requestRole 要修改的角色信息
* @return 封装好的消息
*/
@PutMapping("/api/admin/role")
public Result editRole(@RequestBody AdminRole requestRole) {
adminRoleService.addOrUpdate(requestRole);
adminRolePermissionService.savePermChanges(requestRole.getId(), requestRole.getPerms());
String message = "修改角色信息成功";
return ResultFactory.buildSuccessResult(message);
}


/**
* 修改用户用户角色
* @param requestRole 要修改的角色
* @return 封装好的修改成功消息
*/
@PostMapping("/api/admin/role")
public Result addRole(@RequestBody AdminRole requestRole) {
adminRoleService.editRole(requestRole);
return ResultFactory.buildSuccessResult("修改用户成功");
}
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
 * @return 封装好的用户
*/
@RequestMapping("/meeting/get/user_used")
public Result getAllMeetingByUsernameUsable(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdUsable(requestUser.getUsername()));
}

/**
* 取消活动
*
* @param meeting 要取消的活动
* @return 封装好的取消提示
*/
@RequestMapping("/meeting/cancel")
public Result cancelMeeting(@RequestBody Meeting meeting) {
Meeting meeting_s = meetingService.getById(meeting.getMeetingId());
meeting_s.setStatus(0);
meeting_s.setCanceledTime(meeting.getCanceledTime());
meeting_s.setCanceledReason(meeting.getCanceledReason());
meetingService.save(meeting_s);
return ResultFactory.buildSuccessResult("取消成功");
}

/**
* 查询用户取消的活动
*
* @param requestUser 要查询的用户
* @return 封装好的活动列表
*/
@RequestMapping("/meeting/get/user_cancel")
public Result getAllMeetingByUsernameCanceled(@RequestBody User requestUser) {
return ResultFactory.buildSuccessResult(meetingService.findAllByStuIdCancel(requestUser.getUsername()));
}

/**
* 查询用户超时活动
*
* @param requestUser 要查询的用户
* @return 封装好的查询结果
*/


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