基于javaweb+jsp房屋租赁系统(java+SSM+jsp+mysql+maven)
一、项目简述
功能: 房源信息模块:房源信息展示、房源信息更新、房源信息 增加、房源信息删除 账户管理模块:账户登录、账户绑定、账户管理 租金结算模块:每月租金信息、租金交付功能、月租金收 入总^^克计 房屋租赁合同管理模块:房屋租赁合同录入、房屋租赁合 同展示、房屋租赁价格修改、房屋租赁合同终止 报障模块:租客报账、管理员报障审核、租客报B章统计 日程模块:收租日程显示等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
}//zuke删除自己的已处理报障记录@RequestMapping("/zukedeletesolve")public String zukedeletesolve(Integer id){solveService.deletesolve(id);return "redirect:findmypaid.action";}//租客跳到我要报障页面@RequestMapping("/showaddwrong")public String showaddwrong(HttpSession httpSession,Model model,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize)throws Exception{User user1= (User) httpSession.getAttribute("user");Userlist userlist=userlistService.findhasuserlist(user1.getId());PageHelper.startPage(page, pageSize);List<Zulist> list=zulistService.findzulistbyuid(userlist.getId());PageInfo<Zulist> p=new PageInfo<Zulist>(list);model.addAttribute("zulist", list);model.addAttribute("p", p);model.addAttribute("mainPage", "showaddwrong.jsp");return "zuke/main";
//管理员查找所有已处理的报障@RequestMapping("/selectall")public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "solve.jsp");model.addAttribute("vo", vo);return "admin/main1";
}}else{String error="error";model.addAttribute("error", error);return "login";}}@RequestMapping("/toindex")public String toindex(Model model) throws Exception{return "admin/index";}}合同信息控制层:@Controller@RequestMapping("/hetong")public class HetongController {@Autowired
model.addAttribute("zulist", list);model.addAttribute("p", p);model.addAttribute("mainPage", "showaddwrong.jsp");return "zuke/main";}//点击报障后跳转到添加报障信息页面@RequestMapping("/addwrong")public String addwrong(Integer id,Model model){Zulist zulist=paidService.findzukezulist(id);model.addAttribute("zulist", zulist);model.addAttribute("mainPage", "addwrong.jsp");return "zuke/main";}//添加报障信息到wrong表@RequestMapping("/insertwrong")public String insertwrong(Wrong wrong,Model model){solveService.insertwrong(wrong);model.addAttribute("error","insertwrong");
checkout.setHouse_id(house_id);checkout.setAddress(zulist.getAddress());checkout.setStatus("已退租");checkout.setUserlist_id(zulist.getUserlist_id());checkoutService.insertcheckout(checkout);houselistService.deletehousebyhouseid(house_id);zulistService.deletezulist(house_id);model.addAttribute("error", "checkoutsuccess");return "redirect:/zulist/findzulist.action";}
Userlist userlist=userlistService.findhasuserlist(user1.getId());vo.setUserlist_id(userlist.getId());PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "mysolve.jsp");model.addAttribute("vo", vo);return "zuke/main";}//管理员删除已处理报障记录@RequestMapping("/deletesolve")public String deletesolve(Integer id){solveService.deletesolve(id);return "redirect:selectall.action";}//zuke删除自己的已处理报障记录@RequestMapping("/zukedeletesolve")
Zulist zulist=paidService.findzukezulist(id);model.addAttribute("zulist", zulist);model.addAttribute("mainPage", "addwrong.jsp");return "zuke/main";}//添加报障信息到wrong表@RequestMapping("/insertwrong")public String insertwrong(Wrong wrong,Model model){solveService.insertwrong(wrong);model.addAttribute("error","insertwrong");
model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "updatehetong.jsp");return "admin/main1";}@RequestMapping("/changehetong")public String changehetong(Hetong hetong){hetongService.updatehetong(hetong);return "redirect:/zulist/findzulist.action";}//终止合同操作:删除合同,插入已退租列表,删除在租列表,删除房屋列表@RequestMapping("/deletehetong")
}}@RequestMapping("/toindex")public String toindex(Model model) throws Exception{return "admin/index";}}合同信息控制层:@Controller@RequestMapping("/hetong")public class HetongController {@Autowiredprivate HetongService hetongService;@Autowired
@Autowiredprivate ZulistService zulistService;//管理员查找所有已处理的报障@RequestMapping("/selectall")public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "solve.jsp");model.addAttribute("vo", vo);return "admin/main1";}//租客查找自己已处理的报障@RequestMapping("/findmysolve")public String findmysolve(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){User user1= (User) httpSession.getAttribute("user");
return "zuke/main";}//管理员删除已处理报障记录@RequestMapping("/deletesolve")public String deletesolve(Integer id){solveService.deletesolve(id);return "redirect:selectall.action";}//zuke删除自己的已处理报障记录@RequestMapping("/zukedeletesolve")public String zukedeletesolve(Integer id){solveService.deletesolve(id);return "redirect:findmypaid.action";}//租客跳到我要报障页面@RequestMapping("/showaddwrong")public String showaddwrong(HttpSession httpSession,Model model,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize)throws Exception{User user1= (User) httpSession.getAttribute("user");
@Autowiredprivate HetongService hetongService;@Autowiredprivate HouselistService houselistService;@Autowiredprivate ApplyService applyService;@Autowiredprivate ZulistService zulistService;@Autowiredprivate CheckoutService checkoutService;//新增合同信息,修改房屋列表的状态,从申请列表中删除,增添到租赁列表当中@RequestMapping("/inserthetong")public String inserthetong(Model model,Hetong hetong){//新增合同信息hetongService.inserthetong(hetong);Hetong hetong1=hetongService.findhetong(hetong.getHouse_id());//修改房屋列表状态Houselist houselist=houselistService.findhouseid(hetong1.getHouse_id());houselist.setStatus("已租赁");houselistService.updatehousestatus(houselist);//添加到租赁列表当中Zulist zulist=new Zulist();Apply apply=applyService.findbyhouse_id(hetong.getHouse_id());
}//管理员查看所有未处理报障@RequestMapping("/wronglist")public String wronglist(Model model,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){QueryVo vo=new QueryVo();PageHelper.startPage(page, pageSize);List<Wrong> list=solveService.findwrong(vo);PageInfo<Wrong> p=new PageInfo<Wrong>(list);model.addAttribute("wrong", list);model.addAttribute("p", p);model.addAttribute("mainPage", "wrong.jsp");return "admin/main1";}//租客查看自己的未处理报障@RequestMapping("/mywronglist")public String mywronglist(Model model,HttpSession httpSession,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){User user1= (User) httpSession.getAttribute("user");
private HetongService hetongService;@Autowiredprivate HouselistService houselistService;@Autowiredprivate ApplyService applyService;@Autowiredprivate ZulistService zulistService;@Autowiredprivate CheckoutService checkoutService;//新增合同信息,修改房屋列表的状态,从申请列表中删除,增添到租赁列表当中@RequestMapping("/inserthetong")public String inserthetong(Model model,Hetong hetong){//新增合同信息hetongService.inserthetong(hetong);Hetong hetong1=hetongService.findhetong(hetong.getHouse_id());//修改房屋列表状态Houselist houselist=houselistService.findhouseid(hetong1.getHouse_id());
@RequestMapping("/zukeseehetong")public String zukeseehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "showhetong.jsp");return "zuke/main";}}处理的报障控制层:@Controller@RequestMapping("/wrong")public class WrongController {@Autowiredprivate SolveService solveService;@Autowiredprivate UserlistService userlistService;@Autowiredprivate PaidService paidService;@Autowiredprivate ZulistService zulistService;
model.addAttribute("error", "checkoutsuccess");return "redirect:/zulist/findzulist.action";}@RequestMapping("/zukeseehetong")public String zukeseehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "showhetong.jsp");return "zuke/main";}}
model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "mysolve.jsp");model.addAttribute("vo", vo);return "zuke/main";}//管理员删除已处理报障记录@RequestMapping("/deletesolve")public String deletesolve(Integer id){solveService.deletesolve(id);return "redirect:selectall.action";}//zuke删除自己的已处理报障记录@RequestMapping("/zukedeletesolve")public String zukedeletesolve(Integer id){solveService.deletesolve(id);return "redirect:findmypaid.action";}
private SolveService solveService;@Autowiredprivate UserlistService userlistService;@Autowiredprivate PaidService paidService;@Autowiredprivate ZulistService zulistService;//管理员查找所有已处理的报障@RequestMapping("/selectall")public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);
//新增合同信息hetongService.inserthetong(hetong);Hetong hetong1=hetongService.findhetong(hetong.getHouse_id());//修改房屋列表状态Houselist houselist=houselistService.findhouseid(hetong1.getHouse_id());houselist.setStatus("已租赁");houselistService.updatehousestatus(houselist);//添加到租赁列表当中Zulist zulist=new Zulist();Apply apply=applyService.findbyhouse_id(hetong.getHouse_id());zulist.setHouse_id(hetong.getHouse_id());zulist.setUserlist_id(apply.getUserlist_id());zulist.setContract_id(hetong1.getId());zulist.setPrice(apply.getPrice());zulist.setAddress(apply.getAddress());zulistService.insertzulist(zulist);//从申请列表中删除applyService.deletebyhouse_id(hetong1.getHouse_id());
model.addAttribute("mainPage", "hetong.jsp");return "admin/main1";}@RequestMapping("/updatehetong")public String updatehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "updatehetong.jsp");return "admin/main1";}@RequestMapping("/changehetong")public String changehetong(Hetong hetong){hetongService.updatehetong(hetong);return "redirect:/zulist/findzulist.action";
model.addAttribute("mainPage", "solve.jsp");model.addAttribute("vo", vo);return "admin/main1";}//租客查找自己已处理的报障@RequestMapping("/findmysolve")public String findmysolve(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){User user1= (User) httpSession.getAttribute("user");Userlist userlist=userlistService.findhasuserlist(user1.getId());vo.setUserlist_id(userlist.getId());PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);
hetongService.deletehetong(house_id);Zulist zulist=zulistService.findzulist(house_id);Checkout checkout=new Checkout();checkout.setHouse_id(house_id);checkout.setAddress(zulist.getAddress());checkout.setStatus("已退租");checkout.setUserlist_id(zulist.getUserlist_id());checkoutService.insertcheckout(checkout);houselistService.deletehousebyhouseid(house_id);zulistService.deletezulist(house_id);model.addAttribute("error", "checkoutsuccess");return "redirect:/zulist/findzulist.action";}@RequestMapping("/zukeseehetong")public String zukeseehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "showhetong.jsp");
@Controllerpublic class UserController {@Autowiredprivate UserService userService;@RequestMapping("/login")public String userList() throws Exception{return "login";}@RequestMapping("/logincheck")public String login(User user,Model model,HttpSession httpSession) throws Exception{User user1=userService.login(user);if(user1!=null){
model.addAttribute("mainPage", "solve.jsp");model.addAttribute("vo", vo);return "admin/main1";}//租客查找自己已处理的报障@RequestMapping("/findmysolve")public String findmysolve(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){User user1= (User) httpSession.getAttribute("user");Userlist userlist=userlistService.findhasuserlist(user1.getId());vo.setUserlist_id(userlist.getId());PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);PageInfo<Solve> p=new PageInfo<Solve>(list);Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "mysolve.jsp");model.addAttribute("vo", vo);
Integer count=solveService.selectcount(vo);model.addAttribute("solve", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("mainPage", "solve.jsp");model.addAttribute("vo", vo);return "admin/main1";}//租客查找自己已处理的报障@RequestMapping("/findmysolve")public String findmysolve(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,@RequestParam(required=false,defaultValue="6") Integer pageSize){User user1= (User) httpSession.getAttribute("user");Userlist userlist=userlistService.findhasuserlist(user1.getId());vo.setUserlist_id(userlist.getId());PageHelper.startPage(page, pageSize);List<Solve> list=solveService.selectall(vo);
houselist.setStatus("已租赁");houselistService.updatehousestatus(houselist);//添加到租赁列表当中Zulist zulist=new Zulist();Apply apply=applyService.findbyhouse_id(hetong.getHouse_id());zulist.setHouse_id(hetong.getHouse_id());zulist.setUserlist_id(apply.getUserlist_id());zulist.setContract_id(hetong1.getId());zulist.setPrice(apply.getPrice());zulist.setAddress(apply.getAddress());zulistService.insertzulist(zulist);//从申请列表中删除applyService.deletebyhouse_id(hetong1.getHouse_id());model.addAttribute("error", "zusuccess");return "redirect:/zulist/findzulist.action";}@RequestMapping("/seehetong")public String seehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);
houselist.setStatus("已租赁");houselistService.updatehousestatus(houselist);//添加到租赁列表当中Zulist zulist=new Zulist();Apply apply=applyService.findbyhouse_id(hetong.getHouse_id());zulist.setHouse_id(hetong.getHouse_id());zulist.setUserlist_id(apply.getUserlist_id());zulist.setContract_id(hetong1.getId());zulist.setPrice(apply.getPrice());zulist.setAddress(apply.getAddress());zulistService.insertzulist(zulist);
Checkout checkout=new Checkout();checkout.setHouse_id(house_id);checkout.setAddress(zulist.getAddress());checkout.setStatus("已退租");checkout.setUserlist_id(zulist.getUserlist_id());checkoutService.insertcheckout(checkout);houselistService.deletehousebyhouseid(house_id);zulistService.deletezulist(house_id);model.addAttribute("error", "checkoutsuccess");return "redirect:/zulist/findzulist.action";}@RequestMapping("/zukeseehetong")public String zukeseehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "showhetong.jsp");return "zuke/main";}
applyService.deletebyhouse_id(hetong1.getHouse_id());model.addAttribute("error", "zusuccess");return "redirect:/zulist/findzulist.action";}@RequestMapping("/seehetong")public String seehetong(String house_id,Model model){Hetong hetong=hetongService.findhetong(house_id);model.addAttribute("hetong", hetong);model.addAttribute("mainPage", "hetong.jsp");return "admin/main1";}@RequestMapping("/updatehetong")public String updatehetong(String house_id,Model model){
如果觉得《基于javaweb+jsp房屋租赁系统(java+SSM+jsp+mysql+maven)》对你有帮助,请点赞、收藏,并留下你的观点哦!