当前位置:   article > 正文

白嫖项目基于ssm房屋租赁系统源码【开源项目】_ssm房屋租赁网站源码百度云下载

ssm房屋租赁网站源码百度云下载

 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脚本:

  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : chicken
  4. Source Server Version : 50626
  5. Source Host : localhost:3306
  6. Source Database : zu
  7. Target Server Type : MYSQL
  8. Target Server Version : 50626
  9. File Encoding : 65001
  10. Date: 2022-10-10 21:56:34
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for apply
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `apply`;
  17. CREATE TABLE `apply` (
  18. `apply_id` int(11) NOT NULL AUTO_INCREMENT,
  19. `house_id` varchar(255) NOT NULL,
  20. `address` varchar(255) DEFAULT NULL,
  21. `area` double(255,0) DEFAULT NULL,
  22. `price` double(10,2) DEFAULT NULL,
  23. `status` varchar(255) DEFAULT NULL,
  24. `userlist_id` int(255) NOT NULL,
  25. PRIMARY KEY (`apply_id`,`house_id`)
  26. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  27. -- ----------------------------
  28. -- Records of apply
  29. -- ----------------------------
  30. -- ----------------------------
  31. -- Table structure for applyout
  32. -- ----------------------------
  33. DROP TABLE IF EXISTS `applyout`;
  34. CREATE TABLE `applyout` (
  35. `aoid` int(11) NOT NULL AUTO_INCREMENT,
  36. `house_id` varchar(255) DEFAULT NULL,
  37. `address` varchar(255) DEFAULT NULL,
  38. `status` varchar(255) DEFAULT NULL,
  39. `userlist_id` int(11) DEFAULT NULL,
  40. PRIMARY KEY (`aoid`)
  41. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
  42. -- ----------------------------
  43. -- Records of applyout
  44. -- ----------------------------
  45. INSERT INTO `applyout` VALUES ('3', 'b1', '桃源居', '已拒绝', '10');
  46. INSERT INTO `applyout` VALUES ('6', 'k2', '贝岗街18号', '已拒绝', '15');
  47. -- ----------------------------
  48. -- Table structure for checkout
  49. -- ----------------------------
  50. DROP TABLE IF EXISTS `checkout`;
  51. CREATE TABLE `checkout` (
  52. `cid` int(11) NOT NULL AUTO_INCREMENT,
  53. `house_id` varchar(255) DEFAULT NULL,
  54. `address` varchar(255) DEFAULT NULL,
  55. `status` varchar(255) DEFAULT NULL,
  56. `userlist_id` int(11) DEFAULT NULL,
  57. PRIMARY KEY (`cid`)
  58. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  59. -- ----------------------------
  60. -- Records of checkout
  61. -- ----------------------------
  62. INSERT INTO `checkout` VALUES ('2', 'k2', '贝岗街18号', '已退租', '15');
  63. INSERT INTO `checkout` VALUES ('3', 'c1', '广药1-364', '已退租', '10');
  64. -- ----------------------------
  65. -- Table structure for hetong
  66. -- ----------------------------
  67. DROP TABLE IF EXISTS `hetong`;
  68. CREATE TABLE `hetong` (
  69. `id` int(11) NOT NULL AUTO_INCREMENT,
  70. `chuzu` varchar(255) DEFAULT NULL,
  71. `chuzu_idcard` varchar(255) DEFAULT NULL,
  72. `zuke` varchar(255) DEFAULT NULL,
  73. `zuke_idcard` varchar(255) DEFAULT NULL,
  74. `fromdate` varchar(255) DEFAULT NULL,
  75. `todate` varchar(255) DEFAULT NULL,
  76. `price` double(10,2) DEFAULT NULL,
  77. `address` varchar(255) DEFAULT NULL,
  78. `house_id` varchar(255) DEFAULT NULL,
  79. `payday` int(11) DEFAULT NULL,
  80. PRIMARY KEY (`id`)
  81. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
  82. -- ----------------------------
  83. -- Records of hetong
  84. -- ----------------------------
  85. INSERT INTO `hetong` VALUES ('5', '张三', '440411199208018201', '李四', '440421199509088888', '2022-09-01', '2022-09-14', '900.00', '菊花园', 'c3', '2');
  86. -- ----------------------------
  87. -- Table structure for houselist
  88. -- ----------------------------
  89. DROP TABLE IF EXISTS `houselist`;
  90. CREATE TABLE `houselist` (
  91. `id` int(11) NOT NULL AUTO_INCREMENT,
  92. `houseid` varchar(255) NOT NULL,
  93. `address` varchar(255) NOT NULL,
  94. `area` double DEFAULT NULL,
  95. `price` double(10,2) DEFAULT NULL,
  96. `status` varchar(255) DEFAULT NULL,
  97. PRIMARY KEY (`id`,`houseid`)
  98. ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
  99. -- ----------------------------
  100. -- Records of houselist
  101. -- ----------------------------
  102. INSERT INTO `houselist` VALUES ('16', 'c3', '菊花园1-364', '60', '700.00', '已租赁');
  103. INSERT INTO `houselist` VALUES ('17', 'k1', '东风街13号', '63.2', '1300.00', '已租赁');
  104. INSERT INTO `houselist` VALUES ('20', 'b5', '穗石村18号', '60', '700.00', '未租赁');
  105. INSERT INTO `houselist` VALUES ('21', 'k8', '穗石村1号', '66', '800.00', '未租赁');
  106. -- ----------------------------
  107. -- Table structure for paid
  108. -- ----------------------------
  109. DROP TABLE IF EXISTS `paid`;
  110. CREATE TABLE `paid` (
  111. `id` int(11) NOT NULL AUTO_INCREMENT,
  112. `house_id` varchar(255) DEFAULT NULL,
  113. `address` varchar(255) DEFAULT NULL,
  114. `price` double(10,2) DEFAULT NULL,
  115. `date` date DEFAULT NULL,
  116. `paydate` date DEFAULT NULL,
  117. `name` varchar(255) DEFAULT NULL,
  118. `userlist_id` int(11) DEFAULT NULL,
  119. `status` varchar(255) DEFAULT NULL,
  120. PRIMARY KEY (`id`)
  121. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
  122. -- ----------------------------
  123. -- Records of paid
  124. -- ----------------------------
  125. INSERT INTO `paid` VALUES ('5', 'c1', '广药1-364', '500.00', '2022-09-14', '2022-09-27', '赵颖欣', '10', '租金已缴');
  126. INSERT INTO `paid` VALUES ('6', 'c3', '菊花园1-364', '700.00', '2022-09-30', '2022-09-28', '李四', '12', '租金已缴');
  127. INSERT INTO `paid` VALUES ('7', 'c2', '碧桂园1-364', '4365.00', '2022-10-31', '2022-10-08', '张三', '14', '租金已缴');
  128. INSERT INTO `paid` VALUES ('8', 'k2', '贝岗街18号', '700.00', '2022-10-31', '2022-10-10', '张思', '15', '租金已缴');
  129. INSERT INTO `paid` VALUES ('9', 'c1', '广药1-364', '5000.00', '2022-10-31', '2022-10-10', '赵颖欣', '10', '租金已缴');
  130. -- ----------------------------
  131. -- Table structure for schedule
  132. -- ----------------------------
  133. DROP TABLE IF EXISTS `schedule`;
  134. CREATE TABLE `schedule` (
  135. `id` int(11) NOT NULL AUTO_INCREMENT,
  136. `date` varchar(255) DEFAULT NULL,
  137. `content` text,
  138. PRIMARY KEY (`id`)
  139. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  140. -- ----------------------------
  141. -- Records of schedule
  142. -- ----------------------------
  143. INSERT INTO `schedule` VALUES ('2', '2022-09-08', '收数');
  144. INSERT INTO `schedule` VALUES ('3', '2022-09-20', '今天是收租日');
  145. -- ----------------------------
  146. -- Table structure for solve
  147. -- ----------------------------
  148. DROP TABLE IF EXISTS `solve`;
  149. CREATE TABLE `solve` (
  150. `id` int(11) NOT NULL AUTO_INCREMENT,
  151. `house_id` varchar(255) DEFAULT NULL,
  152. `address` varchar(255) DEFAULT NULL,
  153. `date` date DEFAULT NULL,
  154. `detail` text,
  155. `name` varchar(255) DEFAULT NULL,
  156. `userlist_id` int(11) DEFAULT NULL,
  157. `status` varchar(255) DEFAULT NULL,
  158. PRIMARY KEY (`id`)
  159. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
  160. -- ----------------------------
  161. -- Records of solve
  162. -- ----------------------------
  163. INSERT INTO `solve` VALUES ('4', 'c1', '广药1-364', '2022-09-08', 'kk', '赵颖欣', '10', '已处理');
  164. INSERT INTO `solve` VALUES ('5', 'c3', '菊花园1-364', '2022-09-28', '天花板漏水', '李四', '12', '已处理');
  165. INSERT INTO `solve` VALUES ('6', 'c2', '碧桂园1-364', '2022-10-08', '窗户坏了', '张三', '14', '已处理');
  166. INSERT INTO `solve` VALUES ('7', 'k2', '贝岗街18号', '2022-10-10', '天花板漏水', '张思', '15', '已处理');
  167. INSERT INTO `solve` VALUES ('8', 'c1', '广药1-364', '2022-10-09', '空调漏水', '赵颖欣', '10', '已处理');
  168. -- ----------------------------
  169. -- Table structure for topaid
  170. -- ----------------------------
  171. DROP TABLE IF EXISTS `topaid`;
  172. CREATE TABLE `topaid` (
  173. `id` int(11) NOT NULL AUTO_INCREMENT,
  174. `house_id` varchar(255) DEFAULT NULL,
  175. `address` varchar(255) DEFAULT NULL,
  176. `price` double(10,2) DEFAULT NULL,
  177. `date` date DEFAULT NULL,
  178. `name` varchar(255) DEFAULT NULL,
  179. `userlist_id` int(11) DEFAULT NULL,
  180. `status` varchar(255) DEFAULT NULL,
  181. PRIMARY KEY (`id`)
  182. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  183. -- ----------------------------
  184. -- Records of topaid
  185. -- ----------------------------
  186. -- ----------------------------
  187. -- Table structure for user
  188. -- ----------------------------
  189. DROP TABLE IF EXISTS `user`;
  190. CREATE TABLE `user` (
  191. `id` int(11) NOT NULL AUTO_INCREMENT,
  192. `username` varchar(255) DEFAULT NULL,
  193. `password` varchar(255) DEFAULT NULL,
  194. `type` varchar(255) DEFAULT NULL,
  195. PRIMARY KEY (`id`)
  196. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  197. -- ----------------------------
  198. -- Records of user
  199. -- ----------------------------
  200. INSERT INTO `user` VALUES ('1', 'admin', '123456', 'admin');
  201. INSERT INTO `user` VALUES ('2', '赵颖欣', '12345', 'zuke');
  202. INSERT INTO `user` VALUES ('3', 'zyx', '12345', 'zuke');
  203. INSERT INTO `user` VALUES ('5', 'cwy', '12345', 'zuke');
  204. -- ----------------------------
  205. -- Table structure for userlist
  206. -- ----------------------------
  207. DROP TABLE IF EXISTS `userlist`;
  208. CREATE TABLE `userlist` (
  209. `id` int(11) NOT NULL AUTO_INCREMENT,
  210. `name` varchar(255) DEFAULT NULL,
  211. `idcard` varchar(255) NOT NULL,
  212. `phone` varchar(255) DEFAULT NULL,
  213. `user_id` int(11) NOT NULL,
  214. PRIMARY KEY (`id`,`idcard`)
  215. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
  216. -- ----------------------------
  217. -- Records of userlist
  218. -- ----------------------------
  219. INSERT INTO `userlist` VALUES ('12', '李四', '440421199509088888', '18826107777', '3');
  220. INSERT INTO `userlist` VALUES ('15', '张思', '441601199312214414', '159192134000', '5');
  221. -- ----------------------------
  222. -- Table structure for wrong
  223. -- ----------------------------
  224. DROP TABLE IF EXISTS `wrong`;
  225. CREATE TABLE `wrong` (
  226. `id` int(11) NOT NULL AUTO_INCREMENT,
  227. `house_id` varchar(255) DEFAULT NULL,
  228. `address` varchar(255) DEFAULT NULL,
  229. `date` date DEFAULT NULL,
  230. `detail` text,
  231. `name` varchar(255) DEFAULT NULL,
  232. `userlist_id` int(11) DEFAULT NULL,
  233. `status` varchar(255) DEFAULT NULL,
  234. PRIMARY KEY (`id`)
  235. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  236. -- ----------------------------
  237. -- Records of wrong
  238. -- ----------------------------
  239. -- ----------------------------
  240. -- Table structure for zulist
  241. -- ----------------------------
  242. DROP TABLE IF EXISTS `zulist`;
  243. CREATE TABLE `zulist` (
  244. `zid` int(11) NOT NULL AUTO_INCREMENT,
  245. `house_id` varchar(255) NOT NULL,
  246. `price` double(10,2) DEFAULT NULL,
  247. `address` varchar(255) DEFAULT NULL,
  248. `userlist_id` int(11) NOT NULL,
  249. `contract_id` int(11) NOT NULL,
  250. PRIMARY KEY (`zid`,`house_id`)
  251. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
  252. -- ----------------------------
  253. -- Records of zulist
  254. -- ----------------------------
  255. INSERT INTO `zulist` VALUES ('7', 'c3', '700.00', '菊花园1-364', '12', '5');
  256. SET FOREIGN_KEY_CHECKS=1;

 

 核心代码1:

  1. package controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpSession;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Controller;
  6. import org.springframework.ui.Model;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import com.github.pagehelper.PageHelper;
  10. import com.github.pagehelper.PageInfo;
  11. import Pojo.Houselist;
  12. import Pojo.Paid;
  13. import Pojo.QueryVo;
  14. import Pojo.Topaid;
  15. import Pojo.User;
  16. import Pojo.Userlist;
  17. import Pojo.Zulist;
  18. import service.PaidService;
  19. import service.TopaidService;
  20. import service.UserlistService;
  21. import java.text.SimpleDateFormat;
  22. import java.util.Date;;
  23. @Controller
  24. @RequestMapping("/paid")
  25. public class PaidController {
  26. @Autowired
  27. private PaidService paidService;
  28. @Autowired
  29. private TopaidService topaidService;
  30. @Autowired
  31. private UserlistService userlistService;
  32. //管理员查找所有已缴租金列表
  33. @RequestMapping("/selectall")
  34. public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
  35. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  36. PageHelper.startPage(page, pageSize);
  37. List<Paid> list=paidService.selectall(vo);
  38. PageInfo<Paid> p=new PageInfo<Paid>(list);
  39. Double sum=paidService.selectsum(vo);
  40. model.addAttribute("paid", list);
  41. model.addAttribute("sum", sum);
  42. model.addAttribute("p", p);
  43. model.addAttribute("mainPage", "paid.jsp");
  44. model.addAttribute("vo", vo);
  45. return "admin/main1";
  46. }
  47. //租客查找自己已缴租金列表
  48. @RequestMapping("/findmypaid")
  49. public String findmypaid(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
  50. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  51. User user1= (User) httpSession.getAttribute("user");
  52. Userlist userlist=userlistService.findhasuserlist(user1.getId());
  53. if(userlist!=null){
  54. vo.setUserlist_id(userlist.getId());
  55. }
  56. PageHelper.startPage(page, pageSize);
  57. List<Paid> list=paidService.selectall(vo);
  58. PageInfo<Paid> p=new PageInfo<Paid>(list);
  59. Double sum=paidService.selectsum(vo);
  60. model.addAttribute("paid", list);
  61. model.addAttribute("sum", sum);
  62. model.addAttribute("p", p);
  63. model.addAttribute("mainPage", "mypaid.jsp");
  64. model.addAttribute("vo", vo);
  65. return "zuke/main";
  66. }
  67. //管理员删除已缴租金记录
  68. @RequestMapping("/deletepaid")
  69. public String deletepaid(Integer id){
  70. paidService.deletepaid(id);
  71. return "redirect:selectall.action";
  72. }
  73. //zuke删除已缴租金记录
  74. @RequestMapping("/zukedeletepaid")
  75. public String zukedeletepaid(Integer id){
  76. paidService.deletepaid(id);
  77. return "redirect:findmypaid.action";
  78. }
  79. //跳到我要收租页面
  80. @RequestMapping("/showaddpaid")
  81. public String showaddpaid(Model model,@RequestParam(required=false,defaultValue="1") Integer page,
  82. @RequestParam(required=false,defaultValue="2") Integer pageSize)throws Exception{
  83. PageHelper.startPage(page, pageSize);
  84. List<Zulist> list=paidService.findzuuserlist();
  85. PageInfo<Zulist> p=new PageInfo<Zulist>(list);
  86. model.addAttribute("zulist", list);
  87. model.addAttribute("p", p);
  88. model.addAttribute("mainPage", "showaddpaid.jsp");
  89. return "admin/main1";
  90. }
  91. //点击收租后跳转到添加租金信息页面
  92. @RequestMapping("/addpaid")
  93. public String addpaid(Integer id,Model model){
  94. Zulist zulist=paidService.findzukezulist(id);
  95. model.addAttribute("zulist", zulist);
  96. model.addAttribute("mainPage", "addpaid.jsp");
  97. return "admin/main1";
  98. }
  99. //添加租金信息到topaid表
  100. @RequestMapping("/inserttopaid")
  101. public String inserttopaid(Topaid topaid,Model model){
  102. topaidService.inserttopaid(topaid);
  103. model.addAttribute("error","inserttopaid");
  104. return "redirect:showaddpaid.action";
  105. }
  106. //管理员查看所有未缴租金信息
  107. @RequestMapping("/topaidlist")
  108. public String topaidlist(Model model,@RequestParam(required=false,defaultValue="1") Integer page,
  109. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  110. QueryVo vo=new QueryVo();
  111. PageHelper.startPage(page, pageSize);
  112. List<Topaid> list=topaidService.findtopaid(vo);
  113. PageInfo<Topaid> p=new PageInfo<Topaid>(list);
  114. model.addAttribute("topaid", list);
  115. model.addAttribute("p", p);
  116. model.addAttribute("mainPage", "topaid.jsp");
  117. return "admin/main1";
  118. }
  119. //租客查看自己的未缴租金
  120. @RequestMapping("/mytopaidlist")
  121. public String mytopaidlist(Model model,HttpSession httpSession,@RequestParam(required=false,defaultValue="1") Integer page,
  122. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  123. User user1= (User) httpSession.getAttribute("user");
  124. Userlist userlist=userlistService.findhasuserlist(user1.getId());
  125. QueryVo vo=new QueryVo();
  126. if(userlist!=null){
  127. vo.setUserlist_id(userlist.getId());
  128. }
  129. PageHelper.startPage(page, pageSize);
  130. List<Topaid> topaid=topaidService.findtopaid(vo);
  131. PageInfo<Topaid> p=new PageInfo<Topaid>(topaid);
  132. model.addAttribute("p", p);
  133. model.addAttribute("topaid",topaid);
  134. model.addAttribute("mainPage", "mytopaid.jsp");
  135. return "zuke/main";
  136. }
  137. //租客进行支付操作
  138. @RequestMapping("/gotopay")
  139. public String gotopay(Integer id,Model model){
  140. Date dt=new Date();
  141. SimpleDateFormat matter1=new SimpleDateFormat("yyyy-MM-dd");
  142. String paydate=matter1.format(dt);
  143. Topaid topaid=topaidService.findbyid(id);
  144. Paid paid=new Paid();
  145. paid.setHouse_id(topaid.getHouse_id());
  146. paid.setAddress(topaid.getAddress());
  147. paid.setPrice(topaid.getPrice());
  148. paid.setDate(topaid.getDate());
  149. paid.setPaydate(paydate);
  150. paid.setName(topaid.getName());
  151. paid.setUserlist_id(topaid.getUserlist_id());
  152. paid.setStatus("租金已缴");
  153. topaidService.gotopay(id, paid);
  154. model.addAttribute("error", "paysucess");
  155. return "redirect:findmypaid.action";
  156. }
  157. }

核心代码:

  1. package controller;
  2. import java.text.SimpleDateFormat;
  3. import java.util.Date;
  4. import java.util.List;
  5. import javax.servlet.http.HttpSession;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.ui.Model;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RequestParam;
  11. import com.github.pagehelper.PageHelper;
  12. import com.github.pagehelper.PageInfo;
  13. import Pojo.Paid;
  14. import Pojo.QueryVo;
  15. import Pojo.Solve;
  16. import Pojo.Topaid;
  17. import Pojo.User;
  18. import Pojo.Userlist;
  19. import Pojo.Wrong;
  20. import Pojo.Zulist;
  21. import service.PaidService;
  22. import service.SolveService;
  23. import service.UserlistService;
  24. import service.ZulistService;
  25. @Controller
  26. @RequestMapping("/wrong")
  27. public class WrongController {
  28. @Autowired
  29. private SolveService solveService;
  30. @Autowired
  31. private UserlistService userlistService;
  32. @Autowired
  33. private PaidService paidService;
  34. @Autowired
  35. private ZulistService zulistService;
  36. //管理员查找所有已处理的报障
  37. @RequestMapping("/selectall")
  38. public String selectall(Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
  39. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  40. PageHelper.startPage(page, pageSize);
  41. List<Solve> list=solveService.selectall(vo);
  42. PageInfo<Solve> p=new PageInfo<Solve>(list);
  43. Integer count=solveService.selectcount(vo);
  44. model.addAttribute("solve", list);
  45. model.addAttribute("count", count);
  46. model.addAttribute("p", p);
  47. model.addAttribute("mainPage", "solve.jsp");
  48. model.addAttribute("vo", vo);
  49. return "admin/main1";
  50. }
  51. //租客查找自己已处理的报障
  52. @RequestMapping("/findmysolve")
  53. public String findmysolve(HttpSession httpSession,Model model,QueryVo vo,@RequestParam(required=false,defaultValue="1") Integer page,
  54. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  55. User user1= (User) httpSession.getAttribute("user");
  56. Userlist userlist=userlistService.findhasuserlist(user1.getId());
  57. if(userlist!=null){
  58. vo.setUserlist_id(userlist.getId());
  59. }
  60. PageHelper.startPage(page, pageSize);
  61. List<Solve> list=solveService.selectall(vo);
  62. PageInfo<Solve> p=new PageInfo<Solve>(list);
  63. Integer count=solveService.selectcount(vo);
  64. model.addAttribute("solve", list);
  65. model.addAttribute("count", count);
  66. model.addAttribute("p", p);
  67. model.addAttribute("mainPage", "mysolve.jsp");
  68. model.addAttribute("vo", vo);
  69. return "zuke/main";
  70. }
  71. //管理员删除已处理报障记录
  72. @RequestMapping("/deletesolve")
  73. public String deletesolve(Integer id){
  74. solveService.deletesolve(id);
  75. return "redirect:selectall.action";
  76. }
  77. //zuke删除自己的已处理报障记录
  78. @RequestMapping("/zukedeletesolve")
  79. public String zukedeletesolve(Integer id){
  80. solveService.deletesolve(id);
  81. return "redirect:findmypaid.action";
  82. }
  83. //租客跳到我要报障页面
  84. @RequestMapping("/showaddwrong")
  85. public String showaddwrong(HttpSession httpSession,Model model,@RequestParam(required=false,defaultValue="1") Integer page,
  86. @RequestParam(required=false,defaultValue="2") Integer pageSize)throws Exception{
  87. User user1= (User) httpSession.getAttribute("user");
  88. Userlist userlist=userlistService.findhasuserlist(user1.getId());
  89. List<Zulist> list=null;
  90. PageHelper.startPage(page, pageSize);
  91. if(userlist!=null){
  92. list=zulistService.findzulistbyuid(userlist.getId());
  93. }
  94. PageInfo<Zulist> p=new PageInfo<Zulist>(list);
  95. model.addAttribute("zulist", list);
  96. model.addAttribute("p", p);
  97. model.addAttribute("mainPage", "showaddwrong.jsp");
  98. return "zuke/main";
  99. }
  100. //点击报障后跳转到添加报障信息页面
  101. @RequestMapping("/addwrong")
  102. public String addwrong(Integer id,Model model){
  103. Zulist zulist=paidService.findzukezulist(id);
  104. model.addAttribute("zulist", zulist);
  105. model.addAttribute("mainPage", "addwrong.jsp");
  106. return "zuke/main";
  107. }
  108. //添加报障信息到wrong表
  109. @RequestMapping("/insertwrong")
  110. public String insertwrong(Wrong wrong,Model model){
  111. solveService.insertwrong(wrong);
  112. model.addAttribute("error","insertwrong");
  113. return "redirect:showaddwrong.action";
  114. }
  115. //管理员查看所有未处理报障
  116. @RequestMapping("/wronglist")
  117. public String wronglist(Model model,@RequestParam(required=false,defaultValue="1") Integer page,
  118. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  119. QueryVo vo=new QueryVo();
  120. PageHelper.startPage(page, pageSize);
  121. List<Wrong> list=solveService.findwrong(vo);
  122. PageInfo<Wrong> p=new PageInfo<Wrong>(list);
  123. model.addAttribute("wrong", list);
  124. model.addAttribute("p", p);
  125. model.addAttribute("mainPage", "wrong.jsp");
  126. return "admin/main1";
  127. }
  128. //租客查看自己的未处理报障
  129. @RequestMapping("/mywronglist")
  130. public String mywronglist(Model model,HttpSession httpSession,@RequestParam(required=false,defaultValue="1") Integer page,
  131. @RequestParam(required=false,defaultValue="2") Integer pageSize){
  132. User user1= (User) httpSession.getAttribute("user");
  133. Userlist userlist=userlistService.findhasuserlist(user1.getId());
  134. QueryVo vo=new QueryVo();
  135. if(userlist!=null){
  136. vo.setUserlist_id(userlist.getId());
  137. }
  138. PageHelper.startPage(page, pageSize);
  139. List<Wrong> list=solveService.findwrong(vo);
  140. PageInfo<Wrong> p=new PageInfo<Wrong>(list);
  141. model.addAttribute("p", p);
  142. model.addAttribute("wrong",list);
  143. model.addAttribute("mainPage", "mywrong.jsp");
  144. return "zuke/main";
  145. }
  146. //管理员处理报障
  147. @RequestMapping("/gotosolve")
  148. public String gotosolve(Integer id,Model model){
  149. Wrong wrong=solveService.findbyid(id);
  150. Solve solve=new Solve();
  151. solve.setHouse_id(wrong.getHouse_id());
  152. solve.setAddress(wrong.getAddress());
  153. solve.setDate(wrong.getDate());
  154. solve.setDetail(wrong.getDetail());
  155. solve.setName(wrong.getName());
  156. solve.setUserlist_id(wrong.getUserlist_id());
  157. solve.setStatus("已处理");
  158. solveService.gotosolve(id, solve);
  159. model.addAttribute("error", "duesucess");
  160. return "redirect:selectall.action";
  161. }
  162. }

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号