基于javaweb+mysql的springboot物业管理系统(java+springboot+html+thymeleaf+layui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot物业管理系统(java+springboot+html+thymeleaf+layui+mysql)
项目介绍
主要功能包括:
前台:登录,房屋购买,车位购买,公告通知,出入登记,投诉服务,报修服务,关于我们
后台:楼宇管理,住房管理,车位管理,物业管理,抄表管理,纳税记录管理,住户管理,住户投诉,住户报修,系统管理,公告管理,出入记录,评价管理等
环境需要
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项目:是;
技术栈
后端:springboot(Spring+SpringMVC+Mybatis)
前端:HTML,jquery,Thymeleaf,Layui
使用说明
项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,控制台提示运行成功后再去运行前端项目; 5. 管理员用户名密码:admin/admin 普通用户名密码:user/123456
首页展示页面:
服务管理展示:
公告通知管理:
售楼情况:
后台管理住户保修:
抄表管理展示:
车位管理展示:
住户投诉管理:
住房管理列表:
User user = service.loginByPassword(phone,password);
if (user == null){
resBody.setCode(500);
resBody.setMsg("登录失败,请重新登录");
}else {
session.setAttribute("user",user);
resBody.setCode(200);
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/api/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
resBody.setCode(500);
resBody.setMsg("修改失败");
return resBody;
@GetMapping("/api/delRoom")
public ResBody delRoom(@RequestParam int id) {
ResBody resBody = new ResBody();
int i = service.delRoom(id);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("删除成功");
}else{
resBody.setCode(500);
resBody.setMsg("删除失败");
@Autowired
UserService service;
@GetMapping("/api/getUsers")
public ResBody getUsers(@RequestParam int page,
@RequestParam int limit) {
ResBody resBody = new ResBody();
int count = service.getCount();
List<User> list= service.getUsers(page, limit);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
ResBody resBody = new ResBody();
String email = params.get("email").toString();
String password = params.get("password").toString();
Admin admin = service.findAdmin(email,password);
if (admin == null){
resBody.setCode(500);
resBody.setMsg("登录失败,请重新登录");
}else {
session.setAttribute("admin",admin);
LOG.info(admin.toString());
resBody.setCode(200);
return resBody;
@PostMapping("/api/updateRoom")
public ResBody updateDanyuan(@RequestBody Room room) {
ResBody resBody = new ResBody();
int i = service.updateRoom(room);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("修改成功");
}else{
resBody.setCode(500);
resBody.setMsg("修改失败");
return resBody;
@GetMapping("/api/delRoom")
public ResBody delRoom(@RequestParam int id) {
}else{
resBody.setCode(500);
resBody.setMsg("停用失败");
return resBody;
@GetMapping("/api/findUser")
public ResBody findBuilding(@RequestParam int page,
@RequestParam int limit,
@RequestParam String name) {
ResBody resBody = new ResBody();
int count = service.getCount(name);
List<User> list= service.findUser(page, limit,name);
resBody.setCount(count);
resBody.setMsg("登录失败,请重新登录");
}else {
session.setAttribute("admin",admin);
LOG.info(admin.toString());
resBody.setCode(200);
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/admin/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
HttpSession session) {
ResBody resBody = new ResBody();
String newPsw = params.get("newPsw").toString();
Admin admin = (Admin) session.getAttribute("admin");
if (user == null){
resBody.setCode(500);
resBody.setMsg("登录失败,请重新登录");
}else {
session.setAttribute("user",user);
resBody.setCode(200);
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/api/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
HttpSession session) {
ResBody resBody = new ResBody();
String newPsw = params.get("newPsw").toString();
User user = (User) session.getAttribute("user");
LOG.info(admin.toString());
resBody.setCode(200);
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/admin/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
HttpSession session) {
ResBody resBody = new ResBody();
String newPsw = params.get("newPsw").toString();
Admin admin = (Admin) session.getAttribute("admin");
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/admin/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
HttpSession session) {
ResBody resBody = new ResBody();
String newPsw = params.get("newPsw").toString();
Admin admin = (Admin) session.getAttribute("admin");
admin.setPassword(newPsw);
int i = service.updatePass(admin.getId(),newPsw);
if (i != 1){
resBody.setCode(500);
resBody.setMsg("修改失败,后台出错");
resBody.setMsg("修改成功");
}else{
resBody.setCode(500);
resBody.setMsg("修改失败");
return resBody;
@GetMapping("/api/delRoom")
public ResBody delRoom(@RequestParam int id) {
ResBody resBody = new ResBody();
int i = service.delRoom(id);
if (i == 1){
resBody.setCode(200);
@GetMapping("/api/getUsers")
public ResBody getUsers(@RequestParam int page,
@RequestParam int limit) {
ResBody resBody = new ResBody();
int count = service.getCount();
List<User> list= service.getUsers(page, limit);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
return resBody;
@PostMapping("/api/addUser")
public ResBody addUser(@RequestBody User user) {
String newPsw = params.get("newPsw").toString();
User user = (User) session.getAttribute("user");
user.setPassword(newPsw);
int i = service.updatePass(user.getId(),newPsw);
if (i != 1){
resBody.setCode(500);
resBody.setMsg("修改失败,后台出错");
}else {
session.setAttribute("user",user);
resBody.setCode(200);
HttpSession session) {
ResBody resBody = new ResBody();
String newPsw = params.get("newPsw").toString();
User user = (User) session.getAttribute("user");
user.setPassword(newPsw);
int i = service.updatePass(user.getId(),newPsw);
if (i != 1){
resBody.setCode(500);
resBody.setMsg("修改失败,后台出错");
}else {
int i = service.addUser(user);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("添加成功");
}else{
resBody.setCode(500);
resBody.setMsg("添加失败");
return resBody;
@PostMapping("/api/updateUser")
public ResBody updateUser(@RequestBody User user) {
ResBody resBody = new ResBody();
resBody.setMsg("修改成功");
}else{
resBody.setCode(500);
resBody.setMsg("修改失败");
return resBody;
@GetMapping("/api/delRoom")
public ResBody delRoom(@RequestParam int id) {
ResBody resBody = new ResBody();
int i = service.delRoom(id);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("删除成功");
User user = service.loginByPassword(phone,password);
if (user == null){
resBody.setCode(500);
resBody.setMsg("登录失败,请重新登录");
}else {
session.setAttribute("user",user);
resBody.setCode(200);
resBody.setMsg("登录成功");
return resBody;
@PostMapping("/api/updatePass")
public ResBody updatePass(@RequestBody Map<String, Object> params,
HttpSession session) {
public class RoomController {
@Autowired
RoomService service;
@GetMapping("/api/getAllRooms")
public ResBody getAllRooms(@RequestParam int page,
@RequestParam int limit) {
ResBody resBody = new ResBody();
int count = service.getCount();
List<Room> list= service.getAllRooms(page, limit);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);