——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明





基于javaweb的SSM房屋租赁管理系统(java+ssm+jsp+jquery+mysql)
1 2 3 4 5
| 前台 用户名:zhangsan 密码:123456
后台 用户名:admin 密码:123456
|
项目介绍
系统分为前台用户界面和后台系统管理:
前台用户界面 用户注册、用户登录、用户中心、浏览房源、房源搜索 查看房源明细、发布房源、提交合同、新闻公告、留言交流 后台系统管理 用户管理:用户列表、用户删除、用户查询 新闻管理:新闻列表、添加新闻、修改新闻、删除新闻、查询新闻 房屋管理:房屋列表、房屋删除、分页查看 留言管理:留言列表、留言删除、留言查询、留言回复列表、回复查询 租赁合同管理:合同列表、查看合同、删除合同 管理员管理:管理员管理、新增管理员、编辑管理员、删除管理员等
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;
技术栈
后台框架:Spring、SpringMVC、MyBatis UI界面:JSP、jQuery 数据库:MySQL
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| house.setHits("" + (Integer.parseInt(house.getHits()) + 1)); this.houseService.updateHouse(house); this.getRequest().setAttribute("house", house); return "users/detail"; }
// 公告 @RequestMapping("article.action") public String article(String number) { this.front(); List<Article> articleList = new ArrayList<Article>(); List<Article> tempList = this.articleService.getAllArticle(); int pageNumber = tempList.size(); int maxPage = pageNumber; if (maxPage % 10 == 0) { maxPage = maxPage / 10; } else { maxPage = maxPage / 10 + 1; } if (number == null) { number = "0"; } int start = Integer.parseInt(number) * 10; int over = (Integer.parseInt(number) + 1) * 10; int count = pageNumber - over; if (count <= 0) { over = pageNumber; } for (int i = start; i < over; i++) { Article x = tempList.get(i); articleList.add(x); } String html = ""; StringBuffer buffer = new StringBuffer(); buffer.append(" 共为"); buffer.append(maxPage); buffer.append("页 共有"); buffer.append(pageNumber); buffer.append("条 当前为第"); buffer.append((Integer.parseInt(number) + 1)); buffer.append("页 "); if ((Integer.parseInt(number) + 1) == 1) { buffer.append("首页"); } else { buffer.append("<a href=\"index/article.action?number=0\">首页</a>"); } buffer.append(" "); if ((Integer.parseInt(number) + 1) == 1) { buffer.append("上一页"); } else { buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| if ((Integer.parseInt(number) + 1) == 1) { buffer.append("上一页"); } else { buffer.append("<a href=\"admin/getAllAdmin.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("下一页"); } else { buffer.append("<a href=\"admin/getAllAdmin.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("尾页"); } else { buffer.append("<a href=\"admin/getAllAdmin.action?number=" + (maxPage - 1) + "\">尾页</a>"); } html = buffer.toString(); this.getRequest().setAttribute("html", html); this.getRequest().setAttribute("adminList", adminList); return "admin/listadmin"; }
// 按条件查询数据 (模糊查询) @RequestMapping("queryAdminByCond.action") public String queryAdminByCond(String cond, String name) { List<Admin> adminList = new ArrayList<Admin>(); Admin admin = new Admin(); if (cond != null) { if ("username".equals(cond)) { admin.setUsername(name); adminList = this.adminService.getAdminByLike(admin); } if ("password".equals(cond)) { admin.setPassword(name); adminList = this.adminService.getAdminByLike(admin); } if ("realname".equals(cond)) { admin.setRealname(name); adminList = this.adminService.getAdminByLike(admin); } if ("contact".equals(cond)) { admin.setContact(name); adminList = this.adminService.getAdminByLike(admin); } } this.getRequest().setAttribute("adminList", adminList); return "admin/queryadmin"; }
// 按主键查询数据 @RequestMapping("getAdminById.action") public String getAdminById(String id) {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| for (int i = start; i < over; i++) { Cate cate = tempList.get(i); cateList.add(cate); } String html = ""; StringBuffer buffer = new StringBuffer(); buffer.append(" 共为"); buffer.append(maxPage); buffer.append("页 共有"); buffer.append(pageNumber); buffer.append("条 当前为第"); buffer.append((Integer.parseInt(number) + 1)); buffer.append("页 "); if ((Integer.parseInt(number) + 1) == 1) { buffer.append("首页"); } else { buffer.append("<a href=\"cate/getAllCate.action?number=0\">首页</a>"); } buffer.append(" "); if ((Integer.parseInt(number) + 1) == 1) { buffer.append("上一页"); } else { buffer.append("<a href=\"cate/getAllCate.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("下一页"); } else { buffer.append("<a href=\"cate/getAllCate.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("尾页"); } else { buffer.append("<a href=\"cate/getAllCate.action?number=" + (maxPage - 1) + "\">尾页</a>"); } html = buffer.toString(); this.getRequest().setAttribute("html", html); this.getRequest().setAttribute("cateList", cateList); return "admin/listcate"; }
// 按条件查询数据 (模糊查询) @RequestMapping("queryCateByCond.action") public String queryCateByCond(String cond, String name) { List<Cate> cateList = new ArrayList<Cate>(); Cate cate = new Cate(); if (cond != null) {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| public BbsService getBbsService() { return bbsService; }
public void setBbsService(BbsService bbsService) { this.bbsService = bbsService; }
}
@Controller
@RequestMapping("/cate") public class CateAction extends BaseAction { @Autowired @Resource private CateService cateService;
@RequestMapping("createCate.action") public String createCate() { return "admin/addcate"; }
@RequestMapping("addCate.action") public String addCate(Cate cate) {
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| public String deleteRebbs(String id) { this.rebbsService.deleteRebbs(id); return "redirect:/rebbs/getAllRebbs.action"; }
@RequestMapping("deleteRebbsByIds.action") public String deleteRebbsByIds() { String[] ids = this.getRequest().getParameterValues("rebbsid"); for (String rebbsid : ids) { this.rebbsService.deleteRebbs(rebbsid); } return "redirect:/rebbs/getAllRebbs.action"; }
@RequestMapping("updateRebbs.action") public String updateRebbs(Rebbs rebbs) { this.rebbsService.updateRebbs(rebbs); return "redirect:/rebbs/getAllRebbs.action"; }
@RequestMapping("getAllRebbs.action") public String getAllRebbs(String number) { List<Rebbs> rebbsList = new ArrayList<Rebbs>(); List<Rebbs> tempList = new ArrayList<Rebbs>(); tempList = this.rebbsService.getAllRebbs(); int pageNumber = tempList.size(); int maxPage = pageNumber; if (maxPage % 10 == 0) { maxPage = maxPage / 10; } else { maxPage = maxPage / 10 + 1; } if (number == null) { number = "0"; } int start = Integer.parseInt(number) * 10; int over = (Integer.parseInt(number) + 1) * 10; int count = pageNumber - over; if (count <= 0) { over = pageNumber; } for (int i = start; i < over; i++) { Rebbs rebbs = tempList.get(i); rebbsList.add(rebbs); } String html = "";
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=120023061907201aw
https://javayms.pages.dev?id=120023061907201aw