基于javaweb的SpringBoot少年宫活动中心后台管理系统(java+springboot+thymeleaf+html+maven+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

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

功能说明

440123052402

450123052402

460123052402

470123052402

490123052402

500123052402

基于javaweb的SpringBoot少年宫活动中心后台管理系统(java+springboot+thymeleaf+html+maven+mysql)

项目介绍

本项目是少年儿童活动中心的选课系统,本选课系统是基于SpringBoot2.0 + Mybatis + Thymeleaf + Shiro 开发的后台管理系统,建立以Browser/Server 为结构模式、以数据库为后台核心应用、以服务为目的信息化办公平台。实现对课程安排、报名缴费、数据记录和处理、工作流程的信息化,提高工作效率和数据管理效率,并具备安全性、可升级、可扩展性

面向对象

  • 少年儿童活动中心学生家长:通过微信公众号进入系统,进行课程查询、选课支付等操作。具备基本手机使用水平。 * 少年儿童活动中心老师:通过web管理平台进行课程安排、调课退课、选课数据整理及历史数据维护等工作。具备基本计算机使用水平。

  • 少年儿童活动中心制定的其他用户:活动中心根据自身的业务需要,指定的其他用户。具备基本计算机使用水平。

技术选型

SpringBoot + Mybatis + Thymeleaf + Shiro + Easyexcel + EhCache

功能列表

  • 课程管理 管理活动中心的课程分类以及课程信息 - 教师管理 管理活动中心的授课教师信息 - 学员管理 和管理活动中心的学员信息 - 收费管理 查询学员课程的收费信息以及课程的收费报表 - 用户管理 管理后台系统用户,管理员身份可以进行修改、删除 - 角色管理 分配权限的最小单元,通过角色对用户分配权限 - 菜单管理 管理系统菜单,同时作为权限资源

  • 日志管理 记录登录用户的地址和时间,以及未授权越界操作的记录

快速部署

  • 环境与插件要求

  • Jdk8+ - Mysql5.5+ - Maven - Redis 3.2+

  • Lombok 重要

  • 导入项目

  • IntelliJ IDEA:Import Project -> Import Project from external model -> Maven

  • Eclipse:Import -> Exising Mavne Project

  • 准备数据

  • 创建数据库,将项目sng.sql文件导入到mysql数据库中

  • 修改配置

  • 修改项目资源目录,application-dev.yml文件的datasource配置和redis配置

  • 运行项目

  • 运行项目SngApplication.java - 访问地址:http://localhost:8090/

  • 默认帐号密码:admin/admin(其他账号密码在realpwd表中) 

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
47
48
}

/**
* 角色信息修改页面跳转
* @param roleId
* @return
*/
@RequiresPermissions(value = {"role:list","role:add"},logical = Logical.AND)
@RequestMapping(value = "/edit",method = RequestMethod.GET)
@ResponseBody
public RoleFind toEditRole(Integer roleId){
return this.roleService.findRole(roleId);
}

/**
* 角色信息修改
* @param role
* @param br
* @return
*/
@RequiresPermissions(value = {"role:list","role:add"},logical = Logical.AND)
@RequestMapping(value = "/edit",method = RequestMethod.POST)
@ResponseBody
public String editRole(@Valid RoleParam role, BindingResult br){
ValidationUtil.validateData(br);
this.roleService.editRole(role);
return "success";
}

/**
* 角色信息删除
* @param id
* @return
*/
@RequiresPermissions(value = {"role:list","role:add"},logical = Logical.AND)
@RequestMapping(value = "/remove",method = RequestMethod.POST)
@ResponseBody
public String removeRole(Integer id){
return this.roleService.removeRole(id)?"success":"fail";
}

