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



基于javaweb的SSM房产中介系统房产平台(java+ssm+mysql+jsp)
前台访问地址:http://localhost:8080/index/index.action
用户名:zhangsan 密码:123456
后台访问地址:http://localhost:8080/admin/index.jsp
用户名:admin 密码:123456
一、项目简介
本项目是一套基于SSM的房产中介系统,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的Java学习者。
包含:项目源码、数据库脚本、软件工具、项目说明等,该项目可以直接作为毕设使用。
项目都经过严格调试,确保可以运行!
二、技术实现
后台框架:Spring、SpringMVC、MyBatis
数据库:MySQL
开发环境:JDK、Eclipse、Tomcat
三、系统功能
系统主要功能包括:用户登录、用户注册、管理员管理、新闻公告管理、房屋信息管理、房屋类型管理、合同信息管理、留言信息管理、留言回复管理、账户密码修改、房源信息发布、房源列表展示、房源查询等
——————————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
| if ("title".equals(cond)) { article.setTitle(name); articleList = this.articleService.getArticleByLike(article); } if ("image".equals(cond)) { article.setImage(name); articleList = this.articleService.getArticleByLike(article); } if ("contents".equals(cond)) { article.setContents(name); articleList = this.articleService.getArticleByLike(article); } if ("addtime".equals(cond)) { article.setAddtime(name); articleList = this.articleService.getArticleByLike(article); } if ("hits".equals(cond)) { article.setHits(name); articleList = this.articleService.getArticleByLike(article); } } this.getRequest().setAttribute("articleList", articleList); return "admin/queryarticle"; }
@RequestMapping("getArticleById.action") public String getArticleById(String id) { Article article = this.articleService.getArticleById(id); this.getRequest().setAttribute("article", article); return "admin/editarticle"; }
public ArticleService getArticleService() { return articleService; }
public void setArticleService(ArticleService articleService) { this.articleService = articleService; }
}
|
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
|
@Controller
@RequestMapping("/rebbs") public class RebbsAction extends BaseAction { @Autowired @Resource private RebbsService rebbsService; @Autowired @Resource private UsersService usersService; @Autowired @Resource private BbsService bbsService;
@RequestMapping("createRebbs.action") public String createRebbs() { List<Users> usersList = this.usersService.getAllUsers(); this.getRequest().setAttribute("usersList", usersList); List<Bbs> bbsList = this.bbsService.getAllBbs(); this.getRequest().setAttribute("bbsList", bbsList); return "admin/addrebbs"; }
@RequestMapping("addRebbs.action") public String addRebbs(Rebbs rebbs) { this.rebbsService.insertRebbs(rebbs); return "redirect:/rebbs/createRebbs.action"; }
@RequestMapping("deleteRebbs.action") 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) {
|
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
| 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++) { Contract contract = tempList.get(i); contractList.add(contract); } 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=\"contract/getAllContract.action?number=0\">首页</a>"); } buffer.append(" "); if ((Integer.parseInt(number) + 1) == 1) { buffer.append("上一页"); } else { buffer.append("<a href=\"contract/getAllContract.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("下一页"); } else { buffer.append("<a href=\"contract/getAllContract.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>"); } buffer.append(" "); if (maxPage <= (Integer.parseInt(number) + 1)) { buffer.append("尾页"); } else { buffer.append("<a href=\"contract/getAllContract.action?number=" + (maxPage - 1) + "\">尾页</a>");
|
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
| @RequestMapping("over.action") public String over(String id) { this.front(); if (this.getSession().getAttribute("userid") == null) { return "redirect:/index/preLogin.action"; } Contract contract = this.contractService.getContractById(id); contract.setStatus("完成"); this.contractService.updateContract(contract); House house = this.houseService.getHouseById(contract.getHouseid()); house.setStatus("待租"); this.houseService.updateHouse(house); return "redirect:/index/myContract.action"; }
@RequestMapping("deleteContract.action") public String deleteContract(String id) { this.front(); if (this.getSession().getAttribute("userid") == null) { return "redirect:/index/preLogin.action"; } Contract contract = this.contractService.getContractById(id); House house = this.houseService.getHouseById(contract.getHouseid()); house.setStatus("待租"); this.houseService.updateHouse(house); this.contractService.deleteContract(id); return "redirect:/index/myContract.action"; }
}
@Controller
@RequestMapping("/admin") public class AdminAction extends BaseAction {
|
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
| Article article = new Article(); if (cond != null) { if ("title".equals(cond)) { article.setTitle(name); articleList = this.articleService.getArticleByLike(article); } if ("image".equals(cond)) { article.setImage(name); articleList = this.articleService.getArticleByLike(article); } if ("contents".equals(cond)) { article.setContents(name); articleList = this.articleService.getArticleByLike(article); } if ("addtime".equals(cond)) { article.setAddtime(name); articleList = this.articleService.getArticleByLike(article); } if ("hits".equals(cond)) { article.setHits(name); articleList = this.articleService.getArticleByLike(article); } } this.getRequest().setAttribute("articleList", articleList); return "admin/queryarticle"; }
@RequestMapping("getArticleById.action") public String getArticleById(String id) { Article article = this.articleService.getArticleById(id); this.getRequest().setAttribute("article", article); return "admin/editarticle"; }
public ArticleService getArticleService() { return articleService; }
public void setArticleService(ArticleService articleService) { this.articleService = articleService; }
}
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=031123182708201bu
https://javayms.pages.dev?id=031123182708201bu