项目介绍
随着时代的发展,房屋成为当下很多人关心的一个问题。因为很多人是到别的城市求学或者工作,而且当下的购房的成本及较高,所以很多人开始了租房,为了让租房交易变得更加的方便我们通过Java语言和MySQL开发了本次的基于Spring Boot的房产中介系统。
本系统从用户的角度出发,结合当前的环境而开发的,在开发语言上是使用的Java语言,在框架上我们是使用的Spring Boot框架,数据库方面使用的是MySQL数据库,开发工具为IDEA。
基于Spring Boot的房产中介系统根据实际情况分为前后台两部分,前台部分主要是让用户使用的,包括用户的首页,注册登录,新房信息,房屋供求,公告信息,后台管理,在线咨询,个人中心等功能;后台部分主要给管理员使用的,主要功能包括系统首页,个人中心,用户管理,房屋类型管理,新房信息管理,用户留言管理,房屋供求管理,系统管理,等功能。通过这些功能基本可以满足房产中介的需求。
房产中介系统是一种基于互联网技术的房地产交易平台,通过信息的共享、在线交易等方式,为房产买卖双方提供便捷、高效、安全的交易服务。作为房地产行业的一种新型交易模式,房产中介系统具有以下意义。
传统的房地产交易方式中,买卖双方需要花费大量时间和精力,与多个中介机构或个人进行沟通、洽谈,并完成众多的繁琐手续,整个交易流程繁琐且周期较长。而房产中介系统通过利用互联网平台实现了线上交易环境,加快了交易速度,节省了双方的时间和资源成本,有效提高了交易的效率。
房产中介系统通过建立统一的房地产信息库,实现了房屋信息的全面共享和透明化,方便消费者随时查询房产信息,对比价格和房产质量等指标。同时,房产中介系统能够让相关机构及时将改变公示在网上以进一步展现信息透明性。
传统的房地产交易中,买卖双方的信息存在不对称现象,使得消费者难以获取到准确的房产信息。而房产中介系统通过建立信息平台,实现了交易相关信息的共享和传递,消除了信息不对称的问题,让消费者能够更有效地获得所需的房产信息。
房产中介系统不仅提供线上交易服务,更采用一系列规范化手段来完成交易过程。例如,房产中介系统需要证明房产的真实性、属权情况、房产抵押情况及其他相关标准,为买卖双方建立起一个安全、透明和可信赖的交易环境,进一步促进房地产市场的规范化程度。
技术介绍
环境需要
1.运行环境:最好是java jdk 1.8,这是目前最稳定的JDK也是被使用最多的JDK版本。
2.IDE环境:IDEA,Eclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat7/Tomcat8/Tomcat9版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:是;
技术栈 135
后端:Spring+SpringMVC+Mybatis+SSM/Springboot
前端:vue+CSS+JavaScript+jQuery+elementui
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置,然后运行;
运行成功后,在浏览器中输入:http://localhost:8080/项目名
项目界面
基于Spring Boot的房产中介系统根据实际情况分为前后台两部分,前台部分主要是让用户使用的,包括用户的首页,注册登录,新房信息,房屋供求,公告信息,后台管理,在线咨询,个人中心等功能;后台部分主要给管理员使用的,主要功能包括系统首页,个人中心,用户管理,房屋类型管理,新房信息管理,用户留言管理,房屋供求管理,系统管理,等功能。通过这些功能基本可以满足房产中介的需求。
关键代码
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
目录
目 录
目 录 III
1 绪论 1
1.1 研究背景 1
1.2 目的和意义 1
1.3 论文结构安排 2
2 相关技术 3
2.1 SSM框架介绍 3
2.2 B/S结构介绍 3
2.3 Mysql数据库介绍 4
3 系统分析 6
3.1 系统可行性分析 6
3.1.1 技术可行性分析 6
3.1.2 经济可行性分析 6
3.1.3 运行可行性分析 6
3.2 系统性能分析 7
3.2.1 易用性指标 7
3.2.2 可扩展性指标 7
3.2.3 健壮性指标 7
3.2.4 安全性指标 8
3.3 系统流程分析 8
3.3.1 操作流程分析 8
3.3.2 登录流程分析 9
3.3.3 信息添加流程分析 10
3.3.4 信息删除流程分析 11
4 系统设计 12
4.1 系统概要设计 12
4.2 系统功能结构设计 12
4.3 数据库设计 13
4.3.1 数据库E-R图设计 13
4.3.2 数据库表结构设计 14
5 系统实现 17
5.1用户部分功能17
5.2 管理员部分功能展示
6 系统测试
6.1 系统测试的特点
6.2 系统功能测试
6.2.1 登录功能测试
6.2.2 添加类别功能测试
6.3 测试结果分析
结 论
致 谢
参考文献