java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,附源码+数据库,免费安装部署运行,包运行

本文主要是介绍java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,附源码+数据库,免费安装部署运行,包运行,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、项目介绍

java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,​ 系统分为前台用户界面和后台系统管理。

1.1 前台用户界面

  用户注册、用户登录、用户中心、浏览房源、房源搜索

  查看房源明细、发布房源、提交合同、新闻公告、留言交流

1.2 后台系统管理

  用户管理:用户列表、用户删除、用户查询

  新闻管理:新闻列表、添加新闻、修改新闻、删除新闻、查询新闻

  房屋管理:房屋列表、房屋删除、分页查看

  留言管理:留言列表、留言删除、留言查询、留言回复列表、回复查询

  租赁合同管理:合同列表、查看合同、删除合同

  管理员管理:管理员管理、新增管理员、编辑管理员、删除管理员等

2、技术框架

编程语言:Java

系统架构:B/S

前端框架:JSP、jQuery

后端框架:SSM(Spring、SpringMVC、MyBatis)

数据库:MySQL

Maven项目:否

运行环境:JDK8+MySQL5.6+Idea+Tomcat8.5

3、演示视频

java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,附源码+数据库,适合毕业设计、课程设计、大实验、实训

B站视频地址java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,附源码+数据库,适合毕业设计、课程设计、大实验、实训_哔哩哔哩_bilibili

4、项目截图

4.1、前台首页

4.2、用户注册

4.3、用户登录

4.4、新闻公告

4.5、房源分类

4.6、留言交流

4.7、用户中心

4.8、用户信息管理

4.9、修改密码

4.10、发布房源

4.11、我的房源

4.12、提交合同

4.13、我的合同

4.14、后台登录

4.15、后台-管理员管理

4.16、后台-用户管理

4.17、后台-新闻公告管理

4.18、后台-访问类型管理

4.19、后台-访问管理

4.20、后台-租赁合同管理

4.21、后台-留言交流管理

4.22、留言回复管理

6、代码示例

