基于java+ssm+vue的二手房中介管理系统

项目介绍

如今社会上各行各业,都在用属于自己专用的软件来进行工作,互联网发展到这个时候,人们已经发现离不开了互联网。互联网的发展,离不开一些新的技术,而新技术的产生往往是为了解决现有问题而产生的。针对于二手房信息管理方面的不规范,容错率低,管理人员处理数据费工费时,采用新开发的二手房中介管理系统可以从根源上规范整个数据处理流程的正规性和合法性。

二手房中介管理系统按照操作主体分为管理员与用户。管理员权限操作的功能包括对注册用户信息的管理,对卖房信息,小区信息,出租信息,论坛信息等信息的管理。用户权限操作的功能包括查看小区介绍,收藏出租以及卖房信息,发布或评论论坛帖子信息。该系统采用了Mysql数据库,Java语言,SSM框架等技术进行编程实现。

二手房中介管理系统可以提高二手房信息管理问题的解决效率,优化二手房信息处理流程,并且能够保证存储数据的安全,它是一个非常可靠,非常安全的应用程序。

4.2 功能结构设计
图4.1即为设计的管理员功能结构,管理员权限操作的功能包括对注册用户信息的管理,对卖房信息,小区信息,出租信息,论坛信息等信息的管理。
在这里插入图片描述
图4.2即为设计的用户功能结构,用户权限操作的功能包括查看小区介绍,收藏出租以及卖房信息,发布或评论论坛帖子信息。
在这里插入图片描述

开发环境

编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序/vue/爬虫/c#/asp.net

系统实现

5.1 管理员功能实现
5.1.1 小区管理
图5.1 即为编码实现的小区管理界面,管理员在该界面中新增小区信息,包括对小区的建筑类型,所属商圈,周边配置,小区地址等资料进行登记,可以更改小区信息,同时可以提供小区名称完成指定小区信息的查询,可以删除需要删除的小区信息。
在这里插入图片描述

图5.1 小区管理界面

5.1.2 用户管理
图5.2 即为编码实现的用户管理界面,管理员在该界面中对为用户重置密码信息,更改用户的头像,更改用户的手机号等信息,删除需要删除的用户资料,使用用户身份证号查询用户信息。
在这里插入图片描述

图5.2 用户管理界面

5.1.3 论坛管理
图5.3 即为编码实现的论坛管理界面,管理员在该界面中更改帖子内容,删除需要删除的帖子信息,可以查看各个帖子相应的回复信息。可以使用帖子标题或用户姓名查询帖子信息。
在这里插入图片描述

图5.3 论坛管理界面

5.1.4 卖房管理
图5.4 即为编码实现的卖房管理界面,管理员在该界面中具备新增卖房信息,修改卖房信息,查看卖房详情信息的权限,同时管理员也能删除需要删除的卖房信息。卖房信息包括房屋平方,房屋图片,房屋每平米价格等信息。
在这里插入图片描述

图5.4 卖房管理界面

5.1.5 出租管理
图5.5 即为编码实现的出租管理界面,管理员在该界面中主要是新增房屋出租信息,切换房屋出租状态,更改房屋水费,电费以及房租价格等信息,可以删除需要删除的房屋出租信息。
在这里插入图片描述

图5.5 出租管理界面

5.2 用户功能实现
5.2.1 论坛信息
图5.6 即为编码实现的论坛信息界面,用户在该界面中选择适合自己的帖子类型,然后查看该类型的所有帖子,并针对帖子发布个人评论信息,同时,用户也能选择帖子类型发布个人帖子。
在这里插入图片描述

图5.6 论坛信息界面

5.2.2 出租信息
图5.7 即为编码实现的出租信息界面,用户在该界面中对房屋出租的介绍信息进行查看,在该界面下方允许用户添加留言信息,用户点击界面的右上方的收藏按钮就能收藏当前界面的房屋出租信息。
在这里插入图片描述

图5.7 出租信息界面

5.2.3 卖房信息
图5.8 即为编码实现的卖房信息界面,用户在该界面中主要就是收藏卖房信息,对本界面提供的卖房信息发布个人留言信息,查看卖房介绍信息等。
在这里插入图片描述

图5.8 卖房信息界面

5.2.4 小区信息
图5.9 即为编码实现的小区信息界面,用户在该界面中查看小区介绍,查看小区的卖房套数以及出租房屋套数信息等。
在这里插入图片描述

图5.9 小区信息界面

核心代码

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("uzu")
public class ChuzuController {
    private static final Logger logger = LoggerFactory.getLogger(ChuzuController.class);

    @Autowired
    private ChuzuService chuzuService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service
    @Autowired
    private XiaoquService xiaoquService;
    @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(StringUtil.isEmpty(role))
            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 = chuzuService.queryPage(params);

