文章目录
- 小区物业管理系统
- 一、项目演示
- 二、项目介绍
- 三、部分功能截图
- 四、部分代码展示
- 五、底部获取项目源码(9.9¥带走)
小区物业管理系统
一、项目演示
小区物业管理系统
二、项目介绍
基于springboot+vue的前后端分离物业管理系统
系统角色:物业、业主
物业:首页、员工管理、角色管理、权限管理、栋数管理、单元管理、房屋列表、车位管理、业主管理、电费管理、水费管理、停车管理、投诉管理、维修管理、公告管理
业主:首页、投诉管理、缴费管理(我的电费、我的水费、我的停车费)、维修管理、公告管理
项目技术
语言:java
前端技术:Vue、Element-Plus
后端技术:SpringBoot、Mybatis-Plus
数据库:MySQL
三、部分功能截图
四、部分代码展示
package com.itmk.web.fee_park.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itmk.utils.ResultUtils;
import com.itmk.utils.ResultVo;
import com.itmk.web.fee_park.entity.FeePark;
import com.itmk.web.fee_park.entity.FeeParkParm;
import com.itmk.web.fee_park.service.FeeParkService;
import com.itmk.web.live_park.entity.LivePark;
import com.itmk.web.live_park.mapper.LiveParkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 停车费模块
*/
@RestController
@RequestMapping("/api/feePark")
public class FeeParkController {
@Autowired
private FeeParkService feeParkService;
@Resource
private LiveParkMapper liveParkMapper;
/**
* 我的停车费
*/
@GetMapping("/getMyParkFee")
public ResultVo getMyParkFee(FeeParkParm feeParkParm){
//构造分页对象
IPage<FeePark> page = new Page<>();
page.setCurrent(feeParkParm.getCurrentPage());
page.setSize(feeParkParm.getPageSize());
//查询条件
QueryWrapper<FeePark> query = new QueryWrapper<>();
query.lambda().eq(FeePark::getUserId,feeParkParm.getUserId());
IPage<FeePark> list = feeParkService.page(page, query);
return ResultUtils.success("查询成功",list);
}
/**
* 新增:
* 1.查询当前正在使用车位的用户
* 2.入库
*/
@PreAuthorize("hasAuthority('sys:feePark:add')")
@PostMapping
public ResultVo add(@RequestBody FeePark feePark){
//1.查询当前正在使用车位的租户
//构造查询条件
QueryWrapper<LivePark> query = new QueryWrapper<>();
query.lambda().eq(LivePark::getParkId,feePark.getParkId())
.eq(LivePark::getLiveStatue,"0");
LivePark livePark = liveParkMapper.selectOne(query);
if(livePark == null){
return ResultUtils.error("该车位暂无人员使用!");
}
feePark.setUserId(livePark.getUserId());
//2.入库
boolean save = feeParkService.save(feePark);
if(save){
return ResultUtils.success("新增停车费成功!");
}
return ResultUtils.error("新增停车费失败!");
}
/**
* 编辑:1.查询当前正在使用的用户
* 2.更新
*/
@PutMapping
@PreAuthorize("hasAuthority('sys:feePark:edit')")
public ResultVo edit(@RequestBody FeePark feePark){
//1.查询当前正在使用车位的租户
//构造查询条件
QueryWrapper<LivePark> query = new QueryWrapper<>();
query.lambda().eq(LivePark::getParkId,feePark.getParkId())
.eq(LivePark::getLiveStatue,"0");
LivePark livePark = liveParkMapper.selectOne(query);
if(livePark == null){
return ResultUtils.error("该车位暂无人员使用!");
}
feePark.setUserId(livePark.getUserId());
//2.更新
boolean b = feeParkService.updateById(feePark);
if(b){
return ResultUtils.success("编辑停车费成功!");
}
return ResultUtils.error("编辑停车费失败!");
}
/**
* 删除: 1.判断是否已经缴费,如果缴费,不能删除
* 2.删除
*/
@PreAuthorize("hasAuthority('sys:feePark:delete')")
@DeleteMapping("/{parkFeeId}")
public ResultVo delete(@PathVariable("parkFeeId") Long parkFeeId){
//1.判断是否已经缴费,根据id查询缴费状态
QueryWrapper<FeePark> query = new QueryWrapper<>();
query.lambda().eq(FeePark::getPayParkStatus,"1")
.eq(FeePark::getParkFeeId,parkFeeId);
FeePark one = feeParkService.getOne(query);
if(one != null){
return ResultUtils.error("已缴费,不能删除该数据!");
}
boolean b = feeParkService.removeById(parkFeeId);
if(b){
return ResultUtils.success("删除停车费成功!");
}
return ResultUtils.error("删除停车费失败!");
}
/**
* 缴费:
* 把当前这条数据的 payParkStatus 设为1
*/
@PostMapping("/pay")
public ResultVo pay(@RequestBody FeePark feePark){
//把状态设为1
feePark.setPayParkStatus("1");
boolean b = feeParkService.updateById(feePark);
if(b){
return ResultUtils.success("缴费成功!");
}
return ResultUtils.error("缴费失败!");
}
/**
* 列表
*/
@GetMapping("/list")
public ResultVo getList(FeeParkParm feeParkParm){
IPage<FeePark> list = feeParkService.getList(feeParkParm);
return ResultUtils.success("查询成功",list);
}
}
package com.itmk.web.fee_power.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itmk.utils.ResultUtils;
import com.itmk.utils.ResultVo;
import com.itmk.web.fee_park.entity.FeePark;
import com.itmk.web.fee_park.entity.FeeParkParm;
import com.itmk.web.fee_power.entity.FeePower;
import com.itmk.web.fee_power.entity.FeePowerParm;
import com.itmk.web.fee_power.service.FeePowerService;
import com.itmk.web.live_house.entity.LiveHouse;
import com.itmk.web.live_house.mapper.LiveHouseMapper;
import com.itmk.web.live_house.service.LiveHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 电费管理控制器
*/
@RestController
@RequestMapping("/api/feePower")
public class FeePowerController {
@Autowired
private FeePowerService feePowerService;
@Autowired
private LiveHouseService liveHouseService;
/**
* 我的电费
*/
@GetMapping("/getMyPowerFee")
public ResultVo getMyPowerFee(FeePowerParm feePowerParm){
//构造分页对象
IPage<FeePower> page = new Page<>();
page.setCurrent(feePowerParm.getCurrentPage());
page.setSize(feePowerParm.getPageSize());
//查询条件
QueryWrapper<FeePower> query = new QueryWrapper<>();
query.lambda().eq(FeePower::getUserId,feePowerParm.getUserId());
IPage<FeePower> list = feePowerService.page(page, query);
return ResultUtils.success("查询成功",list);
}
/**
* 新增
*/
@PostMapping
@PreAuthorize("hasAuthority('sys:feePower:add')")
public ResultVo add(@RequestBody FeePower feePower){
//根据房屋id查询正在使用该房间用户
QueryWrapper<LiveHouse> query = new QueryWrapper<>();
query.lambda().eq(LiveHouse::getHouseId,feePower.getHouseId())
.eq(LiveHouse::getUseStatus,"0");
LiveHouse house = liveHouseService.getOne(query);
if(house == null){
return ResultUtils.error("该房间没有人使用,不能添加电费!");
}
//把查询出来的用户id设置到电费实体里面
feePower.setUserId(house.getUserId());
feePowerService.saveFeePower(feePower);
return ResultUtils.success("新增电费成功!");
}
/**
* 编辑
*/
@PutMapping
@PreAuthorize("hasAuthority('sys:feePower:edit')")
public ResultVo edit(@RequestBody FeePower feePower){
//根据房屋id查询正在使用该房间用户
QueryWrapper<LiveHouse> query = new QueryWrapper<>();
query.lambda().eq(LiveHouse::getHouseId,feePower.getHouseId())
.eq(LiveHouse::getUseStatus,"0");
LiveHouse house = liveHouseService.getOne(query);
if(house == null){
return ResultUtils.error("该房间没有人使用,不能编辑电费!");
}
//把查询出来的用户id设置到电费实体里面
feePower.setUserId(house.getUserId());
feePowerService.updateFeePower(feePower);
return ResultUtils.success("编辑电费成功!");
}
/**
* 删除
*/
@PreAuthorize("hasAuthority('sys:feePower:delete')")
@DeleteMapping("/{powerId}")
public ResultVo delete(@PathVariable("powerId") Long powerId){
//如果已经缴费,就不能删除
QueryWrapper<FeePower> query = new QueryWrapper<>();
query.lambda().eq(FeePower::getPowerId,powerId).eq(FeePower::getPayPowerStatus,"1");
FeePower one = feePowerService.getOne(query);
if(one != null){
return ResultUtils.error("已缴费,不能删除!");
}
//删除操作
boolean b = feePowerService.removeById(powerId);
if(b){
return ResultUtils.success("删除电费成功!");
}
return ResultUtils.error("删除电费失败!");
}
/**
* 列表查询
*/
@GetMapping("/list")
public ResultVo getList(FeePowerParm parm){
IPage<FeePower> list = feePowerService.getList(parm);
return ResultUtils.success("查询成功",list);
}
/**
* 缴费
*/
@PostMapping("/payPower")
public ResultVo payPower(@RequestBody FeePower feePower){
boolean b = feePowerService.updateById(feePower);
if(b){
return ResultUtils.success("缴费成功!");
}
return ResultUtils.error("缴费失败!");
}
}
package com.itmk.web.house_unit.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itmk.utils.ResultUtils;
import com.itmk.utils.ResultVo;
import com.itmk.web.house_unit.entity.HouseUnit;
import com.itmk.web.house_unit.entity.HouseUnitParm;
import com.itmk.web.house_unit.service.HouseUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 房屋单元控制器
*/
@RestController
@RequestMapping("/api/houseUnit")
public class HouseUnitController {
@Autowired
private HouseUnitService houseUnitService;
/**
* 获取单元列表
*/
@GetMapping("/list")
public ResultVo getList(HouseUnitParm houseUnitParm){
IPage<HouseUnit> list = houseUnitService.getList(houseUnitParm);
return ResultUtils.success("查询成功",list);
}
/**
* 单元新增
* @return
*/
@PostMapping
@PreAuthorize("hasAuthority('sys:houseUnit:add')")
public ResultVo add(@RequestBody HouseUnit houseUnit){
boolean save = houseUnitService.save(houseUnit);
if(save){
return ResultUtils.success("新增单元成功!");
}
return ResultUtils.error("新增单元失败!");
}
/**
* 单元编辑
* @return
*/
@PutMapping
@PreAuthorize("hasAuthority('sys:houseUnit:edit')")
public ResultVo edit(@RequestBody HouseUnit houseUnit){
boolean save = houseUnitService.updateById(houseUnit);
if(save){
return ResultUtils.success("编辑单元成功!");
}
return ResultUtils.error("编辑单元失败!");
}
/**
* 删除单元
*/
@DeleteMapping("/{unitId}")
@PreAuthorize("hasAuthority('sys:houseUnit:delete')")
public ResultVo delete(@PathVariable("unitId") Long unitId){
boolean b = houseUnitService.removeById(unitId);
if(b){
return ResultUtils.success("删除成功");
}
return ResultUtils.error("删除失败!");
}
/**
* 根据栋数id查询单元列表
*/
@GetMapping("/getUnitListByBuildId")
public ResultVo getUnitListByBuildId(HouseUnit houseUnit){
//构造查询条件
QueryWrapper<HouseUnit> query = new QueryWrapper<>();
query.lambda().eq(HouseUnit::getBuildId,houseUnit.getBuildId());
List<HouseUnit> list = houseUnitService.list(query);
return ResultUtils.success("查询成功",list);
}
}
五、底部获取项目源码(9.9¥带走)
有问题,或者需要协助调试运行项目的也可以