32基于java的小区物业管理系统或智慧社区管理系统

发布时间 2023-05-08 15:56:03作者: projecthelp

本章节给大家介绍一个基于java的小区物业管理系统或智慧社区管理系统,可用于小区物业的管理系统,或者智慧社区的管理系统。

系统概要

随着科学技术的飞速发展,计算机技术已延伸倒我们日常生活的各个方面。在工业、农业、商业等方面起着巨大的作用。计算机已成为我们日常生活中不可或缺的一部分了。计算机的广泛应用对提高经济效益、实现管理现代化、科学化、智能化起到了重要作用,并且取得了显著的效果。
小区管理系统是针对当前兴起的住宅小区而开发的管理软件。它能够提高对小区的智能化管理,能够把大量的工作人员从繁重的手工工作中解脱出来,提高小区管理工作的工作效率并减少错误的发生。
系统功能为说明:系统具有俩个用户角色,分别为管理员角色和普通业务角色;

管理员角色:

  • 房屋管理(包括有楼栋管理,单元管理以及房屋管理)
  • 车位管理
  • 缴费管理(默认缴费类型有水电, 煤气, 物业和停车费缴费项目,这些类型可以自由的修改删除或增加)
  • 社区服务(包括有公告管理,维修管理和业主投诉管理)
  • 用户管理
  • 个人中心等等

普通业主角色

  • 用户注册登录
  • 我的投诉管理
  • 我的维修管理
  • 我的账单
  • 个人中心
  • 修改密码等等

系统使用的架构和内容获取

采用B/S的架构实现,整体遵循MVC的设计思想。

> 开发系统:Windows
> 架构模式:MVC/前后端分离
> JDK版本:Java JDK1.8
> 开发工具:idea或者eclipse
> 数据库版本: mysql
> 数据库可视化工具: navicat
> 后端:java,spring,springmvc,mybatis,tomcat等
> 前端:html,css,javascript,jquery等
> 详情可点击查看:http://projecthelp.top

项目实现

所有的代码文件都有详细的注释,不用担心看不懂代码的。

  • 项目配置文件
###ThymeLeaf配置
server:
  tomcat:
    uri-encoding: UTF-8
  port: 8080

spring:
  devtools:
    restart:
      enabled: true # 配置热部署
      additional-paths: src/main/java
      exclude: WEB-INF/**
  thymeleaf:
    #模板的模式,支持 HTML, XML TEXT JAVASCRIPT
    mode: HTML5
    #编码 可不用配置
    encoding: UTF-8
    #开发配置为false,避免修改模板还要重启服务器
    cache: false
    #配置模板路径,默认是templates,可以不用配置
    prefix: classpath:/templates/
  datasource:
    url: jdbc:mysql://localhost:3306/xxxx?charset=utf8mb4&useSSL=false&serverTimezone=UTC
    username: root
    password: 修改成你的数据库密码
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: SELECT 1 FROM DUAL
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
    #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
    filters: stat,wall
    maxPoolPreparedStatementPerConnectionSize: 20
    useGlobalDataSourceStat: true
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
  • 管理员登录 AdminController
@RestController
public class AdminController {
    @Autowired
    AdminService service;
    private static final Logger LOG = LoggerFactory.getLogger(AdminController.class);

    /**
     * 管理员登录接口
     * @param params 参数(email,password)
     * @param session session会话
     * @return
     */
    @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;
    }

    /**
     * 更新密码
     * @param params 参数
     * @param session session会话
     * @return
     */
    @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 {
            session.setAttribute("admin",admin);
            LOG.info(admin.toString());
            resBody.setCode(200);
            resBody.setMsg("修改成功");
        }
        return resBody;
    }
}
  • 车辆管理信息的 CarController
@RestController
public class CarController {
    @Autowired
    CarService service;

    /**
     * 获取所有的车辆信息
     * @param page 页码
     * @param limit 每页的数量
     * @return
     */
    @GetMapping("/api/getAllCars")
    public ResBody getAllCars(@RequestParam int page,
                                   @RequestParam int limit) {
        ResBody resBody = new ResBody();
        int count = service.getCount();
        List<Car> list= service.getAllCars(page, limit);
        resBody.setCount(count);
        resBody.setData(list);
        resBody.setCode(0);
        return resBody;
    }

    /**
     * 增加car
     * @param car 车辆信息
     * @return
     */
    @PostMapping("/api/addCar")
    public ResBody addBuilding(@RequestBody Car car) {
        ResBody resBody = new ResBody();
        int i = service.addCar(car);
        if (i == 1){
            resBody.setCode(200);
            resBody.setMsg("添加成功");
        }else{
            resBody.setCode(500);
            resBody.setMsg("添加失败");
        }
        return resBody;
    }

    /**
     * 更新车辆信息
     * @param car 车辆信息
     * @return
     */
    @PostMapping("/api/updateCar")
    public ResBody updateCar(@RequestBody Car car) {
        ResBody resBody = new ResBody();
        int i = service.updateCar(car);
        if (i == 1){
            resBody.setCode(200);
            resBody.setMsg("修改成功");
        }else{
            resBody.setCode(500);
            resBody.setMsg("修改失败");
        }
        return resBody;
    }

    /**
     * 根据车辆的id删除车辆
     * @param id 车辆的id编号
     * @return
     */
    @GetMapping("/api/delCar")
    public ResBody delCar(@RequestParam int id) {
        ResBody resBody = new ResBody();
        int i = service.delCar(id);
        if (i == 1){
            resBody.setCode(200);
            resBody.setMsg("删除成功");
        }else{
            resBody.setCode(500);
            resBody.setMsg("删除失败");
        }
        return resBody;
    }

    /**
     * 根据条件查询车辆的信息列表
     * @param page 页码
     * @param limit 每页的数量
     * @param name 查询的车辆名称
     * @return
     */
    @GetMapping("/api/findCar")
    public ResBody findCar(@RequestParam int page,
                                @RequestParam int limit,
                                @RequestParam String name) {
        ResBody resBody = new ResBody();
        int count = service.getCount(name);
        List<Car> list= service.findCar(page, limit,name);
        resBody.setCount(count);
        resBody.setData(list);
        resBody.setCode(0);
        return resBody;
    }

    @GetMapping("/ajax/getAllFreeCars")
    public ResBody getAllDanyuans(@RequestParam int type) {
        ResBody resBody = new ResBody();
        List<Car> list= service.getAllFreeCars(type);
        resBody.setData(list);
        resBody.setCode(0);
        return resBody;
    }
}

部分功能展示

管理员角色

管理员登录

在这里插入图片描述

管理员首页

在这里插入图片描述

楼栋管理

在这里插入图片描述

单元管理

在这里插入图片描述

车辆管理

在这里插入图片描述

缴费管理

在这里插入图片描述

维修管理

在这里插入图片描述

投诉管理

在这里插入图片描述

用户管理

在这里插入图片描述

个人中心

在这里插入图片描述

普通用户,业主角色

登录

在这里插入图片描述

首页

在这里插入图片描述
普通角色可以新增投诉,新增维修,缴费等等功能,具体功能可参照管理员,更多详细功能大家可以下载下来学习哦。