Java 房屋租赁系统的实现流程
程序员文章站
2022-06-15 18:10:28
一、项目简述功能: 房源信息模块:房源信息展示、房源信息更新、房源信息 增加、房源信息删除 账户管理模块:账户登录、账户绑定、账户管理 租金结算模块:每月租金信息、租金交付功能、月租金收 入总^^克计...
一、项目简述
功能: 房源信息模块:房源信息展示、房源信息更新、房源信息 增加、房源信息删除 账户管理模块:账户登录、账户绑定、账户管理 租金结算模块:每月租金信息、租金交付功能、月租金收 入总^^克计 房屋租赁合同管理模块:房屋租赁合同录入、房屋租赁合 同展示、房屋租赁价格修改、房屋租赁合同终止 报障模块:租客报账、管理员报障审核、租客报b章统计 日程模块:收租日程显示等。
二、项目运行
环境配置: jdk1.8 + tomcat8.5 + mysql + eclispe (intellij idea,eclispe,myeclispe,sts 都支持)
项目技术: jsp +spring + springmvc + mybatis + html+ css + javascript + jquery + ajax + layui+ maven等等。
用户信息控制层:
@controller public class usercontroller { @autowired private 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){ httpsession.setattribute("user", user1); if(user1.gettype().equals("zuke")){ return "zuke/main"; } else{ 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("/schedule") public class schedulecontroller { @autowired private scheduleservice scheduleservice; @requestmapping("/selectall") public string selectall(model model ,@requestparam(required=false,defaultvalue="1") integer page, @requestparam(required=false,defaultvalue="6") integer pagesize){ pagehelper.startpage(page, pagesize); list<schedule> schedule=scheduleservice.selectall(); pageinfo<schedule> p=new pageinfo<schedule>(schedule); model.addattribute("schedule", schedule); model.addattribute("p", p); model.addattribute("mainpage", "schedule.jsp"); return "admin/main1"; } @requestmapping("/deleteschedule") public string deleteschedule(integer id){ scheduleservice.deleteschedule(id); return "redirect:selectall.action"; } @requestmapping("/insertschedule") public string insertschedule(schedule schedule,model model){ scheduleservice.insertschedule(schedule); return "redirect:selectall.action"; } @requestmapping("/updateschedule") public string updateschedule(schedule schedule,model model){ scheduleservice.updateschedule(schedule); model.addattribute("error", "更新成功"); model.addattribute("schedule", schedule); model.addattribute("mainpage", "updateschedule.jsp"); return "admin/main1"; } @requestmapping("/toinsert") public string toinsert(model model){ model.addattribute("mainpage", "addschedule.jsp"); return "admin/main1"; } @requestmapping("/toupdate") public string toupdate(model model,integer id){ schedule schedule=scheduleservice.selectbyid(id); model.addattribute("schedule", schedule); model.addattribute("mainpage", "updateschedule.jsp"); return "admin/main1"; } }
房屋列表信息控制器:
@controller public class houstlistcontroller { @autowired private houselistservice houselistservice; @requestmapping("/houselist") public string houselist(model model ,@requestparam(required=false,defaultvalue="1") integer page, @requestparam(required=false,defaultvalue="6") integer pagesize){ pagehelper.startpage(page, pagesize); list<houselist> houselist=houselistservice.selectall(); pageinfo<houselist> p=new pageinfo<houselist>(houselist); model.addattribute("p", p); model.addattribute("houselist",houselist); model.addattribute("mainpage","houselist.jsp"); return "zuke/main"; } @requestmapping("/ahouselist") public string ahouselist(model model ,@requestparam(required=false,defaultvalue="1") integer page, @requestparam(required=false,defaultvalue="6") integer pagesize){ pagehelper.startpage(page, pagesize); list<houselist> houselist=houselistservice.selectall(); pageinfo<houselist> p=new pageinfo<houselist>(houselist); model.addattribute("p", p); model.addattribute("houselist",houselist); model.addattribute("mainpage","ahouselist.jsp"); return "admin/main1"; } @requestmapping("/addhouse") public string addhouse(model model ,houselist houselist){ string houseid=houselist.gethouseid(); houselist houselist1=houselistservice.findhouseid(houseid); if(houselist1!=null){ model.addattribute("error","该房屋id已存在"); model.addattribute("houselist",houselist); model.addattribute("mainpage","addhouse.jsp"); return "admin/main1"; }else{ model.addattribute("error","添加成功"); houselistservice.inserthouse(houselist); model.addattribute("houselist",houselist); model.addattribute("mainpage","addhouse.jsp"); return "admin/main1"; } } @requestmapping("/toaddhouse") public string toaddhoust(model model){ model.addattribute("mainpage","addhouse.jsp"); return "admin/main1"; } @requestmapping("/deletehouse") public string deletehouse(integer id){ houselistservice.deletehouse(id); return "redirect:ahouselist.action"; } @requestmapping("/toahouselist") public string toahouselist(){ return "ahouselist.action"; } @requestmapping("/findid") public string findid(integer id,model model){ houselist list=houselistservice.findid(id); model.addattribute("houselist",list); model.addattribute("mainpage", "changehouse.jsp"); return "admin/main1"; } @requestmapping("/findhouseidupdate") public string findhouseidupdate(houselist houselist,model model){ houselist list=houselistservice.findhouseidupdate(houselist); if(list!=null){ model.addattribute("houselist",houselist); model.addattribute("mainpage", "changehouse.jsp"); model.addattribute("error","该房屋id已存在"); return "admin/main1"; } else{ houselistservice.updatehouse(houselist); model.addattribute("houselist",houselist); model.addattribute("mainpage", "changehouse.jsp"); model.addattribute("error","更新成功"); return "admin/main1"; } } }
合同控制器:
@controller @requestmapping("/hetong") public class hetongcontroller { @autowired private hetongservice hetongservice; @autowired private houselistservice houselistservice; @autowired private applyservice applyservice; @autowired private zulistservice zulistservice; @autowired private 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()); 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); model.addattribute("hetong", hetong); 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"; } //终止合同操作:删除合同,插入已退租列表,删除在租列表,删除房屋列表 @requestmapping("/deletehetong") public string deletehetong(string house_id,model model){ 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"); return "zuke/main"; } }
以上就是java 房屋租赁系统的实现流程的详细内容,更多关于java 房屋租赁系统的资料请关注其它相关文章!
上一篇: shell之创建文件及内容的方法示例
下一篇: Java基于NIO实现聊天室功能