今天介绍一个SpringBoot+Vue的房屋租赁系统。

主要功能

  • 租房网站页
  • 后台管理页面
  • 用户登录注册功能
  • 普通用户申请成为房东的功能
  • 房东用户上传个人房源功能
  • 管理员通过后台页面管理所有用户账号
  • 管理员审核申请房东身份的记录
  • 管理员审核房东上传的房源信息
  • 房源搜索、展示

部分代码展示

@RestController
public class HouseController {@Resourceprivate HouseDao houseDao;@Resourceprivate HousePicService housePicService;@Resourceprivate OwnerRecordService ownerRecordService;@RequestMapping("/addHouseUpRecord")public String addHouseUpRecord(@RequestParam("houseUpForm") String houseUpForm) {HouseInfo houseInfo = JSONObject.parseObject(houseUpForm,HouseInfo.class);//将房屋户型数组,房屋地区代码数组,配套设施列表数组 转化为string类型String houseTypeJson = JSON.toJSONString(houseInfo.getHouseType());String houseIDJson = JSON.toJSONString(houseInfo.getHouseID());String checkListJson = JSON.toJSONString(houseInfo.getCheckList());//创建一个长度为五的数组存放图片String[] houpicStr = {"","","","",""};for (int i = 0; i < houseInfo.getHousePic().length ; i++) {houpicStr[i] = houseInfo.getHousePic()[i];}HousePic housePic = new HousePic(houpicStr[0],houpicStr[1],houpicStr[2],houpicStr[3],houpicStr[4]);//存图片数组,hpicid存在housePic对象中int addHousePic = housePicService.addHousePic(housePic);if (addHousePic < 1){return "fail";}House house = new House(houseInfo.getAccount(),houseTypeJson,houseIDJson,houseInfo.getRentType(),houseInfo.getRentArea(),houseInfo.getFloor(),houseInfo.getAddressDetail(),checkListJson,houseInfo.getMonthRent(),houseInfo.getDescription(),housePic.getHpicid());//int addhouid = houseDao.addHouseUpRecord(houseInfo.getAccount(),houseTypeJson,houseIDJson,houseInfo.getRentType(),houseInfo.getRentArea(),houseInfo.getFloor(),houseInfo.getAddressDetail(),checkListJson,houseInfo.getMonthRent(),houseInfo.getDescription(),hpicid);//存申请总记录int addHouseUpRecord = houseDao.addHouseUpRecord(house);if(addHouseUpRecord < 1){return "fail";}//更新对应房屋表中的房屋图片数组对应行记录中 houidint end = housePicService.setHouid(house.getHouid(),housePic.getHpicid());//System.out.println(housePic.getHpicid());//        System.out.println(houseTypeJson);
//
//        String[] aa = JSONObject.parseObject(houseTypeJson,String[].class);
//
//        for (String a:aa
//             ) {
//            System.out.println(a);
//        }// System.out.println(houseUpForm);return end == 1? "success":"fail";}@RequestMapping("/getAllHURecords")public String getAllHURecords(HURecordsInfo huRecordsInfo){int HURecords;//返回查询到的记录数Integer pageStart;List<House> houseList;List<HouseInfo> houseInfoArrayList = new ArrayList<>();pageStart = (huRecordsInfo.getPageStart()-1)*huRecordsInfo.getPageSize();//查询记录数量HURecords = houseDao.getAllHURecordsNum("%"+huRecordsInfo.getAccount()+"%");houseList = houseDao.getAllHUList("%"+huRecordsInfo.getAccount()+"%",pageStart,huRecordsInfo.getPageSize());for (House hu:houseList) {String[] houseType = JSONObject.parseObject(hu.getHouseType(),String[].class);String[] houseID = JSONObject.parseObject(hu.getHouseID(),String[].class);String[] checkList = JSONObject.parseObject(hu.getCheckList(),String[].class);HousePic houseP = housePicService.findHousePicByHpicid(hu.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};houseInfoArrayList.add(new HouseInfo(hu.getHouid(),hu.getAccount(),houseType,houseID,hu.getRentType(),hu.getRentArea(),hu.getFloor(),hu.getAddressDetail(),checkList,hu.getMonthRent(),hu.getDescription(),housePic,hu.getState(),hu.getRefuseReason()));}HashMap<String, Object> res = new HashMap<>();res.put("HURecords",HURecords);//存放查询结果用户总个数res.put("houseInfoArrayList",houseInfoArrayList);//存放用户列表String res_json = JSON.toJSONString(res);//res转化为json字符串return res_json;}//获取所有展示中的房源信息(分页查询)@RequestMapping("/getAllOnshowHURecords")public String getAllOnshowHURecords(HURecordsInfo huRecordsInfo){int HURecords;//返回查询到的记录数Integer pageStart;List<House> houseList;List<HouseInfo> houseInfoArrayList = new ArrayList<>();pageStart = (huRecordsInfo.getPageStart()-1)*huRecordsInfo.getPageSize();//查询记录数量HURecords = houseDao.getAllOnshowHURecordsNum("%"+huRecordsInfo.getAccount()+"%");houseList = houseDao.getAllOnshowHUList("%"+huRecordsInfo.getAccount()+"%",pageStart,huRecordsInfo.getPageSize());for (House hu:houseList) {String[] houseType = JSONObject.parseObject(hu.getHouseType(),String[].class);String[] houseID = JSONObject.parseObject(hu.getHouseID(),String[].class);String[] checkList = JSONObject.parseObject(hu.getCheckList(),String[].class);HousePic houseP = housePicService.findHousePicByHpicid(hu.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};houseInfoArrayList.add(new HouseInfo(hu.getHouid(),hu.getAccount(),houseType,houseID,hu.getRentType(),hu.getRentArea(),hu.getFloor(),hu.getAddressDetail(),checkList,hu.getMonthRent(),hu.getDescription(),housePic,hu.getState(),hu.getRefuseReason()));}HashMap<String, Object> res = new HashMap<>();res.put("HURecords",HURecords);//存放查询结果用户总个数res.put("houseInfoArrayList",houseInfoArrayList);//存放用户列表String res_json = JSON.toJSONString(res);//res转化为json字符串return res_json;}//条件筛选房源信息@RequestMapping("/getAllOnshowHURecordsByKey")public String getAllOnshowHURecordsByKey(@RequestParam("houseKey")String houseKey,@RequestParam("rentArea")String rentArea,@RequestParam("monthRent")String monthRent,@RequestParam("houseType")String houseType0,@RequestParam("rentType")String rentType,@RequestParam("floor")String floor,@RequestParam("pageStart")Integer pageStart,@RequestParam("pageSize")Integer pageSize){int rentAreaStart = Integer.parseInt(rentArea);int monthRentStart = Integer.parseInt(monthRent);//int houseTypeNum = Integer.parseInt(houseType0);int rentTypeNo = Integer.parseInt(rentType);int floorStart = Integer.parseInt(floor);int HURecords;//返回查询到的记录数Integer pageStartTemp;List<House> houseList;List<HouseInfo> houseInfoArrayList = new ArrayList<>();pageStartTemp = (pageStart-1)*pageSize;//查询记录数量HURecords = houseDao.getAllHURecordsByKeysNum("%"+houseKey+"%",rentAreaStart,monthRentStart,rentTypeNo,floorStart);houseList = houseDao.getAllHUListByKeys("%"+houseKey+"%",rentAreaStart,monthRentStart,rentTypeNo,floorStart,pageStartTemp,pageSize);for (House hu:houseList) {String[] houseType = JSONObject.parseObject(hu.getHouseType(),String[].class);String[] houseID = JSONObject.parseObject(hu.getHouseID(),String[].class);String[] checkList = JSONObject.parseObject(hu.getCheckList(),String[].class);HousePic houseP = housePicService.findHousePicByHpicid(hu.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};houseInfoArrayList.add(new HouseInfo(hu.getHouid(),hu.getAccount(),houseType,houseID,hu.getRentType(),hu.getRentArea(),hu.getFloor(),hu.getAddressDetail(),checkList,hu.getMonthRent(),hu.getDescription(),housePic,hu.getState(),hu.getRefuseReason()));}HashMap<String, Object> res = new HashMap<>();res.put("HURecords",HURecords);//存放查询结果用户总个数res.put("houseInfoArrayList",houseInfoArrayList);//存放用户列表String res_json = JSON.toJSONString(res);//res转化为json字符串return res_json;//        System.out.println("rentAreaStart:"+rentAreaStart);
//        System.out.println("monthRentStart:"+monthRentStart);
//        System.out.println("houseTypeNum:"+houseTypeNum);
//        System.out.println("rentTypeNum:"+rentTypeNum);
//        System.out.println("floorStart:"+floorStart);}//获取所有未通过的房屋信息列表@RequestMapping("/gethouseUpRecord")public String getHouseUpRecords(HURecordsInfo huRecordsInfo){int HURecords;//返回查询到的记录数Integer pageStart;List<House> houseList;List<HouseInfo> houseInfoArrayList = new ArrayList<>();pageStart = (huRecordsInfo.getPageStart()-1)*huRecordsInfo.getPageSize();//查询记录数量HURecords = houseDao.getDesignatedAllHURecordsNum("%"+huRecordsInfo.getAccount()+"%");houseList = houseDao.getDesignatedAllHUList("%"+huRecordsInfo.getAccount()+"%",pageStart,huRecordsInfo.getPageSize());for (House hu:houseList) {String[] houseType = JSONObject.parseObject(hu.getHouseType(),String[].class);String[] houseID = JSONObject.parseObject(hu.getHouseID(),String[].class);String[] checkList = JSONObject.parseObject(hu.getCheckList(),String[].class);HousePic houseP = housePicService.findHousePicByHpicid(hu.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};houseInfoArrayList.add(new HouseInfo(hu.getHouid(),hu.getAccount(),houseType,houseID,hu.getRentType(),hu.getRentArea(),hu.getFloor(),hu.getAddressDetail(),checkList,hu.getMonthRent(),hu.getDescription(),housePic,hu.getState()));}HashMap<String, Object> res = new HashMap<>();res.put("HURecords",HURecords);//存放查询结果用户总个数res.put("houseInfoArrayList",houseInfoArrayList);//存放用户列表String res_json = JSON.toJSONString(res);//res转化为json字符串return res_json;}//删除某条申请记录@RequestMapping("/deleteOneHouseUpRecord")public String deleteOneHouseUpRecord(@RequestParam("houid") Integer houid){int hpicid = houseDao.findHousepicByHouid(houid);int deleteHpicidFlag = housePicService.deleteHousepicByhpicid(hpicid);if (deleteHpicidFlag < 1){return "fail";}int deleteHouidFlag = houseDao.deleteOneHouseUpRecord(houid);return deleteHouidFlag == 1 ? "success":"fail";}//通过申请,房屋记录state值设置为2通过(也是上架方法)@RequestMapping("/submitHouseUpRecord")public String submitHouseUpRecord(@RequestParam("houid")Integer houid){int submit = houseDao.submitHouseUpRecord(houid);return submit == 1 ? "success":"fail";}//下架房屋,房屋记录state值设置为1@RequestMapping("/offHouse")public String offHouseUpRecord(@RequestParam("houid")Integer houid){int off = houseDao.offHouseUpRecord(houid);return off == 1 ? "success":"fail";}//拒绝申请@RequestMapping("/refuseHouseUpRecord")public String refuseHouseUpRecord(@RequestParam("houid")Integer houid,@RequestParam("refusereason")Integer refusereason){int refuse = houseDao.refuseHouseUpRecord(houid,refusereason);return refuse > 0 ? "success":"fail";}//房东用户关键字搜索房源信息接口@RequestMapping("/getAccBykeyHURecords")public String getAccBykeyHURecords(FindbykeyInfo findbykeyInfo){int HURecords;//返回查询到的记录数Integer pageStart;List<House> houseList;List<HouseInfo> houseInfoArrayList = new ArrayList<>();pageStart = (findbykeyInfo.getPageStart()-1)*findbykeyInfo.getPageSize();//查询记录数量HURecords = houseDao.getKeyAllHURecordsNum(findbykeyInfo.getAccount(),"%"+findbykeyInfo.getKey()+"%");houseList = houseDao.getKeyAllHUList(findbykeyInfo.getAccount(),"%"+findbykeyInfo.getKey()+"%",pageStart,findbykeyInfo.getPageSize());for (House hu:houseList) {String[] houseType = JSONObject.parseObject(hu.getHouseType(),String[].class);String[] houseID = JSONObject.parseObject(hu.getHouseID(),String[].class);String[] checkList = JSONObject.parseObject(hu.getCheckList(),String[].class);HousePic houseP = housePicService.findHousePicByHpicid(hu.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};houseInfoArrayList.add(new HouseInfo(hu.getHouid(),hu.getAccount(),houseType,houseID,hu.getRentType(),hu.getRentArea(),hu.getFloor(),hu.getAddressDetail(),checkList,hu.getMonthRent(),hu.getDescription(),housePic,hu.getState()));}HashMap<String, Object> res = new HashMap<>();res.put("HURecords",HURecords);//存放查询结果用户总个数res.put("houseInfoArrayList",houseInfoArrayList);//存放用户列表String res_json = JSON.toJSONString(res);//res转化为json字符串return res_json;}//查询指定houid的@RequestMapping("/getHouseDetailByhouid")public String getHouseDetailByhouid(@RequestParam("houid")Integer houid){House house = houseDao.getHouseDetailByhouid(houid);HousePic houseP = housePicService.findHousePicByHpicid(house.getHousePic());String[] housePic = {houseP.getPicone(),houseP.getPictwo(),houseP.getPicthree(),houseP.getPicfour(),houseP.getPicfive()};HouseInfo houseInfo = new HouseInfo(house.getHouid(),house.getAccount(),JSONObject.parseObject(house.getHouseType(),String[].class),JSONObject.parseObject(house.getHouseID(),String[].class),house.getRentType(),house.getRentArea(),house.getFloor(),house.getAddressDetail(),JSONObject.parseObject(house.getCheckList(),String[].class),house.getMonthRent(),house.getDescription(),housePic,house.getState(),house.getRefuseReason());System.out.println(houid);String account = houseDao.getAccountByHouid(houid);OwnerApply ownerApply = ownerRecordService.findApplyRecordByAccount(account);HashMap<String, Object> res = new HashMap<>();res.put("house",houseInfo);res.put("owner",ownerApply);String house_json = JSON.toJSONString(res);return house_json;}}

演示视频

基于springboot和vue的租房平台设计

基于SpringBoot+Vue的房屋租赁系统、租房平台相关推荐

