基于javaweb+mysql的ssm房屋销售管理系统(java+ssm+jsp+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM房屋销售管理系统(java+ssm+jsp+jquery+mysql)
项目介绍
本项目包含管理员与买家两种角色;
管理员角色包含以下功能:
管理员登录,房源信息管理,合同信息管理,账户管理,申请看房信息管理等功能。
买家角色包含以下功能:
用户登录,用户登陆,查看房源信息,查看销售信息,查看申请信息,绑定账户等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7、8.0等版本均可;
技术栈
-
后端:Spring+springmvc+mybatis
-
前端:JSP+css+javascript+jQuery
使用说明
-
使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
-
使用IDEA/Eclipse/MyEclipse导入项目,配置tomcat;
-
将项目中db.properties配置文件中的数据库配置改为自己的配置;
-
运行项目,在浏览器中输入地址:http://localhost:8080/text2/
用户账号/密码: user/123456
管理员账号/密码:admin/admin
File filetemp = new File("C://Users/Rain/Desktop/ssm_leaseOfHouses/WebContent/contract/pdf/" + temp);
if (!filetemp.exists()) {
// System.out.println(new DocumentConversion().DocumentGeneration(arraytemp));
new DocumentConversion().PdfGeneration((arraytemp[0]+arraytemp[7]));
filetemp = new File("C://Users/Rain/Desktop/ssm_leaseOfHouses/WebContent/contract/pdf/" + temp);
String pdf = filetemp.getName();
// 放入转发参数
mav.addObject("pdftemp", pdf);
return mav;
/**
* 终止合同
*/
*/
@RequestMapping("/viewcontract")
public ModelAndView viewcontract(String username, String userid, String houseaddress, String housestartingdatetemp,
String houseclosingdatetemp, String housemoney, String userphone, String houseid,HttpServletRequest request,HttpSession session) {
ModelAndView mav = new ModelAndView("personacenter");
String arraytemp[] = { username, userid, houseaddress, housestartingdatetemp, houseclosingdatetemp, housemoney,
userphone, houseid };
String temp = (arraytemp[0]+arraytemp[7]) + "pdf.pdf";
File filetemp = new File("C://Users/Rain/Desktop/ssm_leaseOfHouses/WebContent/contract/pdf/" + temp);
if (!filetemp.exists()) {
// System.out.println(new DocumentConversion().DocumentGeneration(arraytemp));
new DocumentConversion().PdfGeneration((arraytemp[0]+arraytemp[7]));
filetemp = new File("C://Users/Rain/Desktop/ssm_leaseOfHouses/WebContent/contract/pdf/" + temp);
String pdf = filetemp.getName();
PageHelper.startPage(pn, 10);
List<rentcollection> rentlists = rentcollectionService.selectPaidStateAll(rcstate);
PageInfo<rentcollection> page = new PageInfo<rentcollection>(rentlists, 3);
model.addAttribute("rent", page);
return "rentwait";
/**
* 删除租金缴纳记录
*/
@RequestMapping("/admindelrent")
public String delrent(Integer id) {
// 放入转发参数
mav.addObject("news", news);
return mav;
/**
* 终止申请
*/
@RequestMapping("/stopapplying")
public ModelAndView stopapplying(String call,String token,HttpServletRequest request,HttpSession session) {
ModelAndView mav = new ModelAndView("personacenter");
//令牌验证
if(!new Koken().kokenid(request, session)) {
return mav;
house.setHouseid(houseid);
leaseinformationService.updateByPrimaryKey(house);
request.setAttribute("sessce", "修改成功");
request.setAttribute("newhouse", house);
return "houseupdate";
/**
* 删除房源信息
*/
@RequestMapping("/delethouse")
public String delethouse(int houseid, HttpServletRequest request) {
if (houseid >= 0) {
int id = leaseinformationService.queryID(houseid).get(0).getId();
leaseinformationService.deleteByPrimaryKey(houseid);
userlist userlist = new userlist();
userlist.setUsercall((String) session.getAttribute("user"));
userlist.setUsername(username);
userlist.setUserid(userid);
userlist.setUserphone(userphone);
Warning news = userlistService.updateByPrimaryCall(userlist);
System.out.println(news.getWarningContent());
// 放入转发参数
mav.addObject("news", news);
}else {
// 修改真实姓名,身份证,手机号
userlist userlist = new userlist();
public String pagingselectuser(Model model, @RequestParam(value = "pn", defaultValue = "1") Integer pn,
@RequestParam(required = false, defaultValue = "6") Integer pageSize) {
PageHelper.startPage(pn, 10);
List<userlist> userlist = userlistService.selectAll();
PageInfo<userlist> p = new PageInfo<userlist>(userlist, 3);
model.addAttribute("p", p);
return "account";
/**
* 删除用户信息
*/
@RequestMapping("/deletuser")
public String deletuser(int id,String username,HttpServletRequest request) {
userlistService.updateJointTabledelete(username);
return mav;
/**
* 删除申请记录
*/
@RequestMapping("/deleterecord")
public ModelAndView deleterecord(Integer coaid,String token,HttpServletRequest request,HttpSession session) {
ModelAndView mav = new ModelAndView("personacenter");
//令牌验证
if(!new Koken().kokenid(request, session)) {
return mav;
Warning news = checkoutapplicationService.deleteByPrimaryKey(coaid);
System.out.println(news.getWarningContent());
/**
* 申请状态记录分页查询
*/
@RequestMapping("/applicationAtatusList")
@ResponseBody
public Msg applicationAtatusList(@RequestParam(value = "pn") Integer pn, boolean flag, HttpSession session) {
List<checkoutapplication> list = null;
userlist user = userlistService.selectUserCall((String) session.getAttribute("user"));
// 设置分页传输
PageHelper.startPage(pn, 8);
house.setHouseaddress(address);
house.setHousemoney(rent);
house.setHousetype(housetype);
house.setHousesize(Double.valueOf(area));
house.setHousestate(state);
house.setHouseid(houseid);
leaseinformationService.updateByPrimaryKey(house);
request.setAttribute("sessce", "修改成功");
request.setAttribute("newhouse", house);
return "houseupdate";
// 查询所有数据
userlist user = userlistService.selectUserCall((String) session.getAttribute("user"));
// 设置分页传输
PageHelper.startPage(pn, 8);
List<userlist> leaseuser = userlistService.selectUserNameWith(user.getUsername());
// 使用PageInFo封装查询结果
PageInfo<userlist> pageInfo = new PageInfo<userlist>(leaseuser, 3);
return Msg.success().add("pageInfo", pageInfo);
/**
* 已退租赁记录分页查询
*/
fault.setFusername(user.getUsername());
fault.setFuserid(user.getUserid());
fault.setFuserphone(user.getUserphone());
fault.setFstate("未处理");
Warning news = faultService.insert(fault);
System.out.println(news.getWarningContent());
// 放入转发参数
mav.addObject("news", news);
return mav;
/**
* 报障删除记录
return "scheduleupdate";
@RequestMapping("/toupdate")
public String mydailylifeupdate2(mydailylife mydailylife) {
mydailylifeService.updateByPrimaryKey(mydailylife);
return "redirect:/admin/schedulelist.do";
/**
* 删除日程
*/
@RequestMapping("/delmydailylife")
public String mydailylifedel(Integer id) {
mydailylifeService.deleteByPrimaryKey(id);
return "redirect:/admin/schedulelist.do";
// 报障
// 如果目录不存在,创建
if (!filepath.exists()) {
filepath.mkdir();
File f = new File(path, fName);
// 更改用户头像
headportraitimg headportraitimg = new headportraitimg();
String user = (String) session.getAttribute("user");
headportraitimg.setHeadportraitimgusername(user);
headportraitimg.setHeadportraitimgaddress(fName);
// 图片路径上传到数据库
headPortraitImgService.updatauserimg(headportraitimg);
return "official";
@RequestMapping("/details")
public ModelAndView listCategory(@RequestParam int pn) {
ModelAndView mav = new ModelAndView("rentingdel");
// 设置分页传输
PageHelper.startPage(pn, 10);
// 查询所有数据
List<rentwithdrawn> list = rentwithdrawnService.selectRwState("已退租");
// 使用PageInFo封装查询结果
PageInfo<rentwithdrawn> pageInfo = new PageInfo<rentwithdrawn>(list, 5);
// 放入转发参数
mav.addObject("cs", pageInfo);
return mav;
if (flag) {
list = checkoutapplicationService.selectStateAll("看房申请中", "退房申请中", "", user.getUsername());
} else {
list = checkoutapplicationService.selectStateAll("已拒绝", "已同意", "已取消", user.getUsername());
// 使用PageInFo封装查询结果
PageInfo<checkoutapplication> pageInfo = new PageInfo<checkoutapplication>(list, 3);
return Msg.success().add("pageInfo", pageInfo);
/**
* 代缴租金分页查询
*/
@RequestMapping("/rentpaymentList")
@ResponseBody
public Msg rentpaymentList(@RequestParam(value = "pn") Integer pn, String state, HttpSession session) {
@RequestMapping("/updaterecommend")
public String updatehouse(Integer houseid) {
leaseinformation house = leaseinformationService.queryID(houseid).get(0);
if (house.getHouserecommend().equals("未推荐")) {
house.setHouserecommend("已推荐");
} else {
house.setHouserecommend("未推荐");
leaseinformationService.updateByPrimaryKey(house);
return "redirect:recommendlist.do?";
/**
public ModelAndView listCategory(@RequestParam int id){
ModelAndView mav = new ModelAndView("details");
List<leaseinformation> cs= leaseinformationService.allANDimg1(id);
for (leaseinformation leaseinformation : cs) {
System.out.println(leaseinformation.getLeaseimg().getImgroute());
// 放入转发参数
mav.addObject("cs", cs);
return mav;
个人中心控制器:
/**
* 个人中心控制器