基于javaweb的SpringBoot物业管理系统(java+springboot+maven+html+thymeleaf+layui+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

531424070701

541424070701

481424070701

491424070701

511424070701

521424070701

551424070701

561424070701

571424070701

基于javaweb的SpringBoot物业管理系统(java+springboot+maven+html+thymeleaf+layui+mysql)

项目介绍

主要功能包括:

前台:登录,房屋购买,车位购买,公告通知,出入登记,投诉服务,报修服务,关于我们

后台:楼宇管理,住房管理,车位管理,物业管理,抄表管理,纳税记录管理,住户管理,住户投诉,住户报修,系统管理,公告管理,出入记录,评价管理等

1
2
3
4
5
6
7
8
9
后台管理员
admin 123456

前台用户
张三 15566778899
李四 15566889966
张四 15988667744
牛头 19988774455
马面 18877556633

技术栈

后端:springboot(Spring+SpringMVC+Mybatis)

前端:HTML,jquery,Thymeleaf,Layui

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 model
* @return
*/
@RequestMapping("/webPage/toAccessPage")
public ModelAndView toWebAccessPage(ModelAndView model, Integer userId) {
model.addObject("userId", userId);
model.setViewName("/webPage/userAccess");
return model;
}

// | -------------------------------------------------------------------------------
// | 前台所有的页面跳转写这里 End
// | -------------------------------------------------------------------------------



// | -------------------------------------------------------------------------------
// | 后台所有的页面跳转写这里 Start
// | -------------------------------------------------------------------------------

/**
* 跳转到项目中所有icon图标的查看
* @return
*/
@RequestMapping("/findIcon")
public String toIconPage() {
return "error/unicode";
}

/**
* 跳转到楼宇管理
* @param model
* @return
*/
@GetMapping("/building/toBuildingPage")
public ModelAndView toBuildingPage(ModelAndView model) {
model.setViewName("adminPage/unitBuilding/unitBuildingPage");
return model;
}

/**
* 跳转到楼宇信息修改
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
        // 文件写入
file.transferTo(dest);
} catch (Exception e) {
e.printStackTrace();
return new ResultMessage(500, "出现异常:" + e.getMessage());
}
return new ResultMessage(0, "上传成功!", result);
}

// | -------------------------------------------------------------------------------
// | 前台所有的页面跳转写这里 Start
// | -------------------------------------------------------------------------------

/**
* 跳转首页
* @param modelAndView
* @return
*/
@GetMapping(value = {"/webPage/index", "/", "/index"})
public ModelAndView toIndex(ModelAndView modelAndView) {
List<Notice> noticeInfo = noticeService.selectDataByPage(null, 1, 4);
Integer noticeCount = noticeService.selectDataCount(null);
// 计算总页数
Integer pages = noticeCount % 4 == 0 ? noticeCount / 4 : noticeCount / 4 + 1;
List<Integer> pagesList = new ArrayList<>(16);
for (Integer i = 0; i < pages; i++) {
pagesList.add(i+1);
}
modelAndView.addObject("noticeInfo", noticeInfo);
modelAndView.addObject("pagesList", pagesList);
modelAndView.addObject("currPage", 1);
modelAndView.addObject("totalPage", pages);
modelAndView.setViewName("webPage/index");
return modelAndView;
}

/**
* 跳转首页
* @param modelAndView
* @return
*/
@GetMapping("/webPage/loginPage")
public ModelAndView toWebLoginPage(ModelAndView modelAndView) {
modelAndView.setViewName("webPage/webLogin");
return modelAndView;
}

/**
* 跳转我的报修页面
* @param modelAndView
* @return
*/
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
        }
}

/**
* 插入方法
* @param propertyPayVisit 插入的对象
* @return ResultMessage
*/
@PostMapping("/insertInfo")
public ResultMessage insertInfo(@RequestBody PropertyPayVisit propertyPayVisit) {
try {
// 执行更新方法
int result = propertyPayVisitService.insertSelective(propertyPayVisit);
if(result > 0) {
return new ResultMessage(0, "缴费成功!");
} else if(result == -500) {
return new ResultMessage(207, "操作失败!");
} else {
return new ResultMessage(207, "操作失败!请稍后重试!");
}
} catch(Exception e) {
return new ResultMessage(500, "操作出现异常:" + e.getMessage());
}
}
}



