源码获取:博客首页 "资源" 里下载!
主要功能描述:
1.登录管理:主要有管理员登录和租客登录
2.房源列表以及添加房源功能:
3.租赁合同管理以及在租房源和已退租房源信息管理:
4.看房申请和退租申请管理:
5.故障报修申请和处理:
6.租金缴纳和收租信息管理:
7.行程安排管理:
8.租客信息查看管理:
给大家截取一部分功能图吧
房源列表:
合同管理:
看房以及退租管理:
故障报修处理:
收租管理:
系统代码架构:
报障信息处理控制层:
@Controller
@RequestMapping("/wrong")
public class WrongController {
@Autowired
private SolveService solveService;
@Autowired
private UserlistService userlistService;
@Autowired
private PaidService paidService;
@Autowired
private 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");
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")
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("/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");
return "redirect:showaddwrong.action";
}
//管理员查看所有未处理报障
@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");
Userlist userlist=userlistService.findhasuserlist(user1.getId());
QueryVo vo=new QueryVo();
vo.setUserlist_id(userlist.getId());
PageHelper.startPage(page, pageSize);
List<Wrong> list=solveService.findwrong(vo);
PageInfo<Wrong> p=new PageInfo<Wrong>(list);
model.addAttribute("p", p);
model.addAttribute("wrong",list);
model.addAttribute("mainPage", "mywrong.jsp");
return "zuke/main";
}
//管理员处理报障
@RequestMapping("/gotosolve")
public String gotosolve(Integer id,Model model){
Wrong wrong=solveService.findbyid(id);
Solve solve=new Solve();
solve.setHouse_id(wrong.getHouse_id());
solve.setAddress(wrong.getAddress());
solve.setDate(wrong.getDate());
solve.setDetail(wrong.getDetail());
solve.setName(wrong.getName());
solve.setUserlist_id(wrong.getUserlist_id());
solve.setStatus("已处理");
solveService.gotosolve(id, solve);
model.addAttribute("error", "duesucess");
return "redirect:selectall.action";
}
}
用户信息控制层:
@Controller
public class UserlistController {
@Autowired
private UserlistService userlistService;
@RequestMapping("/findhasuserlist")
public String findhasuserlist(HttpSession httpSession,Model model) throws Exception{
User user1= (User) httpSession.getAttribute("user");
Integer user_id=user1.getId();
Userlist userlist=userlistService.findhasuserlist(user_id);
model.addAttribute("userlist", userlist);
model.addAttribute("mainPage", "updateuserlist.jsp");
return "zuke/main";
}
//查找并更新用户信息
@RequestMapping("/checkuserlist")
public String checkuserlist(Model model,Userlist userlist,HttpSession httpSession) throws Exception{
if(userlist.getId()==null){
String idcard=userlist.getIdcard();
Userlist list=userlistService.checkuserlist(idcard);
if(list!=null){
model.addAttribute("error", "该身份证已被绑定,一个身份证号码只能被一个账户绑定!");
model.addAttribute("mainPage", "updateuserlist.jsp");
model.addAttribute("userlist", userlist);
}else{
User user1= (User) httpSession.getAttribute("user");
Integer user_id=user1.getId();
userlist.setUser_id(user_id);
userlistService.insertuserlist(userlist);
Userlist list1=userlistService.checkuserlist(idcard);
model.addAttribute("error", "资料完善成功");
model.addAttribute("mainPage", "updateuserlist.jsp");
model.addAttribute("userlist", list1);
}
}
else{
Userlist list=userlistService.finduserlistupdate(userlist);
if(list!=null){
model.addAttribute("error", "该身份证号码已被绑定");
model.addAttribute("mainPage", "updateuserlist.jsp");
model.addAttribute("userlist", userlist);
}else{
userlistService.updateuserlist(userlist);
model.addAttribute("error", "更新成功");
model.addAttribute("mainPage", "updateuserlist.jsp");
model.addAttribute("userlist", userlist);
}
}
return "zuke/main";
}
@RequestMapping("/findalluserlist")
public String findalluserlist(Model model ,@RequestParam(required=false,defaultValue="1") Integer page,
@RequestParam(required=false,defaultValue="6") Integer pageSize) {
PageHelper.startPage(page, pageSize);
List<Userlist> userlist=userlistService.findalluserlist();
PageInfo<Userlist> p=new PageInfo<Userlist>(userlist);
model.addAttribute("userlist", userlist);
model.addAttribute("p", p);
model.addAttribute("mainPage", "userlist.jsp");
return "admin/main1";
}
//删除用户信息
@RequestMapping("/deleteuserlist")
public String deleteuserlist(Model model,Integer id) {
userlistService.deleteuserlist(id);
model.addAttribute("error", "deletesuccess");
return "redirect:findalluserlist.action";
}
}
合同信息控制层:
@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";
}
}
源码获取:博客首页 "资源" 里下载!