基于javaweb+mysql的ssm房屋租售咨询展示系统(java+ssm+jsp+layui+html+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM房屋租售咨询展示系统(java+ssm+jsp+layui+html+mysql)
一、项目简述 环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
private HeadPortraitImgService headPortraitImgService;
@Resource
private CheckoutapplicationService checkoutapplicationService;
/**
* 登录
*/
@RequestMapping("/userpwd")
public String userpwd(String username, String pwd, String[] identity, HttpServletRequest request) {
HttpSession session = request.getSession();
if (username.equals("") || pwd.equals("")) {
request.setAttribute("erorr", "输入账号密码不能为空!");
return "login";
String tempstr = null;
if (usercall.equals("") || userpwd.equals("") || userphone.equals("")) {
request.setAttribute("erorr", "输入账号密码不能为空!");
return "register";
userlist user = new userlist();
user.setUsercall(usercall);
user.setUserphone(userphone);
user.setUserpwd(userpwd);
userlistService.insert(user);
headportraitimg userimg = new headportraitimg();
userimg.setHeadportraitimgusername(usercall);
headPortraitImgService.insertuserimg(userimg);
return "login";
String fhouseaddress = fault.getFhouseaddress();
Double fprice = fault.getFprice();
Date fdate = fault.getFdate();
String fcontent = fault.getFcontent();
String fusername = fault.getFusername();
String fuserid = fault.getFuserid();
String fuserphone = fault.getFuserphone();
String fstate = "已处理";
fault f = new fault(fhouseid, fhouseaddress, fprice, fdate, fcontent, fusername, fuserid, fuserphone, fstate,
id);
faultService.updateByPrimaryKey(f);
return "redirect:/admin/Adminselectrepairwait.do";
String tempstr = null;
try {
if (identity[0].equals("user")) {
userlist temp = new userlist();
temp.setUsercall(username);
temp.setUserpwd(pwd);
userlist userlist = userlistService.queryAllUserPwd(temp);
try {
tempstr = userlist.getUsercall();
if (tempstr != null) {
session.setAttribute("user", tempstr);
headportraitimg headportraitimg = headPortraitImgService.selectheadportrait(tempstr);
if (headportraitimg.getHeadportraitimgaddress() != null) {
session.setAttribute("headportraitimg", headportraitimg.getHeadportraitimgaddress());
List<fault> faultdone = faultService.repairselect(vo);
for (fault temp : faultdone) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.format(temp.getFdate());
temp.setFdatetemp(date);
PageInfo<fault> page = new PageInfo<fault>(faultdone, 3);
model.addAttribute("p", page);
model.addAttribute("vo", vo);
return "repairdone";
/**
* 我要收租
*/
Date fdate = fault.getFdate();
String fcontent = fault.getFcontent();
String fusername = fault.getFusername();
String fuserid = fault.getFuserid();
String fuserphone = fault.getFuserphone();
String fstate = "已处理";
fault f = new fault(fhouseid, fhouseaddress, fprice, fdate, fcontent, fusername, fuserid, fuserphone, fstate,
id);
faultService.updateByPrimaryKey(f);
return "redirect:/admin/Adminselectrepairwait.do";
/**
* 报障删除
house.setHousesize(Double.valueOf(area));
house.setHousestate(state);
house.setHouseid(houseid);
leaseinformationService.updateByPrimaryKey(house);
request.setAttribute("sessce", "修改成功");
request.setAttribute("newhouse", house);
return "houseupdate";
/**
* 删除房源信息
*/
return "login";
return "login";
/**
* 修改密码
*/
@RequestMapping("/updatepwd")
public String updatepwd(String code, String userphone, String userpwd, HttpServletRequest request) {
if (code.equals("") || userphone.equals("") || userpwd.equals("")) {
request.setAttribute("erorr", "手机号,验证码,新密码不能为空!");
return "updatepwd";
HttpSession session = request.getSession();
if (code.equals(session.getAttribute("code"))) {
public String delrent(Integer id) {
rentcollectionService.deleteByPrimaryKey(id);
return "redirect:/admin/adminselectPaidAll.do";
/**
* 搜索查询
*/
@RequestMapping("/adminselectPaidAll")
public String adminselectPaidAll(QueryVo vo, @RequestParam(value = "pn", defaultValue = "1") Integer pn,
Model model) {
// 引用PageHelper分页插件
PageHelper.startPage(pn, 10);
List<rentcollection> rentlists = rentcollectionService.selectPaidAll(vo);
for (rentcollection temp : rentlists) {
* 我要收租
*/
@RequestMapping("/adminrentshou")
public String rentshou(@RequestParam(value = "pn", defaultValue = "1") Integer pn, Model model) {
// 引用PageHelper分页插件
PageHelper.startPage(pn, 10);
List<userlist> userlists = userlistService.rentSelectAll();
PageInfo<userlist> page = new PageInfo<userlist>(userlists, 3);
model.addAttribute("rent", page);
return "rentshou";
/**
* 获取收租信息
public String rentaddwait(rentcollection rentcollection) {
rentcollectionService.insert(rentcollection);
return "redirect:/admin/adminrentshou.do";
/**
* 代缴租金
*/
@RequestMapping("/adminrentwait")
public String rentwait(String rcstate, @RequestParam(value = "pn", defaultValue = "1") Integer pn, Model model) {
rcstate = "未缴纳";
// 引用PageHelper分页插件
PageHelper.startPage(pn, 10);
List<rentcollection> rentlists = rentcollectionService.selectPaidStateAll(rcstate);
PageInfo<rentcollection> page = new PageInfo<rentcollection>(rentlists, 3);
@RequestMapping("/Adminselectrepairdone")
public String selectrepairdone(String state, @RequestParam(value = "pn", defaultValue = "1") Integer pn,
Model model) {
state = "已处理";
// 引用PageHelper分页插件
PageHelper.startPage(pn, 10);
List<fault> faultdone = faultService.AdminSelectStateAll(state);
PageInfo<fault> page = new PageInfo<fault>(faultdone, 3);
model.addAttribute("p", page);
return "repairdone";
/**
/**
* 删除租金缴纳记录
*/
@RequestMapping("/admindelrent")
public String delrent(Integer id) {
rentcollectionService.deleteByPrimaryKey(id);
return "redirect:/admin/adminselectPaidAll.do";
/**
* 搜索查询
*/
@RequestMapping("/adminselectPaidAll")
public String adminselectPaidAll(QueryVo vo, @RequestParam(value = "pn", defaultValue = "1") Integer pn,
Model model) {
// 使用PageInFo封装查询结果
PageInfo<checkoutapplication> pageInfo = new PageInfo<checkoutapplication>(list, 5);
// 放入转发参数
mav.addObject("cs", pageInfo);
return mav;
/**
* 删除退房记录
*/
@RequestMapping("/delecttzsq")
public ModelAndView delecttzsq(@RequestParam int id) {
ModelAndView mav = new ModelAndView("housedel");
checkoutapplicationService.deleteByPrimaryKey(id);
System.out.println(new DocumentConversion().DocumentGeneration(arraytemp));
new DocumentConversion().PdfGeneration(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;
房屋信息控制器:
/**
* 房屋信息控制器
PageHelper.startPage(pn, 10);
List<fault> faultdone = faultService.repairselect(vo);
for (fault temp : faultdone) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.format(temp.getFdate());
temp.setFdatetemp(date);
PageInfo<fault> page = new PageInfo<fault>(faultdone, 3);
model.addAttribute("p", page);
model.addAttribute("vo", vo);
return "repairdone";
/**
temp.setUserpwd(pwd);
userlist userlist = userlistService.queryAllUserPwd(temp);
try {
tempstr = userlist.getUsercall();
if (tempstr != null) {
session.setAttribute("user", tempstr);
headportraitimg headportraitimg = headPortraitImgService.selectheadportrait(tempstr);
if (headportraitimg.getHeadportraitimgaddress() != null) {
session.setAttribute("headportraitimg", headportraitimg.getHeadportraitimgaddress());
return "official";