大家好!我是程序猿老A,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
- 开发语言:Java
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/2301_76953549/89292507
论文目录
【如需全文请按文末获取联系】
一、项目简介
本系统为基于Java的小区物业管理系统,是采用计算机和网络技术进行开发的在线物业管理平台,可以实现在线缴费、在线投诉、公告查询等功能。本系统采用Java语言,数据库为Mysql,运行环境为Myeclipse。使用角色分为用户、管理员,本系统的功能包括用户信息管理、论坛管理、基础数据管理、公告管理、缴费管理、投诉信息管理、维修信息管理等。
二、系统设计
2.1软件功能模块设计
本基于Java的小区物业管理系统功能结构图如下图3-1所示:
2.2数据库设计
(1)管理员ER图包括的属性有管理员的编号、用户名和密码。管理员ER图如下图3-2所示:
(2)维修信息包含的属性为序号、编号、维修内容、报修时间等。维修信息ER图如下图3-3所示:
(3)用户信息的属性包括用户的个人资料,有姓名、性别、电话等。用户信息实体ER图如下图3-4所示:
(7)本基于Java的小区物业管理系统的整体实体关系图如下图3-6所示:
三、系统项目部分截图
3.1注册登陆功能
系统运行调试后,需要登录。登录界面设计的目的是保证当前的使用角色等级。管理员同样需要登录后才可以进行操作。在用户登录界面里加入了注册功能,在登录时只需要填写用户账号和密码、选择权限就可以实现。用户登录的运行界面如下图4-2所示:
3.2管理员功能的设计实现
个人中心管理功能的实现界面
个人中心管理的内容包括密码信息管理、个人信息管理。本系统中可以拥有多个管理员。个人信息管理功能的运行界面如下图4-5所示:
缴费信息管理功能的界面实现
管理员可以发布收费信息并查看用户的缴费详情。实现界面如下图4-9所示:
投诉管理功能的界面实现
管理员可以处理用户的投诉信息,可以回复用户的投诉。查询用户投诉功能的实现界面如下图4-10所示:
维修管理功能的实现界面
管理员可以查询用户的维修信息并安排维修和给出维修结果。实现界面如下图4-11所示:
3.3用户角色功能的界面实现
投诉功能的界面实现
用户可以在线填写投诉,也可以查询投诉的回复。在线投诉功能的实现界面如下图4-14所示:
缴费功能的界面实现
用户可以查询详细的费用详情,缴费功能的实现界面如下图4-15所示:
四、部分核心代码
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 缴费
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/jiaofei")
public class JiaofeiController {
private static final Logger logger = LoggerFactory.getLogger(JiaofeiController.class);
@Autowired
private JiaofeiService jiaofeiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = jiaofeiService.queryPage(params);
//字典表数据转换
List<JiaofeiView> list =(List<JiaofeiView>)page.getList();
for(JiaofeiView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiaofeiEntity jiaofei = jiaofeiService.selectById(id);
if(jiaofei !=null){
//entity转view
JiaofeiView view = new JiaofeiView();
BeanUtils.copyProperties( jiaofei , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(jiaofei.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiaofeiEntity jiaofei, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,jiaofei:{}",this.getClass().getName(),jiaofei.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
jiaofei.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<JiaofeiEntity> queryWrapper = new EntityWrapper<JiaofeiEntity>()
.eq("yonghu_id", jiaofei.getYonghuId())
.eq("jiaofei_name", jiaofei.getJiaofeiName())
.eq("jiaofei_types", jiaofei.getJiaofeiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiaofeiEntity jiaofeiEntity = jiaofeiService.selectOne(queryWrapper);
if(jiaofeiEntity==null){
jiaofei.setInsertTime(new Date());
jiaofei.setCreateTime(new Date());
jiaofeiService.insert(jiaofei);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiaofeiEntity jiaofei, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,jiaofei:{}",this.getClass().getName(),jiaofei.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// jiaofei.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<JiaofeiEntity> queryWrapper = new EntityWrapper<JiaofeiEntity>()
.notIn("id",jiaofei.getId())
.andNew()
.eq("yonghu_id", jiaofei.getYonghuId())
.eq("jiaofei_name", jiaofei.getJiaofeiName())
.eq("jiaofei_types", jiaofei.getJiaofeiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiaofeiEntity jiaofeiEntity = jiaofeiService.selectOne(queryWrapper);
if(jiaofeiEntity==null){
jiaofeiService.updateById(jiaofei);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
jiaofeiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<JiaofeiEntity> jiaofeiList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
JiaofeiEntity jiaofeiEntity = new JiaofeiEntity();
// jiaofeiEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// jiaofeiEntity.setJiaofeiName(data.get(0)); //缴费标题 要改的
// jiaofeiEntity.setJiaofeiTypes(Integer.valueOf(data.get(0))); //缴费类型 要改的
// jiaofeiEntity.setJiaofeiPrice(data.get(0)); //缴费金额 要改的
// jiaofeiEntity.setJiaofeiContent("");//照片
// jiaofeiEntity.setInsertTime(date);//时间
// jiaofeiEntity.setCreateTime(date);//时间
jiaofeiList.add(jiaofeiEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
jiaofeiService.insertBatch(jiaofeiList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = jiaofeiService.queryPage(params);
//字典表数据转换
List<JiaofeiView> list =(List<JiaofeiView>)page.getList();
for(JiaofeiView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
JiaofeiEntity jiaofei = jiaofeiService.selectById(id);
if(jiaofei !=null){
//entity转view
JiaofeiView view = new JiaofeiView();
BeanUtils.copyProperties( jiaofei , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(jiaofei.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiaofeiEntity jiaofei, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,jiaofei:{}",this.getClass().getName(),jiaofei.toString());
Wrapper<JiaofeiEntity> queryWrapper = new EntityWrapper<JiaofeiEntity>()
.eq("yonghu_id", jiaofei.getYonghuId())
.eq("jiaofei_name", jiaofei.getJiaofeiName())
.eq("jiaofei_types", jiaofei.getJiaofeiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
JiaofeiEntity jiaofeiEntity = jiaofeiService.selectOne(queryWrapper);
if(jiaofeiEntity==null){
jiaofei.setInsertTime(new Date());
jiaofei.setCreateTime(new Date());
jiaofeiService.insert(jiaofei);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微❤联系。