  1. 基于springboot+vue的房屋租赁统(源代码+数据库)071

    部分代码地址 https://gitee.com/ynwynwyn/houserentVuePublic 基于springboot+vue的房屋租赁系统(源代码+数据库) 一.系统介绍 本项目前后端分 ...

  2. 基于springboot+vue的食疗系统

    基于springboot+vue的食疗系统 ✌全网粉丝20W+,csdn特邀作者.博客专家.CSDN新星计划导师.java领域优质创作者,博客之星.掘金/华为云/阿里云/InfoQ等平台优质作者.专注 ...

  3. java计算机毕业设计基于springboot+vue+elementUI的口腔管理平台管理系统(前后端分离)

    项目介绍 口腔卫生是关系民生的一个重要问题.口腔健康会直接影响全身的健康,口腔基本常见的有龋齿,牙周炎等问题,而且人类的牙齿只有2次更换周期,一旦牙齿彻底完成更换终生将不再更换,所以越来越多的人开始关 ...

  4. 基于springboot+vue的ERP系统

    一.项目简介 基于springboot+vue的ERP系统,用这个项目二开过,里面逻辑有一丢丢混乱,bug也是有的,但是不影响整体功能 二.实现功能 支持零售管理.采购管理.销售管理 支持财务管理.报 ...