/**
* 角色信息恢复
* @param id
* @return
*/
@RequiresPermissions(value = {"role:list","role:add"},logical = Logical.AND)
@RequestMapping(value = "/recover",method = RequestMethod.POST)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
            String fileName = URLEncoder.encode("学生信息表", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
outputStream = response.getOutputStream();
EasyExcel.write(outputStream, StuInfo.class).sheet("学生信息表").doWrite(this.stuService.findStuInfo(Arrays.asList(stuIds)));
} finally {
try {
//关闭流
if (outputStream != null) {
outputStream.flush();
outputStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}


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
 * @param chargeParam
* @param br
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
public String addCharge(@Valid ChargeParam chargeParam, BindingResult br) {
ValidationUtil.validateData(br);
this.chargeService.addCharge(chargeParam);
return "success";
}

/**
* 缴费信息删除
* @param id
* @return
*/
@RequiresPermissions(value = {"charge:list","charge:add"},logical = Logical.AND)
@RequestMapping(value = "/remove", method = RequestMethod.POST)
@ResponseBody
public String removeCharge(Integer id) {
return this.chargeService.removeCharge(id) ? "success" : "fail";
}

/**
* 缴费信息恢复
* @param id
* @return
*/
@RequiresRoles("0")
@RequiresPermissions(value = {"charge:list","charge:add"},logical = Logical.AND)
@RequestMapping(value = "/recover", method = RequestMethod.POST)
@ResponseBody
public String recoverCharge(Integer id) {
return this.chargeService.recoverCharge(id) ? "success" : "fail";
}

/**
* 缴费信息批量删除
* @param ids
* @return
*/
@RequiresPermissions(value = {"charge:list","charge:add"},logical = Logical.AND)
@RequestMapping(value = "/removes", method = RequestMethod.POST)
@ResponseBody
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
                UserFind u = (UserFind)SecurityUtils.getSubject().getPrincipal();
u.setUserPassword(encryptedData.getEncryptedPwd());
u.setSalt(encryptedData.getSalt());
return "success";
}
model.addAttribute("msg","两次输入密码不一致");
}else {
model.addAttribute("msg","新密码与原密码一致");
}
} else {
model.addAttribute("msg","原密码输入不正确");
}
return "user/editPwd";
}

/**
* 用户信息删除
* @param id
* @return
*/
@RequiresRoles("0")
@RequiresPermissions("user:list")
@RequestMapping(value = "/remove",method = RequestMethod.POST)
@ResponseBody
public String removeUser(Integer id){
return this.userService.removeUser(id)?"success":"fail";
}

/**
* 用户信息恢复
* @param id
* @return
*/
@RequiresRoles("0")
@RequiresPermissions("user:list")
@RequestMapping(value = "/recover",method = RequestMethod.POST)
@ResponseBody
public String recoverUser(Integer id){
return this.userService.recoverUser(id)?"success":"fail";
}

/**
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
47
48
49
50
51
52
53
54

/**
* 登录页面跳转
* @return
*/
@RequestMapping(value = "/login",method = RequestMethod.GET)
public String toLogin(){
return "login";
}

/**
* 注册页面跳转
* @return
*/
@RequestMapping(value = "/register",method = RequestMethod.GET)
public String toRegister(){
return "register";
}

/**
* 验证码显示
* @param response
* @param session
*/
@RequestMapping("/captcha")
@SuppressWarnings("static-access")
public void captcha(HttpServletResponse response, HttpSession session) {
//获取验证码对象
VerifyCode vc = new VerifyCode();
//获取图片
BufferedImage img = vc.getImage();
//获取文字
String text = vc.getText();
//保存文字到session
session.setAttribute("code", text);
//输出图片
try {
VerifyCode.output(img, response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}

/**
* 登录验证
* @param user
* @param captcha
* @param session
* @param model
* @return
*/
@RequestMapping(value = "/login",method = RequestMethod.POST)
public String login(UserParam user, String captcha, HttpSession session, Model model){
Subject subject = SecurityUtils.getSubject();
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
47
48
49
50

/**
* 菜单消息删除
* @param id
* @return
*/
@RequiresPermissions(value = {"menu:list","menu:add"},logical = Logical.AND)
@RequestMapping(value = "/remove",method = RequestMethod.POST)
@ResponseBody
public String removeMenu(Integer id){
return this.menuService.removeMenu(id)?"success":"fail";
}

/**
* 菜单信息恢复
* @param id
* @return
*/
@RequiresPermissions(value = {"menu:list","menu:add"},logical = Logical.AND)
@RequestMapping(value = "/recover",method = RequestMethod.POST)
@ResponseBody
public String recoverMenu(Integer id){
return this.menuService.recoverMenu(id)?"success":"fail";
}

/**
* 菜单信息批量删除
* @param ids
* @return
*/
@RequiresPermissions(value = {"menu:list","menu:add"},logical = Logical.AND)
@RequestMapping(value = "/removes",method = RequestMethod.POST)
@ResponseBody
public String removeMenus(Integer[] ids){
return this.menuService.batchRemoveMenus(Arrays.asList(ids))?"success":"fail";
}

/**
* 菜单信息批量恢复
* @param ids
* @return
*/
@RequiresPermissions(value = {"menu:list","menu:add"},logical = Logical.AND)
@RequestMapping(value = "/recovers",method = RequestMethod.POST)
@ResponseBody
public String recoverMenus(Integer[] ids){
return this.menuService.batchRecoverMenus(Arrays.asList(ids))?"success":"fail";
}

}


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