/**
* @Description 公告模块控制器
*/
@RestController
@RequestMapping("/accessVisit")
public class AccessVisitController {
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
@RestController
@RequestMapping("/userUnitRelation")
public class UserUnitRelationController {

/**
* 业务对象
*/
@Autowired
private UserUnitRelationService userUnitRelationService;

/**
* 条件 分页查询 适用于Layui数据表格
* @param userUnitRelation 查询条件
* @param page 当前页
* @param limit 每页显示的条数
* @return ResultMessage
*/
@GetMapping("/getDataByPage")
public ResultMessage getDataByPage(UserUnitRelation userUnitRelation, Integer page, Integer limit) {
// 查询数据
try {
List<UserUnitRelation> dataList = userUnitRelationService.selectDataByPage(userUnitRelation, page, limit);
Integer count = userUnitRelationService.selectDataCount(userUnitRelation);
if(dataList != null && dataList.size() > 0) {
return new ResultMessage(0, "查询成功!", dataList, count, limit);
} else {
return new ResultMessage(1, "暂无相关数据!");
}
} catch(Exception e) {
return new ResultMessage(1, "查询出现异常:" + e.getMessage());
}
}

/**
* 插入方法
* @param userUnitRelation 插入的对象
* @return ResultMessage
*/
@PostMapping("/insertInfo")
public ResultMessage insertInfo(@RequestBody UserUnitRelation userUnitRelation) {
try {
// 执行新增方法
int result = userUnitRelationService.insertSelective(userUnitRelation);
if(result > 0) {
return new ResultMessage(0, "操作成功!");
} else if(result == -500) {
return new ResultMessage(207, "操作失败!该成员已经在该房间!");
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
            int result = adminService.insertSelective(admin);
if(result > 0) {
return new ResultMessage(0, "操作成功!");
} else if(result == -500) {
return new ResultMessage(207, "操作失败!");
} else {
return new ResultMessage(207, "操作失败!请稍后重试!");
}
} catch(Exception e) {
return new ResultMessage(500, "操作出现异常:" + e.getMessage());
}
}

/**
* 删除方法
* @param id 要删除的ID
* @return ResultMessage
*/
@GetMapping("/deleteInfo")
public ResultMessage deleteInfo(Integer id) {
try {
// 执行更新方法
int result = adminService.deleteByPrimaryKey(id);
if(result > 0) {
return new ResultMessage(0, "操作成功!");
} else if(result == -500) {
return new ResultMessage(207, "操作失败!至少要剩下一个管理员!");
} else {
return new ResultMessage(207, "操作失败!请稍后重试!");
}
} catch(Exception e) {
return new ResultMessage(500, "操作出现异常:" + e.getMessage());
}
}
}



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
        // 执行方法
int result = propertyChargeVisitService.updateByPrimaryKeySelective(propertyChargeVisit);
if(result > 0) {
return new ResultMessage(0, "操作成功!");
} else {
return new ResultMessage(207, "操作失败!请稍后重试!");
}
} catch(Exception e) {
return new ResultMessage(500, "操作出现异常:" + e.getMessage());
}
}

/**
* 插入方法
* @param propertyChargeVisit 插入的对象
* @return ResultMessage
*/
@PostMapping("/insertInfo")
public ResultMessage insertInfo(@RequestBody PropertyChargeVisit propertyChargeVisit) {
try {
// 执行方法
int result = propertyChargeVisitService.insertSelective(propertyChargeVisit);
if(result > 0) {
// 向用户发送缴费邮件 根据用户名和手机号查询到该用户的信息
User user = new User();
user.setUserName(propertyChargeVisit.getUserName());
user.setPhone(propertyChargeVisit.getPhone());
User findResult = userService.selectLoginByParam(user);
System.out.println("发送邮件中...");
// 发送邮件
ArrayList<String> target = CollUtil.newArrayList(findResult.getEmail());
MailUtil.send(mailAccount, target, "小区物业",
"[小区物业] 业主您好,您本月需要缴纳的账单已结出,请及时到物业处缴纳,感谢配合!", true);
System.out.println("邮件已发送! ");
return new ResultMessage(0, "操作成功!");
} else {
return new ResultMessage(207, "操作失败!请稍后重试!");
}
} catch(Exception e) {
return new ResultMessage(500, "操作出现异常:" + e.getMessage());
}


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