  5. 基于springboot+vue的个人健康信息服务平台

    基于springboot+vue的个人健康信息服务平台 ✌全网粉丝20W+,csdn特邀作者.博客专家.CSDN新星计划导师.java领域优质创作者,博客之星.掘金/华为云/阿里云/InfoQ等平台优 ...

  6. 基于springboot+Vue的设备监控系统

    一.项目简介 基于springboot+Vue的设备监控系统 二.实现功能 支持数据采集服务以及数据采集的自动化处理 支持数据监控的可视化 支持统计报表的流程化 支持表单的引擎 支持监控指标配置化 支 ...

  7. 基于SpringBoot+Vue在线考试系统【web端+小程序端】【附带源码】

    最近和不少大佬聊天,有的技术很牛,有的赚很多,有的已经是高管,有的有自己的公司. 通过聊天,我发现成功人的优点基本相同: 能吃苦,执行力强,自律性强. 喝了不少酒后,酒后吐真言,成功的人都不容易,说这 ...

  8. java项目:基于springboot+vue在线考试系统1013

    项目描述 springboot+vue在线考试系统: 使用目前较为流行的框架spring boot,前端部分采用了vue,项目的业务流程相对简单,该项目主要功能包括学生管理,教师管理,题库管理,成绩查 ...

  9. 基于springboot+vue的商城系统(电商平台)(前后端分离)

