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

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

250023512402

260023512402

270023512402

280023512402

290023512402

310023512402

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

项目介绍

很完美的一个小区物业管理系统源码,本项目包含管理员与普通用户两种角色。 包括房屋管理,车位管理,交费管理,社区服务等等功能

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  4.数据库:MySql 5.7版本; 5.是否Maven项目:是;

技术栈

springboot+mybatis+mysql+maven+thymeleaf

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,项目运行成功后在浏览器中访问: 管理员登录地址:http://localhost:8081/login 管理员账号密码:adminqq.com/123456 用户登录地址:http://localhost:8081/user/login 用户账号密码:17805052221/123456  

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
    @GetMapping("/ajax/getAllFreeRooms")
public ResBody getAllFreeRooms(@RequestParam int danyuan_id) {
ResBody resBody = new ResBody();
List<Room> list = service.getAllFreeRooms(danyuan_id);
resBody.setData(list);
resBody.setCode(0);
return resBody;
}
}
package com.example.demo.controller;



@RestController
public class GonggaoController {
@Autowired
GonggaoService service;

@GetMapping("/api/getAllGonggaos")
public ResBody getAllGonggaos(@RequestParam int page,
@RequestParam int limit) {
ResBody resBody = new ResBody();
int count = service.getCount();
List<Gonggao> list= service.getAllGonggaos(page, limit);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
return resBody;
}

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
package com.example.demo.controller;



@RestController
public class PaymentController {
@Autowired
PaymentService service;

@GetMapping("/api/getAllPayments")
public ResBody getAllPayments(@RequestParam int page,
@RequestParam int limit) {
ResBody resBody = new ResBody();
int count = service.getCount();
List<Payment> list= service.getAllPayments(page, limit);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
return resBody;
}

@PostMapping("/api/addPayment")
public ResBody addBuilding(@RequestBody Payment payment) {
ResBody resBody = new ResBody();
int i = service.addPayment(payment);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("添加成功");
}else{
resBody.setCode(500);
resBody.setMsg("添加失败");
}
return resBody;
}

@PostMapping("/api/updatePayment")
public ResBody updatePayment(@RequestBody Payment payment) {
ResBody resBody = new ResBody();
int i = service.updatePayment(payment);
if (i == 1){
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

@GetMapping("/api/delPayment")
public ResBody delPayment(@RequestParam int id) {
ResBody resBody = new ResBody();
int i = service.delPayment(id);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("删除成功");
}else{
resBody.setCode(500);
resBody.setMsg("删除失败");
}
return resBody;
}

@GetMapping("/api/findPayment")
public ResBody findPayment(@RequestParam int page,
@RequestParam int limit,
@RequestParam String name) {
ResBody resBody = new ResBody();
int count = service.getCount(name);
List<Payment> list= service.findPayment(page, limit,name);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
return resBody;
}

@GetMapping("/ajax/getAllPayments")
public ResBody getAllPayments() {
ResBody resBody = new ResBody();
List<Payment> list= service.getAllPayments();
resBody.setData(list);
resBody.setCode(0);
return resBody;
}
}
package com.example.demo.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
        gonggao.setUpdateBy(admin.getId());
int i = service.updateGonggao(gonggao);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("修改成功");
}else{
resBody.setCode(500);
resBody.setMsg("修改失败");
}
return resBody;
}

@GetMapping("/api/delGonggao")
public ResBody delBuilding(@RequestParam int id) {
ResBody resBody = new ResBody();
int i = service.delGonggao(id);
if (i == 1){
resBody.setCode(200);
resBody.setMsg("删除成功");
}else{
resBody.setCode(500);
resBody.setMsg("删除失败");
}
return resBody;
}

@GetMapping("/api/findGonggao")
public ResBody findBuilding(@RequestParam int page,
@RequestParam int limit,
@RequestParam String name) {
ResBody resBody = new ResBody();
int count = service.getCount(name);
List<Gonggao> list= service.findGonggao(page, limit,name);
resBody.setCount(count);
resBody.setData(list);
resBody.setCode(0);
return resBody;
}
}
package com.example.demo.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


@RestController
public class AdminController {
@Autowired
AdminService service;
private static final Logger LOG = LoggerFactory.getLogger(AdminController.class);

@PostMapping("/admin/loginByPassword")
public ResBody loginByPassword(@RequestBody Map<String, Object> params,
HttpSession session) {
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);
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("修改失败,后台出错");
}else {
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 "page/template/repair";
}

@GetMapping("/tousu")
public String tousu(){
return "page/template/tousu";
}

@GetMapping("/payment")
public String payment(){
return "page/template/payment";
}

@GetMapping("/car")
public String car(){
return "page/template/car";
}

@GetMapping("/user")
public String user(){
return "page/template/user";
}

@GetMapping("/user/login")
public String userlogin(){
return "page/system/login";
}

@GetMapping("/user/index")
public String userindex(){
return "page/system/index";
}

@GetMapping("/user/console")
public String userconsole(Model model,HttpSession session){
User user = (User) session.getAttribute("user");
Gonggao gonggao = gonggaoService.getGonggao();
int repairCount = repairService.getCount();
int tousuCount = tousuService.getCount();
int paymentCount = user_paymentService.getCount();
int userRepair = repairService.getCountByUserId(user.getId());
int userTousu = tousuService.getCountByUserId(user.getId());


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