Java房屋租赁系统的实现流程
短信预约 -IT技能 免费直播动态提醒
一、项目简述
功能: 房源信息模块:房源信息展示、房源信息更新、房源信息 增加、房源信息删除 账户管理模块:账户登录、账户绑定、账户管理 租金结算模块:每月租金信息、租金交付功能、月租金收 入总^^克计 房屋租赁合同管理模块:房屋租赁合同录入、房屋租赁合 同展示、房屋租赁价格修改、房屋租赁合同终止 报障模块:租客报账、管理员报障审核、租客报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 房屋租赁系统的资料请关注编程网其它相关文章!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341