        //字典表数据转换
        List<ChuzuView> list =(List<ChuzuView>)page.getList();
        for(ChuzuView 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);
        ChuzuEntity chuzu = chuzuService.selectById(id);
        if(chuzu !=null){
            //entity转view
            ChuzuView view = new ChuzuView();
            BeanUtils.copyProperties( chuzu , view );//把实体数据重构到view中

                //级联表
                XiaoquEntity xiaoqu = xiaoquService.selectById(chuzu.getXiaoquId());
                if(xiaoqu != null){
                    BeanUtils.copyProperties( xiaoqu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setXiaoquId(xiaoqu.getId());
                }
                //级联表
                YonghuEntity yonghu = yonghuService.selectById(chuzu.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("ve")
    public R save(@RequestBody ChuzuEntity chuzu, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,chuzu:{}",this.getClass().getName(),chuzu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role))
            return R.error(511,"权限为空");
        else if("用户".equals(role))
            chuzu.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        Wrapper<ChuzuEntity> queryWrapper = new EntityWrapper<ChuzuEntity>()
            .eq("yonghu_id", chuzu.getYonghuId())
            .eq("xiaoqu_id", chuzu.getXiaoquId())
            .eq("chuzu_name", chuzu.getChuzuName())
            .eq("chuzu_types", chuzu.getChuzuTypes())
            .eq("fangxing_types", chuzu.getFangxingTypes())
            .eq("zhuangxiu_types", chuzu.getZhuangxiuTypes())
            .eq("chaoxiang_types", chuzu.getChaoxiangTypes())
            .eq("louceng", chuzu.getLouceng())
            .eq("quyu_types", chuzu.getQuyuTypes())
            .eq("tese", chuzu.getTese())
            .eq("xiangxi", chuzu.getXiangxi())
            .eq("yizu_types", chuzu.getYizuTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        ChuzuEntity chuzuEntity = chuzuService.selectOne(queryWrapper);
        if(chuzuEntity==null){
            chuzu.setInsertTime(new Date());
            chuzu.setCreateTime(new Date());
            chuzuService.insert(chuzu);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody ChuzuEntity chuzu, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,chuzu:{}",this.getClass().getName(),chuzu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(StringUtil.isEmpty(role))
//            return R.error(511,"权限为空");
//        else if("用户".equals(role))
//            chuzu.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        //根据字段查询是否有相同数据
        Wrapper<ChuzuEntity> queryWrapper = new EntityWrapper<ChuzuEntity>()
            .notIn("id",chuzu.getId())
            .andNew()
            .eq("yonghu_id", chuzu.getYonghuId())
            .eq("xiaoqu_id", chuzu.getXiaoquId())
            .eq("chuzu_name", chuzu.getChuzuName())
            .eq("chuzu_types", chuzu.getChuzuTypes())
            .eq("fangxing_types", chuzu.getFangxingTypes())
            .eq("zhuangxiu_types", chuzu.getZhuangxiuTypes())
            .eq("chaoxiang_types", chuzu.getChaoxiangTypes())
            .eq("louceng", chuzu.getLouceng())
            .eq("quyu_types", chuzu.getQuyuTypes())
            .eq("tese", chuzu.getTese())
            .eq("xiangxi", chuzu.getXiangxi())
            .eq("yizu_types", chuzu.getYizuTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        ChuzuEntity chuzuEntity = chuzuService.selectOne(queryWrapper);
        if("".equals(chuzu.getChuzuPhoto()) || "null".equals(chuzu.getChuzuPhoto())){
                chuzu.setChuzuPhoto(null);
        }
        if(chuzuEntity==null){
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      chuzu.set
            //  }
            chuzuService.updateById(chuzu);//根据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());
        chuzuService.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<ChuzuEntity> chuzuList = 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){
                            //循环
                            ChuzuEntity chuzuEntity = new ChuzuEntity();
//                            chuzuEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            chuzuEntity.setXiaoquId(Integer.valueOf(data.get(0)));   //小区 要改的
//                            chuzuEntity.setChuzuName(data.get(0));                    //房间 要改的
//                            chuzuEntity.setChuzuPhoto("");//照片
//                            chuzuEntity.setChuzuTypes(Integer.valueOf(data.get(0)));   //出租方式 要改的
//                            chuzuEntity.setChuzuMoney(data.get(0));                    //房租价格/月 要改的
//                            chuzuEntity.setShuiMoney(data.get(0));                    //水费/吨 要改的
//                            chuzuEntity.setDianMoney(data.get(0));                    //电费/度 要改的
//                            chuzuEntity.setBaojieMoney(data.get(0));                    //保洁/月 要改的
//                            chuzuEntity.setFangxingTypes(Integer.valueOf(data.get(0)));   //房屋类型 要改的
//                            chuzuEntity.setPingfang(data.get(0));                    //房屋平方 要改的
//                            chuzuEntity.setZhuangxiuTypes(Integer.valueOf(data.get(0)));   //装修方式 要改的
//                            chuzuEntity.setChaoxiangTypes(Integer.valueOf(data.get(0)));   //房屋朝向 要改的
//                            chuzuEntity.setLouceng(Integer.valueOf(data.get(0)));   //楼层 要改的
//                            chuzuEntity.setQuyuTypes(Integer.valueOf(data.get(0)));   //所属区域 要改的
//                            chuzuEntity.setTese(data.get(0));                    //房屋特色 要改的
//                            chuzuEntity.setXiangxi(data.get(0));                    //详细地址 要改的
//                            chuzuEntity.setChuzuContent("");//照片
//                            chuzuEntity.setYizuTypes(Integer.valueOf(data.get(0)));   //是否出租 要改的
//                            chuzuEntity.setInsertTime(date);//时间
//                            chuzuEntity.setCreateTime(date);//时间
                            chuzuList.add(chuzuEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        chuzuService.insertBatch(chuzuList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }





    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("st")
    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 = chuzuService.queryPage(params);

        //字典表数据转换
        List<ChuzuView> list =(List<ChuzuView>)page.getList();
        for(ChuzuView 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);
        ChuzuEntity chuzu = chuzuService.selectById(id);
            if(chuzu !=null){


                //entity转view
                ChuzuView view = new ChuzuView();
                BeanUtils.copyProperties( chuzu , view );//把实体数据重构到view中

                //级联表
                    XiaoquEntity xiaoqu = xiaoquService.selectById(chuzu.getXiaoquId());
                if(xiaoqu != null){
                    BeanUtils.copyProperties( xiaoqu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setXiaoquId(xiaoqu.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(chuzu.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 ChuzuEntity chuzu, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,chuzu:{}",this.getClass().getName(),chuzu.toString());
        Wrapper<ChuzuEntity> queryWrapper = new EntityWrapper<ChuzuEntity>()
            .eq("yonghu_id", chuzu.getYonghuId())
            .eq("xiaoqu_id", chuzu.getXiaoquId())
            .eq("chuzu_name", chuzu.getChuzuName())
            .eq("chuzu_types", chuzu.getChuzuTypes())
            .eq("fangxing_types", chuzu.getFangxingTypes())
            .eq("zhuangxiu_types", chuzu.getZhuangxiuTypes())
            .eq("chaoxiang_types", chuzu.getChaoxiangTypes())
            .eq("louceng", chuzu.getLouceng())
            .eq("quyu_types", chuzu.getQuyuTypes())
            .eq("tese", chuzu.getTese())
            .eq("xiangxi", chuzu.getXiangxi())
            .eq("yizu_types", chuzu.getYizuTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        ChuzuEntity chuzuEntity = chuzuService.selectOne(queryWrapper);
        if(chuzuEntity==null){
            chuzu.setInsertTime(new Date());
            chuzu.setCreateTime(new Date());
        //  String role = String.valueOf(request.getSession().getAttribute("role"));
        //  if("".equals(role)){
        //      chuzu.set
        //  }
        chuzuService.insert(chuzu);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


}

 

论文参考

在这里插入图片描述

目 录
第1章 绪论 1
1.1 课题背景 1
1.2 课题意义 1
1.3 研究内容 2
第2章 开发环境与技术 3
2.1 Java语言 3
2.2 MYSQL数据库 3
2.3 IDEA开发工具 4
2.4 SSM框架 4
第3章 系统分析 5
3.1 可行性分析 5
3.1.1 技术可行性 5
3.1.2 经济可行性 5
3.1.3 操作可行性 5
3.2 系统流程 5
3.2.1 操作流程 6
3.2.2 登录流程 6
3.2.3 删除信息流程 7
3.2.4 添加信息流程 7
3.3 性能需求 8
3.4 功能需求 9
第4章 系统设计 12
4.1 系统设计思想 12
4.2 功能结构设计 13
4.3 数据库设计 14
4.3.1 数据库概念设计 14
4.3.2 数据库物理设计 16
第5章 系统实现 23
5.1 管理员功能实现 23
5.1.1 小区管理 23
5.1.2 用户管理 23
5.1.3 论坛管理 24
5.1.4 卖房管理 24
5.1.5 出租管理 25
5.2 用户功能实现 25
5.2.1 论坛信息 25
5.2.2 出租信息 26
5.2.3 卖房信息 26
5.2.4 小区信息 27
第6章 系统测试 28
6.1 测试任务 28
6.2 测试目标 28
6.3 测试方案 29
6.4 功能测试 30
6.4.1 登录功能测试 31
6.4.2 修改密码功能测试 31
6.5 系统测试结果 32
结 论 33
参考文献 35
致 谢 36

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_3306428634

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值