    博主主页:猫头鹰源码 博主简介:Java领域优质创作者.CSDN博客专家.公司架构师.全网粉丝5万+.专注Java技术领域和毕业设计项目实战 主要内容:毕业设计(Javaweb项目|小程序等).简历模 ...

最新文章

  1. 如何多快好省的建设企业级呼叫中心(一)
  2. CSDN-Markdown编辑器如何修改图像大小
  3. jquery 操作服务端控件,select 控件
  4. “零代码”时代已来!程序员真的要去送外卖了?
  5. Centos7.0安装 Lets encrypt 的SSL证书
  6. 在 里面_适合县城里面加盟的鞋店推荐
  7. leetcode题库--112路径总和
  8. 医院管理系统(Java)
  9. 仅展示近三天的动态设置_微信朋友圈好友设置仅展示最近3天动态是对所有好友吗?还是针对某个人...
  10. 解决Word无响应崩溃的问题
  11. springboot整合fluent-mybatis,报错“...is not a @FluentMybatis Entity or it‘s Mapper not defined as bean.”
  12. 计算机网络整理(上)
  13. 支付宝快捷登录相关事宜
  14. 李宏毅机器学习2021作业7-Bert (Question Answering)
  15. explicit的作用
  16. zabbix3.0配置服务器流量告警
  17. audit详细使用配置
  18. pac for linux,Ubuntu下安装PAC Manager 4.5.3.9
  19. 云锁 php一句话,关于php一句话免杀的分析转载
  20. sr550服务器服务器系统安装,sr550服务器阵列配置

热门文章

  1. 成功解决TypeError: ‘<‘ not supported between instances of ‘str‘ and ‘int‘
  2. 微信公众平台运营规范
  3. 解决idea鼠标移开后自动预编译的问题
  4. Hisi3531D环境的搭建
  5. inode网卡被禁用解决方法
  6. 单片机按钮按一下加1与消抖
  7. Spring Boot spring.factories 用法及原理
  8. 前后端分离项目之微信端网页授权处理
  9. 专家问诊网络文学“投你所好病”
  10. 27、scratch教程-画心形