package com.action;import java.util.ArrayList;
import java.util.List;import javax.annotation.Resource;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;import com.entity.Article;
import com.entity.Bbs;
import com.entity.Cate;
import com.entity.Contract;
import com.entity.House;
import com.entity.Rebbs;
import com.entity.Users;
import com.service.ArticleService;
import com.service.BbsService;
import com.service.CateService;
import com.service.ContractService;
import com.service.HouseService;
import com.service.RebbsService;
import com.service.UsersService;
import com.util.VeDate;//定义为控制器
@Controller
// 设置路径
@RequestMapping("/index")
public class IndexAction extends BaseAction {@Autowired@Resourceprivate UsersService usersService;@Autowired@Resourceprivate ArticleService articleService;@Autowired@Resourceprivate CateService cateService;@Autowired@Resourceprivate HouseService houseService;@Autowired@Resourceprivate ContractService contractService;@Autowired@Resourceprivate BbsService bbsService;@Autowired@Resourceprivate RebbsService rebbsService;// 公共方法 提供公共查询数据private void front() {this.getRequest().setAttribute("cateList", this.cateService.getAllCate());this.getRequest().setAttribute("hotList", this.houseService.getHotHouse());this.getRequest().setAttribute("title", "房屋租赁系统");}// 首页显示@RequestMapping("index.action")public String index() {this.front();List<Article> articleList = this.articleService.getFrontArticle();this.getRequest().setAttribute("articleList", articleList);List<Cate> frontList = new ArrayList<Cate>();List<Cate> cateList = this.cateService.getFrontCate();for (Cate cate : cateList) {List<House> houseList = this.houseService.getFrontHouse(cate.getCateid());cate.setHouseList(houseList);frontList.add(cate);}this.getRequest().setAttribute("frontList", frontList);this.getRequest().setAttribute("newsList", this.houseService.getNewsHouse());return "users/index";}// 分类查询@RequestMapping("cate.action")public String cate(String id) {this.front();House house = new House();house.setStatus("待租");house.setCateid(id);List<House> houseList = this.houseService.getHouseByCond(house);this.getRequest().setAttribute("houseList", houseList);return "users/list";}// 模糊查询@RequestMapping("query.action")public String query() {this.front();String name = this.getRequest().getParameter("name");House house = new House();house.setStatus("待租");house.setHousename(name);List<House> houseList = this.houseService.getHouseByLike(house);this.getRequest().setAttribute("houseList", houseList);return "users/list";}// 全部查询@RequestMapping("all.action")public String all() {this.front();House house = new House();house.setStatus("待租");List<House> houseList = this.houseService.getHouseByCond(house);this.getRequest().setAttribute("houseList", houseList);return "users/list";}// 全部查询@RequestMapping("detail.action")public String detail(String id) {this.front();House house = this.houseService.getHouseById(id);house.setHits("" + (Integer.parseInt(house.getHits()) + 1));this.houseService.updateHouse(house);this.getRequest().setAttribute("house", house);return "users/detail";}// 公告@RequestMapping("article.action")public String article(String number) {this.front();List<Article> articleList = new ArrayList<Article>();List<Article> tempList = this.articleService.getAllArticle();int pageNumber = tempList.size();int maxPage = pageNumber;if (maxPage % 10 == 0) {maxPage = maxPage / 10;} else {maxPage = maxPage / 10 + 1;}if (number == null) {number = "0";}int start = Integer.parseInt(number) * 10;int over = (Integer.parseInt(number) + 1) * 10;int count = pageNumber - over;if (count <= 0) {over = pageNumber;}for (int i = start; i < over; i++) {Article x = tempList.get(i);articleList.add(x);}String html = "";StringBuffer buffer = new StringBuffer();buffer.append("&nbsp;&nbsp;共为");buffer.append(maxPage);buffer.append("页&nbsp; 共有");buffer.append(pageNumber);buffer.append("条&nbsp; 当前为第");buffer.append((Integer.parseInt(number) + 1));buffer.append("页 &nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("首页");} else {buffer.append("<a href=\"index/article.action?number=0\">首页</a>");}buffer.append("&nbsp;&nbsp;");if ((Integer.parseInt(number) + 1) == 1) {buffer.append("上一页");} else {buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("下一页");} else {buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");}buffer.append("&nbsp;&nbsp;");if (maxPage <= (Integer.parseInt(number) + 1)) {buffer.append("尾页");} else {buffer.append("<a href=\"index/article.action?number=" + (maxPage - 1) + "\">尾页</a>");}html = buffer.toString();this.getRequest().setAttribute("html", html);this.getRequest().setAttribute("articleList", articleList);return "users/article";}// 阅读公告@RequestMapping("read.action")public String read(String id) {this.front();Article article = this.articleService.getArticleById(id);article.setHits("" + (Integer.parseInt(article.getHits()) + 1));this.articleService.updateArticle(article);this.getRequest().setAttribute("article", article);return "users/read";}// 准备登录@RequestMapping("preLogin.action")public String prelogin() {this.front();return "users/login";}// 用户登录@RequestMapping("login.action")public String login() {this.front();String username = this.getRequest().getParameter("username");String password = this.getRequest().getParameter("password");Users u = new Users();u.setUsername(username);List<Users> usersList = this.usersService.getUsersByCond(u);if (usersList.size() == 0) {this.getSession().setAttribute("message", "用户名不存在");return "redirect:/index/preLogin.action";} else {Users users = usersList.get(0);if (password.equals(users.getPassword())) {this.getSession().setAttribute("userid", users.getUsersid());this.getSession().setAttribute("username", users.getUsername());this.getSession().setAttribute("users", users);return "redirect:/index/index.action";} else {this.getSession().setAttribute("message", "密码错误");return "redirect:/index/preLogin.action";}}}// 准备注册@RequestMapping("preReg.action")public String preReg() {this.front();return "users/register";}// 用户注册@RequestMapping("register.action")public String register(Users users) {this.front();Users u = new Users();u.setUsername(users.getUsername());List<Users> usersList = this.usersService.getUsersByCond(u);if (usersList.size() == 0) {users.setRegdate(VeDate.getStringDateShort());this.usersService.insertUsers(users);} else {this.getSession().setAttribute("message", "用户名已存在");return "redirect:/index/preReg.action";}return "redirect:/index/preLogin.action";}// 退出登录@RequestMapping("exit.action")public String exit() {this.front();this.getSession().removeAttribute("userid");this.getSession().removeAttribute("username");this.getSession().removeAttribute("users");return "index";}// 准备修改密码@RequestMapping("prePwd.action")public String prePwd() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}return "users/editpwd";}// 修改密码@RequestMapping("editpwd.action")public String editpwd() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");String password = this.getRequest().getParameter("password");String repassword = this.getRequest().getParameter("repassword");Users users = this.usersService.getUsersById(userid);if (password.equals(users.getPassword())) {users.setPassword(repassword);this.usersService.updateUsers(users);} else {this.getSession().setAttribute("message", "旧密码错误");return "redirect:/index/prePwd.action";}return "redirect:/index/prePwd.action";}@RequestMapping("usercenter.action")public String usercenter() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}return "users/usercenter";}@RequestMapping("userinfo.action")public String userinfo() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");this.getSession().setAttribute("users", this.usersService.getUsersById(userid));return "users/userinfo";}@RequestMapping("personal.action")public String personal(Users users) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.usersService.updateUsers(users);return "redirect:/index/userinfo.action";}// 留言板@RequestMapping("bbs.action")public String bbs() {this.front();List<Bbs> bbsList = this.bbsService.getAllBbs();this.getRequest().setAttribute("bbsList", bbsList);return "users/bbs";}// 发布留言@RequestMapping("addbbs.action")public String addbbs() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Bbs bbs = new Bbs();bbs.setAddtime(VeDate.getStringDate());bbs.setContents(getRequest().getParameter("contents"));bbs.setHits("0");bbs.setRepnum("0");bbs.setTitle(getRequest().getParameter("title"));bbs.setUsersid(userid);this.bbsService.insertBbs(bbs);return "redirect:/index/bbs.action";}// 查看留言@RequestMapping("readbbs.action")public String readbbs() {this.front();Bbs bbs = this.bbsService.getBbsById(getRequest().getParameter("id"));bbs.setHits("" + (Integer.parseInt(bbs.getHits()) + 1));this.bbsService.updateBbs(bbs);this.getRequest().setAttribute("bbs", bbs);Rebbs rebbs = new Rebbs();rebbs.setBbsid(bbs.getBbsid());List<Rebbs> rebbsList = this.rebbsService.getRebbsByCond(rebbs);this.getRequest().setAttribute("rebbsList", rebbsList);return "users/readbbs";}// 回复留言@RequestMapping("rebbs.action")public String rebbs() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Rebbs rebbs = new Rebbs();rebbs.setAddtime(VeDate.getStringDate());rebbs.setContents(getRequest().getParameter("contents"));rebbs.setBbsid(getRequest().getParameter("bbsid"));rebbs.setUsersid(userid);this.rebbsService.insertRebbs(rebbs);Bbs bbs = this.bbsService.getBbsById(rebbs.getBbsid());bbs.setRepnum("" + (Integer.parseInt(bbs.getRepnum()) + 1));this.bbsService.updateBbs(bbs);String path = "redirect:/index/readbbs.action?id=" + bbs.getBbsid();return path;}@RequestMapping("preHouse.action")public String preHouse() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}return "users/addHouse";}@RequestMapping("addHouse.action")public String addHouse(House house) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");house.setAddtime(VeDate.getStringDateShort());house.setHits("0");house.setUsersid(userid);house.setStatus("待租");this.houseService.insertHouse(house);return "redirect:/index/preHouse.action";}@RequestMapping("myHouse.action")public String myHouse() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");House house = new House();house.setUsersid(userid);List<House> houseList = this.houseService.getHouseByCond(house);this.getRequest().setAttribute("houseList", houseList);return "users/myHouse";}@RequestMapping("deleteHouse.action")public String deleteHouse(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.houseService.deleteHouse(id);return "redirect:/index/myHouse.action";}@RequestMapping("getHouseById.action")public String getHouseById(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}House house = this.houseService.getHouseById(id);this.getRequest().setAttribute("house", house);return "users/editHouse";}@RequestMapping("updateHouse.action")public String updateHouse(House house) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.houseService.updateHouse(house);return "redirect:/index/myHouse.action";}@RequestMapping("preContract.action")public String preContract() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}this.getRequest().setAttribute("cno", "C" + VeDate.getStringId());String userid = (String) this.getSession().getAttribute("userid");House house = new House();house.setUsersid(userid);house.setStatus("待租");List<House> houseList = this.houseService.getHouseByCond(house);this.getRequest().setAttribute("houseList", houseList);return "users/addContract";}@RequestMapping("addContract.action")public String addContract(Contract contract) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");contract.setAddtime(VeDate.getStringDateShort());contract.setStatus("未完成");contract.setUsersid(userid);this.contractService.insertContract(contract);House house = this.houseService.getHouseById(contract.getHouseid());house.setStatus("出租");this.houseService.updateHouse(house);return "redirect:/index/preContract.action";}@RequestMapping("myContract.action")public String myContract() {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}String userid = (String) this.getSession().getAttribute("userid");Contract contract = new Contract();contract.setUsersid(userid);List<Contract> contractList = this.contractService.getContractByCond(contract);this.getRequest().setAttribute("contractList", contractList);return "users/myContract";}@RequestMapping("over.action")public String over(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Contract contract = this.contractService.getContractById(id);contract.setStatus("完成");this.contractService.updateContract(contract);House house = this.houseService.getHouseById(contract.getHouseid());house.setStatus("待租");this.houseService.updateHouse(house);return "redirect:/index/myContract.action";}@RequestMapping("deleteContract.action")public String deleteContract(String id) {this.front();if (this.getSession().getAttribute("userid") == null) {return "redirect:/index/preLogin.action";}Contract contract = this.contractService.getContractById(id);House house = this.houseService.getHouseById(contract.getHouseid());house.setStatus("待租");this.houseService.updateHouse(house);this.contractService.deleteContract(id);return "redirect:/index/myContract.action";}}

这篇关于java基于ssm的房屋租赁管理系统、房屋出租管理系统、租房管理系统,附源码+数据库,免费安装部署运行,包运行的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/418439

相关文章

闲置电脑也能活出第二春?鲁大师AiNAS让你动动手指就能轻松部署

对于大多数人而言,在这个“数据爆炸”的时代或多或少都遇到过存储告急的情况,这使得“存储焦虑”不再是个别现象,而将会是随着软件的不断臃肿而越来越普遍的情况。从不少手机厂商都开始将存储上限提升至1TB可以见得,我们似乎正处在互联网信息飞速增长的阶段,对于存储的需求也将会不断扩大。对于苹果用户而言,这一问题愈发严峻,毕竟512GB和1TB版本的iPhone可不是人人都消费得起的,因此成熟的外置存储方案开

JVM 的类初始化机制

前言 当你在 Java 程序中new对象时,有没有考虑过 JVM 是如何把静态的字节码(byte code)转化为运行时对象的呢,这个问题看似简单,但清楚的同学相信也不会太多,这篇文章首先介绍 JVM 类初始化的机制,然后给出几个易出错的实例来分析,帮助大家更好理解这个知识点。 JVM 将字节码转化为运行时对象分为三个阶段,分别是:loading 、Linking、initialization

Spring Security 基于表达式的权限控制

前言 spring security 3.0已经可以使用spring el表达式来控制授权,允许在表达式中使用复杂的布尔逻辑来控制访问的权限。 常见的表达式 Spring Security可用表达式对象的基类是SecurityExpressionRoot。 表达式描述hasRole([role])用户拥有制定的角色时返回true (Spring security默认会带有ROLE_前缀),去

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

Spring Security--Architecture Overview

1 核心组件 这一节主要介绍一些在Spring Security中常见且核心的Java类,它们之间的依赖,构建起了整个框架。想要理解整个架构,最起码得对这些类眼熟。 1.1 SecurityContextHolder SecurityContextHolder用于存储安全上下文(security context)的信息。当前操作的用户是谁,该用户是否已经被认证,他拥有哪些角色权限…这些都被保

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

Java架构师知识体认识

源码分析 常用设计模式 Proxy代理模式Factory工厂模式Singleton单例模式Delegate委派模式Strategy策略模式Prototype原型模式Template模板模式 Spring5 beans 接口实例化代理Bean操作 Context Ioc容器设计原理及高级特性Aop设计原理Factorybean与Beanfactory Transaction 声明式事物

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7