基于javaweb的共享自习室管理系统(java+springboot+thymeleaf+html+mysql)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+SpringBoot的共享自习室管理系统(java+SpringBoot+Thymeleaf+html+maven+mysql)
项目介绍
项目主要功能包括: 数据分析:柱状图分析、折线图分析、统计数据等,每10秒自动刷新 用户管理:用户信息管理、用户投诉管理、投诉反馈信息、黑名单管理; 座位管理:实时座位管理、座位使用预约记录,由管理员进行用户的座位预约操作; 密码管理:重置密码;
环境需要
1.运行环境:最好是java jdk 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 8.0版本;
7.是否maven项目:是;
技术栈
-
后端:SpringBoot+Mybatis
-
前端:Thymeleaf+HTML+CSS+LayUI+bootstrap
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/index.html 登录 管理员:zfx1232 密码:123456
用户管理控制器:
/**
- 用户管理控制器
*/
@RequestMapping(“/user/”)
@Controller
public class UserController {
@Autowired
private IUserService userService;
@Autowired
private IRoleService roleService;
@Resource
private ProcessEngineConfiguration configuration;
@Resource
private ProcessEngine engine;
@GetMapping(“/index”)
@ApiOperation(“跳转用户页接口”)
@PreAuthorize(“hasRole(‘管理员’)”)
public String index(String menuid,Model model){
List roles = queryAllRole();
model.addAttribute(“roles”,roles);
model.addAttribute(“menuid”,menuid);
//用户首页
return “views/user/user_list”;
@GetMapping(“/listpage”)
@ApiOperation(“查询用户分页数据接口”)
@ApiImplicitParams({
@ApiImplicitParam(name = “UserQuery”, value = “用户查询对象”, defaultValue = “userQuery对象”)
})
@ResponseBody
@PreAuthorize(“hasRole(‘管理员’)”)
public PageList listpage(UserQuery userQuery){
return userService.listpage(userQuery);
//添加用户
@PostMapping(“/addUser”)
@ApiOperation(“添加用户接口”)
@ResponseBody
public Map<String,Object> addUser(User user){
Map<String, Object> ret = new HashMap<>();
ret.put(“code”,-1);
if(StringUtils.isEmpty(user.getUsername())){
ret.put(“msg”,“请填写用户名”);
return ret;
if(StringUtils.isEmpty(user.getPassword())){
ret.put(“msg”,“请填写密码”);
return ret;
if(StringUtils.isEmpty(user.getEmail())){
ret.put(“msg”,“请填写邮箱”);
return ret;
if(StringUtils.isEmpty(user.getTel())){
ret.put(“msg”,“请填写手机号”);
return ret;
if(StringUtils.isEmpty(user.getHeadImg())){
ret.put(“msg”,“请上传头像”);
return ret;
if(userService.addUser(user)<=0) {
ret.put(“msg”, “添加用户失败”);
return ret;
ret.put(“code”,0);
ret.put(“msg”,“添加用户成功”);
return ret;
/**
-
修改用户信息操作
-
@param user
-
@return
*/
@PostMapping(“/editSaveUser”)
@ApiOperation(“修改用户接口”)
@PreAuthorize(“hasRole(‘管理员’)”)
@ResponseBody
public Message editSaveUser(User user){
if(StringUtils.isEmpty(user.getUsername())){
return Message.error(“请填写用户名”);
if(StringUtils.isEmpty(user.getEmail())){
return Message.error(“请填写邮箱”);
if(StringUtils.isEmpty(user.getTel())){ <