大家好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
演示视频
ssm049在线租房系统演示
源码下载地址:
论文目录
【如需全文请按文末获取联系】
目录
一、项目简介
此次通过SSM框架技术来搭建一款在线租房的网站,能够实现出租方在线登记房源信息,租赁方能够在线查看消息,并在线与出租人进行沟通,可以实现在线租房申请。后台的管理员能够通过管理手段来对整个系统进行维护和管理的功能。
二、系统设计
2.1软件功能模块设计
这个系统的设计思想关键在于页面要求简洁、功能模块直观,整个模块的响应速度迅速,在将项目拉取下来之前,往往都是先要把环境部署好的,不然辛辛苦苦将项目的配置项配置好,发现是因为环境问题而无法运行起来了。而配置环境,我首选的都是使用集成的套件部署,即快捷且比较不容易遇到问题,虽然也有不能灵活配置的缺点,但对于日常开发时完全足够的。常用的SSM的相关程序需要安装,并进行配置。系统结构图如下(图4.1)。
2.2数据库设计
数据库是信息储存的容器,是一个系统的重要组成部分。没有数据库作为基础,系统就没有了存在的意义。通常使用E-R图进行表示:
1、管理员实体图:
2、注册用户操作的界面实体图:
3、房源实体图:
三、系统项目部分截图
3.1租房系统界面展示
此次设计的租房系统的主界面比较明亮,以图片为主,在主界面上有房源推荐的信息,并且以图片的形式给用户以最直观的体验。在菜单栏模块中,有房源信息、求租信息、房主信息以及留言等功能,并且可以通过“后台管理”模块进入到后台系统进行相应的操作。如下图所示:
3.2求租信息界面
当选择求租信息后,可以看到当前网站内发布的求租信息,通过求租信息能够让房主找到合适的承租人,可以进行线上留言沟通或者通过电话的形式进行沟通。如下图所示:
3.3管理员管理界面
管理员在后台登录后能够进入到租房系统的管理界面中,管理员的管理权限较多,能够对注册用户、系统用户进行信息的修改管理。对于出租信息、求租信息也能够进行管理。对于房源信息,网站内的留言信息也可以进行管理。界面如下图所示:
3.4房源管理界面
在房源管理界面中,管理员能够查看到所有的已经发布的房源信息,房源信息以列表的形式呈现在系统中,可以清晰的看到房源的编号、类型、所在的地区、房源的图片以及对应的租金价格、房东信息等内容,可以对该房源下的评论进行管理。如下图所示:
房东管理界面
管理员能够对注册的房东用户进行信息的管理工作,如下图所示:
四、部分核心代码
4.1 用户部分
package com.controller;
import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.entity.Allusers;
//import com.chengxusheji.po.News;
import com.server.AllusersServer;
import com.util.PageBean;
import net.sf.json.JSONObject;
@Controller
public class AllusersController {
@Resource
private AllusersServer allusersService;
//
@RequestMapping("showAllusers.do")
public String showAllusers(int id,ModelMap map,HttpSession session){
/* Map<String,Object> bmap=new HashMap<String,Object>();
bmap.put("uid", id);*/
// map.put("blist", allusersService.getAll(bmap));
map.put("allusers", allusersService.getById(id));
return "read";
}
@RequestMapping("addAllusers.do")
public String addAllusers(HttpServletRequest request,Allusers allusers,HttpSession session){
Timestamp time=new Timestamp(System.currentTimeMillis());
//Users u=(Users)session.getAttribute("user");
/*if(u==null||u.equals("")){
return "redirect:showIndex.do";
}else{*/
//bbs.setUid(u.getId());
/*bbs.setPubtime(time.toString());
bbs.setIsdel("1");*/
allusers.setAddtime(time.toString().substring(0, 19));
allusersService.add(allusers);
return "redirect:allusersList.do";
/*}*/
}
// 处理编辑
@RequestMapping("doUpdateAllusers.do")
public String doUpdateAllusers(int id,ModelMap map,Allusers allusers){
allusers=allusersService.getById(id);
map.put("allusers", allusers);
return "allusers_updt";
}
//
@RequestMapping("updateAllusers.do")
public String updateAllusers(int id,ModelMap map,Allusers allusers){
allusersService.update(allusers);
return "redirect:allusersList.do";
}
// 所有List
// @RequestMapping("allusersList.do")
// public String allusersList(ModelMap map,HttpSession session){
// map.put("list", allusersService.getAll(null));
// map.put("clist", allusersService.getAll(null));
// return "allusers";
// }
// 分页查询
@RequestMapping("allusersList.do")
public String goodList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Allusers allusers, String username, String pwd, String cx){
/*if(session.getAttribute("user")==null){
return "login";
}*/
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
Map<String, Object> bmap=new HashMap<String, Object>();
Map<String,Object> cmap=new HashMap<String,Object>();
/*pmap.put("uid", ((Users)session.getAttribute("user")).getId());
bmap.put("uid", ((Users)session.getAttribute("user")).getId());*/
if(username==null||username.equals("")){pmap.put("username", null);cmap.put("username", null);}else{pmap.put("username", username);cmap.put("username", username);}
if(pwd==null||pwd.equals("")){pmap.put("pwd", null);cmap.put("pwd", null);}else{pmap.put("pwd", pwd);cmap.put("pwd", pwd);}
if(cx==null||cx.equals("")){pmap.put("cx", null);cmap.put("cx", null);}else{pmap.put("cx", cx);cmap.put("cx", cx);}
int total=allusersService.getCount(bmap);
pageBean.setTotal(total);
List<Allusers> list=allusersService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "allusers_list";
}
// 分页模糊查询
@RequestMapping("vagueAllusersList.do")
public String vagueAllusersList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page),PageBean.PAGESIZE);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", pageBean.getPageSize());
Map<String, Object> bmap=new HashMap<String, Object>();
/*pmap.put("uid", ((Users)session.getAttribute("user")).getId());
bmap.put("uid", ((Users)session.getAttribute("user")).getId());*/
int total=allusersService.getCount(bmap);
pageBean.setTotal(total);
List<Allusers> list=allusersService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 2);
return "queryallusers";
}
@RequestMapping("deleteAllusers.do")
public String deleteAllusers(int id){
allusersService.delete(id);
return "redirect:allusersList.do";
}
@RequestMapping("quchongAllusers.do")
public void quchongAllusers(Allusers allusers,HttpServletResponse response){
Map<String,Object> map=new HashMap<String,Object>();
map.put("username", allusers.getUsername());
System.out.println("username==="+allusers.getUsername());
System.out.println("username222==="+allusersService.quchongAllusers(map));
JSONObject obj=new JSONObject();
if(allusersService.quchongAllusers(map)!=null){
obj.put("info", "ng");
}else{
obj.put("info", "username可以用!");
}
response.setContentType("text/html;charset=utf-8");
PrintWriter out=null;
try {
out=response.getWriter();
out.print(obj);
out.flush();
} catch (IOException e) {
e.printStackTrace();
}finally{
out.close();
}
}
@RequestMapping("Alluserslogin.do")
public String checkAllusersLogin(Allusers allusers, HttpSession session) {
Map<String,Object> u=new HashMap<String,Object>();
System.out.println("name===" + allusers.getUsername());
u.put("username",allusers.getUsername());
//u.put("utype", "用户");
//Md5.MD5HexEncode(user.getPassword())
u.put("pwd",allusers.getPwd());
allusers = allusersService.allusersLogin(u);
if (allusers != null) {
session.setAttribute("username", allusers);
System.out.println("username=" + allusers);
session.removeAttribute("suc");
return "redirect:index.do";
} else {
System.out.println("usernafwfwwme=");
session.setAttribute("suc", "登录失败!用户名或密码错误!");
return "login";
}
}
}
获取源码或论文
如需对应的论文或源码,也可以下方微信联系我