赞
踩
ssm房屋租赁系统
运行工具:idea或eclipse均测试,可以运行。
开发技术: 后端ssm(spring springmvc mybatis) 前端:jsp jquery
数据库:mysql5.7
应用服务器: tomcat7.8.9均可
jdk1.8
源码下载地址:https://share.weiyun.com/NWAkKjbE
视频演示:
白嫖项目基于ssm房屋租赁系统源码【开源项目】
http://localhost:8080/text2/login.action
登录路径
action可以在web.xml修改后缀。
登录账号密码在数据库里面
sql脚本:
- /*
- Navicat MySQL Data Transfer
-
- Source Server : chicken
- Source Server Version : 50626
- Source Host : localhost:3306
- Source Database : zu
-
- Target Server Type : MYSQL
- Target Server Version : 50626
- File Encoding : 65001
-
- Date: 2022-10-10 21:56:34
- */
-
- SET FOREIGN_KEY_CHECKS=0;
-
- -- ----------------------------
- -- Table structure for apply
- -- ----------------------------
- DROP TABLE IF EXISTS `apply`;
- CREATE TABLE `apply` (
- `apply_id` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) NOT NULL,
- `address` varchar(255) DEFAULT NULL,
- `area` double(255,0) DEFAULT NULL,
- `price` double(10,2) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- `userlist_id` int(255) NOT NULL,
- PRIMARY KEY (`apply_id`,`house_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of apply
- -- ----------------------------
-
- -- ----------------------------
- -- Table structure for applyout
- -- ----------------------------
- DROP TABLE IF EXISTS `applyout`;
- CREATE TABLE `applyout` (
- `aoid` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- PRIMARY KEY (`aoid`)
- ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of applyout
- -- ----------------------------
- INSERT INTO `applyout` VALUES ('3', 'b1', '桃源居', '已拒绝', '10');
- INSERT INTO `applyout` VALUES ('6', 'k2', '贝岗街18号', '已拒绝', '15');
-
- -- ----------------------------
- -- Table structure for checkout
- -- ----------------------------
- DROP TABLE IF EXISTS `checkout`;
- CREATE TABLE `checkout` (
- `cid` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- PRIMARY KEY (`cid`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of checkout
- -- ----------------------------
- INSERT INTO `checkout` VALUES ('2', 'k2', '贝岗街18号', '已退租', '15');
- INSERT INTO `checkout` VALUES ('3', 'c1', '广药1-364', '已退租', '10');
-
- -- ----------------------------
- -- Table structure for hetong
- -- ----------------------------
- DROP TABLE IF EXISTS `hetong`;
- CREATE TABLE `hetong` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `chuzu` varchar(255) DEFAULT NULL,
- `chuzu_idcard` varchar(255) DEFAULT NULL,
- `zuke` varchar(255) DEFAULT NULL,
- `zuke_idcard` varchar(255) DEFAULT NULL,
- `fromdate` varchar(255) DEFAULT NULL,
- `todate` varchar(255) DEFAULT NULL,
- `price` double(10,2) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `house_id` varchar(255) DEFAULT NULL,
- `payday` int(11) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of hetong
- -- ----------------------------
- INSERT INTO `hetong` VALUES ('5', '张三', '440411199208018201', '李四', '440421199509088888', '2022-09-01', '2022-09-14', '900.00', '菊花园', 'c3', '2');
-
- -- ----------------------------
- -- Table structure for houselist
- -- ----------------------------
- DROP TABLE IF EXISTS `houselist`;
- CREATE TABLE `houselist` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `houseid` varchar(255) NOT NULL,
- `address` varchar(255) NOT NULL,
- `area` double DEFAULT NULL,
- `price` double(10,2) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`,`houseid`)
- ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of houselist
- -- ----------------------------
- INSERT INTO `houselist` VALUES ('16', 'c3', '菊花园1-364', '60', '700.00', '已租赁');
- INSERT INTO `houselist` VALUES ('17', 'k1', '东风街13号', '63.2', '1300.00', '已租赁');
- INSERT INTO `houselist` VALUES ('20', 'b5', '穗石村18号', '60', '700.00', '未租赁');
- INSERT INTO `houselist` VALUES ('21', 'k8', '穗石村1号', '66', '800.00', '未租赁');
-
- -- ----------------------------
- -- Table structure for paid
- -- ----------------------------
- DROP TABLE IF EXISTS `paid`;
- CREATE TABLE `paid` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `price` double(10,2) DEFAULT NULL,
- `date` date DEFAULT NULL,
- `paydate` date DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of paid
- -- ----------------------------
- INSERT INTO `paid` VALUES ('5', 'c1', '广药1-364', '500.00', '2022-09-14', '2022-09-27', '赵颖欣', '10', '租金已缴');
- INSERT INTO `paid` VALUES ('6', 'c3', '菊花园1-364', '700.00', '2022-09-30', '2022-09-28', '李四', '12', '租金已缴');
- INSERT INTO `paid` VALUES ('7', 'c2', '碧桂园1-364', '4365.00', '2022-10-31', '2022-10-08', '张三', '14', '租金已缴');
- INSERT INTO `paid` VALUES ('8', 'k2', '贝岗街18号', '700.00', '2022-10-31', '2022-10-10', '张思', '15', '租金已缴');
- INSERT INTO `paid` VALUES ('9', 'c1', '广药1-364', '5000.00', '2022-10-31', '2022-10-10', '赵颖欣', '10', '租金已缴');
-
- -- ----------------------------
- -- Table structure for schedule
- -- ----------------------------
- DROP TABLE IF EXISTS `schedule`;
- CREATE TABLE `schedule` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `date` varchar(255) DEFAULT NULL,
- `content` text,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of schedule
- -- ----------------------------
- INSERT INTO `schedule` VALUES ('2', '2022-09-08', '收数');
- INSERT INTO `schedule` VALUES ('3', '2022-09-20', '今天是收租日');
-
- -- ----------------------------
- -- Table structure for solve
- -- ----------------------------
- DROP TABLE IF EXISTS `solve`;
- CREATE TABLE `solve` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `date` date DEFAULT NULL,
- `detail` text,
- `name` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of solve
- -- ----------------------------
- INSERT INTO `solve` VALUES ('4', 'c1', '广药1-364', '2022-09-08', 'kk', '赵颖欣', '10', '已处理');
- INSERT INTO `solve` VALUES ('5', 'c3', '菊花园1-364', '2022-09-28', '天花板漏水', '李四', '12', '已处理');
- INSERT INTO `solve` VALUES ('6', 'c2', '碧桂园1-364', '2022-10-08', '窗户坏了', '张三', '14', '已处理');
- INSERT INTO `solve` VALUES ('7', 'k2', '贝岗街18号', '2022-10-10', '天花板漏水', '张思', '15', '已处理');
- INSERT INTO `solve` VALUES ('8', 'c1', '广药1-364', '2022-10-09', '空调漏水', '赵颖欣', '10', '已处理');
-
- -- ----------------------------
- -- Table structure for topaid
- -- ----------------------------
- DROP TABLE IF EXISTS `topaid`;
- CREATE TABLE `topaid` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `price` double(10,2) DEFAULT NULL,
- `date` date DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of topaid
- -- ----------------------------
-
- -- ----------------------------
- -- Table structure for user
- -- ----------------------------
- DROP TABLE IF EXISTS `user`;
- CREATE TABLE `user` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `username` varchar(255) DEFAULT NULL,
- `password` varchar(255) DEFAULT NULL,
- `type` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of user
- -- ----------------------------
- INSERT INTO `user` VALUES ('1', 'admin', '123456', 'admin');
- INSERT INTO `user` VALUES ('2', '赵颖欣', '12345', 'zuke');
- INSERT INTO `user` VALUES ('3', 'zyx', '12345', 'zuke');
- INSERT INTO `user` VALUES ('5', 'cwy', '12345', 'zuke');
-
- -- ----------------------------
- -- Table structure for userlist
- -- ----------------------------
- DROP TABLE IF EXISTS `userlist`;
- CREATE TABLE `userlist` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(255) DEFAULT NULL,
- `idcard` varchar(255) NOT NULL,
- `phone` varchar(255) DEFAULT NULL,
- `user_id` int(11) NOT NULL,
- PRIMARY KEY (`id`,`idcard`)
- ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of userlist
- -- ----------------------------
- INSERT INTO `userlist` VALUES ('12', '李四', '440421199509088888', '18826107777', '3');
- INSERT INTO `userlist` VALUES ('15', '张思', '441601199312214414', '159192134000', '5');
-
- -- ----------------------------
- -- Table structure for wrong
- -- ----------------------------
- DROP TABLE IF EXISTS `wrong`;
- CREATE TABLE `wrong` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `date` date DEFAULT NULL,
- `detail` text,
- `name` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) DEFAULT NULL,
- `status` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of wrong
- -- ----------------------------
-
- -- ----------------------------
- -- Table structure for zulist
- -- ----------------------------
- DROP TABLE IF EXISTS `zulist`;
- CREATE TABLE `zulist` (
- `zid` int(11) NOT NULL AUTO_INCREMENT,
- `house_id` varchar(255) NOT NULL,
- `price` double(10,2) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `userlist_id` int(11) NOT NULL,
- `contract_id` int(11) NOT NULL,
- PRIMARY KEY (`zid`,`house_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-
- -- ----------------------------
- -- Records of zulist
- -- ----------------------------
- INSERT INTO `zulist` VALUES ('7', 'c3', '700.00', '菊花园1-364', '12', '5');
- SET FOREIGN_KEY_CHECKS=1;
核心代码1:
-
- package controller;
-
- import java.util.List;
-
- import javax.servlet.http.HttpSession;
-
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
-
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
-
- import Pojo.Houselist;
- import Pojo.Paid;
- import Pojo.QueryVo;
- import Pojo.Topaid;
- import Pojo.User;
- import Pojo.Userlist;
- import Pojo.Zulist;
- import service.PaidService;
- import service.TopaidService;
- import service.UserlistService;
- import java.text.SimpleDateFormat;
- import java.util.Date;;
-
- @Controller
- @RequestMapping("/paid")
- public class PaidController {
- @Autowired
- private PaidService paidService;
- @Autowired
- private TopaidService topaidService;
- @Autowired
- private UserlistService userlistService;
- //管理员查找所有已缴租金列表
- @RequestMapping("/selectall")
- public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
- @RequestParam(required=false,defaultValue="2") Integer pageSize){
- PageHelper.startPage(page, pageSize);
- List<Paid> list=paidService.selectall(vo);
- PageInfo<Paid> p=new PageInfo<Paid>(list);
- Double sum=paidService.selectsum(vo);
- model.addAttribute("paid", list);
- model.addAttribute("sum", sum);
- model.addAttribute("p", p);
- model.addAttribute("mainPage", "paid.jsp");
- model.addAttribute("vo", vo);
- return "admin/main1";
- }
- //租客查找自己已缴租金列表
- @RequestMapping("/findmypaid")
- public String findmypaid(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
- @RequestParam(required=false,defaultValue="2") Integer pageSize){
- User user1= (User) httpSession.getAttribute("user");
- Userlist userlist=userlistService.findhasuserlist(user1.getId());
- if(userlist!=null){
- vo.setUserlist_id(userlist.getId());
- }
- PageHelper.startPage(page, pageSize);
- List<Paid> list=paidService.selectall(vo);
- PageInfo<Paid> p=new PageInfo<Paid>(list);
- Double sum=paidService.selectsum(vo);
- model.addAttribute("paid", list);
- model.addAttribute("sum", sum);
- model.addAttribute("p", p);
- model.addAttribute("mainPage", "mypaid.jsp");
- model.addAttribute("vo", vo);
- return "zuke/main";
- }
- //管理员删除已缴租金记录
- @RequestMapping("/deletepaid")
- public String deletepaid(Integer id){
- paidService.deletepaid(id);
- return "redirect:selectall.action";
- }
- //zuke删除已缴租金记录
- @RequestMapping("/zukedeletepaid")
- public String zukedeletepaid(Integer id){
- paidService.deletepaid(id);
- return "redirect:findmypaid.action";
- }
- //跳到我要收租页面
- @RequestMapping("/showaddpaid")
- public String showaddpaid(Model model,@RequestParam(required=false,defaultValue="1") Integer page,
- @RequestParam(required=false,defaultValue="2") Integer pageSize)throws Exception{
- PageHelper.startPage(page, pageSize);
- List<Zulist> list=paidService.findzuuserlist();
- PageInfo<Zulist> p=new PageInfo<Zulist>(list);
- model.addAttribute("zulist", list);
- model.addAttribute("p", p);
- model.addAttribute("mainPage", "showaddpaid.jsp");
- return "admin/main1";
- }
- //点击收租后跳转到添加租金信息页面
- @RequestMapping("/addpaid")
- public String addpaid(Integer id,Model model){
- Zulist zulist=paidService.findzukezulist(id);
- model.addAttribute("zulist", zulist);
- model.addAttribute("mainPage", "addpaid.jsp");
- return "admin/main1";
- }
- //添加租金信息到topaid表
- @RequestMapping("/inserttopaid")
- public String inserttopaid(Topaid topaid,Model model){
- topaidService.inserttopaid(topaid);
- model.addAttribute("error","inserttopaid");
-
- return "redirect:showaddpaid.action";
- }
- //管理员查看所有未缴租金信息
- @RequestMapping("/topaidlist")
- public String topaidlist(Model model,@RequestParam(required=false,defaultValue="1") Integer page,
- @RequestParam(required=false,defaultValue="2") Integer pageSize){
- QueryVo vo=new QueryVo();
- PageHelper.startPage(page, pageSize);
- List<Topaid> list=topaidService.findtopaid(vo);
- PageInfo<Topaid> p=new PageInfo<Topaid>(list);
- model.addAttribute("topaid", list);
- model.addAttribute("p", p);
- model.addAttribute("mainPage", "topaid.jsp");
- return "admin/main1";
- }
- //租客查看自己的未缴租金
- @RequestMapping("/mytopaidlist")
- public String mytopaidlist(Model model,HttpSession httpSession,@RequestParam(required=false,defaultValue="1") Integer page,
- @RequestParam(required=false,defaultValue="2") Integer pageSize){
- User user1= (User) httpSession.getAttribute("user");
- Userlist userlist=userlistService.findhasuserlist(user1.getId());
- QueryVo vo=new QueryVo();
- if(userlist!=null){
- vo.setUserlist_id(userlist.getId());
- }
- PageHelper.startPage(page, pageSize);
- List<Topaid> topaid=topaidService.findtopaid(vo);
- PageInfo<Topaid> p=new PageInfo<Topaid>(topaid);
- model.addAttribute("p", p);
- model.addAttribute("topaid",topaid);
- model.addAttribute("mainPage", "mytopaid.jsp");
- return "zuke/main";
- }
- //租客进行支付操作
- @RequestMapping("/gotopay")
- public String gotopay(Integer id,Model model){
- Date dt=new Date();
- SimpleDateFormat matter1=new SimpleDateFormat("yyyy-MM-dd");
- String paydate=matter1.format(dt);
- Topaid topaid=topaidService.findbyid(id);
- Paid paid=new Paid();
- paid.setHouse_id(topaid.getHouse_id());
- paid.setAddress(topaid.getAddress());
- paid.setPrice(topaid.getPrice());
- paid.setDate(topaid.getDate());
- paid.setPaydate(paydate);
- paid.setName(topaid.getName());
- paid.setUserlist_id(topaid.getUserlist_id());
- paid.setStatus("租金已缴");
- topaidService.gotopay(id, paid);
- model.addAttribute("error", "paysucess");
- return "redirect:findmypaid.action";
- }
- }
核心代码:
- package controller;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
-
- import javax.servlet.http.HttpSession;
-
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
-
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
-
- import Pojo.Paid;
- import Pojo.QueryVo;
- import Pojo.Solve;
- import Pojo.Topaid;
- import Pojo.User;
- import Pojo.Userlist;
- import Pojo.Wrong;
- import Pojo.Zulist;
- import service.PaidService;
- import service.SolveService;
- import service.UserlistService;
- import service.ZulistService;
-
- @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="2") 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="2") Integer pageSize){
- User user1= (User) httpSession.getAttribute("user");
- Userlist userlist=userlistService.findhasuserlist(user1.getId());
- if(userlist!=null){
- 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="2") Integer pageSize)throws Exception{
- User user1= (User) httpSession.getAttribute("user");
- Userlist userlist=userlistService.findhasuserlist(user1.getId());
- List<Zulist> list=null;
- PageHelper.startPage(page, pageSize);
- if(userlist!=null){
- 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="2") 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="2") Integer pageSize){
- User user1= (User) httpSession.getAttribute("user");
- Userlist userlist=userlistService.findhasuserlist(user1.getId());
- QueryVo vo=new QueryVo();
- if(userlist!=null){
- 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";
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。