基于springboot的房屋租赁系统源码和论文
摘 要
房屋是人类生活栖息的重要场所,随着城市中的流动人口的增多,人们对房屋租赁需求越来越高,为满足用户查询房屋、预约看房、房屋租赁的需求,特开发了本基于Spring Boot的房屋租赁系统。
本文重点阐述了房屋租赁系统的开发过程,以实际运用为开发背景,基于Spring Boot框架,运用了Java技术和MYSQL数据库进行开发,充分保证系统的安全性和稳定性。本系统界面良好,操作简单方便,通过系统概述、系统分析、系统设计、数据库设计、系统测试这几个部分,详细的说明了系统的开发过程,最后并对整个开发过程进行了总结,实现了房屋租赁的功能。
本基于Spring Boot的房屋租赁系统运行效果稳定,操作方便、快捷,界面友好,是一个功能全面、实用性好、安全性高,并具有良好的可扩展性、可维护性的房屋租赁平台。
基于springboot的房屋租赁系统源码和论文028
关键词:房屋租赁,Java技术,MYSQL数据库,Spring Boot框架
演示视频:
基于springboot的房屋租赁系统源码和论文
Abstract
Housing is an important place for human life. With the increase of the floating population in the city, people’s demand for housing rental is getting higher and higher. Boot's housing rental system.
This article focuses on the development process of the housing rental system, taking actual application as the development background, based on the Spring Boot framework, using Java technology and MYSQL database for development, and fully ensuring the security and stability of the system. The system has a good interface, simple and convenient operation. Through the system overview, system analysis, system design, database design, system testing, the development process of the system is explained in detail. Finally, the whole development process is summarized and realized The function of house leasing.
The Spring Boot-based house leasing system has stable operation effect, convenient and fast operation, and friendly interface. It is a house leasing platform with comprehensive functions, good practicability, high safety, and good scalability and maintainability.
Key words:House rental, Java technology, MYSQL database, Spring Boot framework







































package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwuxinxiEntity;
import com.entity.view.FangwuxinxiView;
import com.service.FangwuxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 房屋信息
* 后端接口
* @author
* @email
* @date 2021-03-13 12:56:24
*/
@RestController
@RequestMapping("/fangwuxinxi")
public class FangwuxinxiController {
@Autowired
private FangwuxinxiService fangwuxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,FangwuxinxiEntity fangwuxinxi,
HttpServletRequest request){
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
PageUtils page = fangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
PageUtils page = fangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( FangwuxinxiEntity fangwuxinxi){
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( fangwuxinxi, "fangwuxinxi"));
return R.ok().put("data", fangwuxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(FangwuxinxiEntity fangwuxinxi){
EntityWrapper< FangwuxinxiEntity> ew = new EntityWrapper< FangwuxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( fangwuxinxi, "fangwuxinxi"));
FangwuxinxiView fangwuxinxiView = fangwuxinxiService.selectView(ew);
return R.ok("查询房屋信息成功").put("data", fangwuxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
fangwuxinxi.setClicknum(fangwuxinxi.getClicknum()+1);
fangwuxinxi.setClicktime(new Date());
fangwuxinxiService.updateById(fangwuxinxi);
return R.ok().put("data", fangwuxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
fangwuxinxi.setClicknum(fangwuxinxi.getClicknum()+1);
fangwuxinxi.setClicktime(new Date());
fangwuxinxiService.updateById(fangwuxinxi);
return R.ok().put("data", fangwuxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
fangwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(fangwuxinxi);
fangwuxinxiService.insert(fangwuxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
fangwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(fangwuxinxi);
fangwuxinxiService.insert(fangwuxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(fangwuxinxi);
fangwuxinxiService.updateById(fangwuxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
fangwuxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<FangwuxinxiEntity> wrapper = new EntityWrapper<FangwuxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = fangwuxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,FangwuxinxiEntity fangwuxinxi, HttpServletRequest request,String pre){
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = fangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuxinxi), params), params));
return R.ok().put("data", page);
}
}
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.KanfangshenqingEntity;
import com.entity.view.KanfangshenqingView;
import com.service.KanfangshenqingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 看房申请
* 后端接口
* @author
* @email
* @date 2021-03-13 12:56:24
*/
@RestController
@RequestMapping("/kanfangshenqing")
public class KanfangshenqingController {
@Autowired
private KanfangshenqingService kanfangshenqingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,KanfangshenqingEntity kanfangshenqing,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("zuke")) {
kanfangshenqing.setZhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<KanfangshenqingEntity> ew = new EntityWrapper<KanfangshenqingEntity>();
PageUtils page = kanfangshenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kanfangshenqing), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,KanfangshenqingEntity kanfangshenqing, HttpServletRequest request){
EntityWrapper<KanfangshenqingEntity> ew = new EntityWrapper<KanfangshenqingEntity>();
PageUtils page = kanfangshenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kanfangshenqing), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( KanfangshenqingEntity kanfangshenqing){
EntityWrapper<KanfangshenqingEntity> ew = new EntityWrapper<KanfangshenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( kanfangshenqing, "kanfangshenqing"));
return R.ok().put("data", kanfangshenqingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(KanfangshenqingEntity kanfangshenqing){
EntityWrapper< KanfangshenqingEntity> ew = new EntityWrapper< KanfangshenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( kanfangshenqing, "kanfangshenqing"));
KanfangshenqingView kanfangshenqingView = kanfangshenqingService.selectView(ew);
return R.ok("查询看房申请成功").put("data", kanfangshenqingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
KanfangshenqingEntity kanfangshenqing = kanfangshenqingService.selectById(id);
return R.ok().put("data", kanfangshenqing);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
KanfangshenqingEntity kanfangshenqing = kanfangshenqingService.selectById(id);
return R.ok().put("data", kanfangshenqing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody KanfangshenqingEntity kanfangshenqing, HttpServletRequest request){
kanfangshenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kanfangshenqing);
kanfangshenqingService.insert(kanfangshenqing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody KanfangshenqingEntity kanfangshenqing, HttpServletRequest request){
kanfangshenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kanfangshenqing);
kanfangshenqingService.insert(kanfangshenqing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody KanfangshenqingEntity kanfangshenqing, HttpServletRequest request){
//ValidatorUtils.validateEntity(kanfangshenqing);
kanfangshenqingService.updateById(kanfangshenqing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
kanfangshenqingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<KanfangshenqingEntity> wrapper = new EntityWrapper<KanfangshenqingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("zuke")) {
wrapper.eq("zhanghao", (String)request.getSession().getAttribute("username"));
}
int count = kanfangshenqingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)