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






基于javaweb的SSM场地预订管理系统(java+ssm+jsp+jquery+mysql)
项目介绍
本项目分为前后台,前台为普通用户登录,后台为管理员登录; 用户角色包含以下功能: 按分类查看场地,用户登录,查看网站公告,按分类查看器材,查看商品详情,加入购物车,提交订单,查看订单,修改个人信息等功能。 管理员角色包含以下功能: 管理员登录,管理员信息管理,用户信息管理,新闻公告信息管理,实体类型信息管理,场地信息管理,器材信息管理,评价信息管理等功能。
环境需要
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.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入http://localhost:8080/ 登录 用户账号/密码: user/123456 管理员账号/密码:admin/admin
——————————CodeStart——————————
| 12
 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
 
 | 		number = "0";}
 int start = Integer.parseInt(number) * 12;
 int over = (Integer.parseInt(number) + 1) * 12;
 int count = pageNumber - over;
 if (count <= 0) {
 over = pageNumber;
 }
 for (int i = start; i < over; i++) {
 Jiancai x = tempList.get(i);
 flimList.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/hot.action?number=0\">首页</a>");
 }
 buffer.append("  ");
 if ((Integer.parseInt(number) + 1) == 1) {
 buffer.append("上一页");
 } else {
 buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
 }
 buffer.append("  ");
 if (maxPage <= (Integer.parseInt(number) + 1)) {
 buffer.append("下一页");
 } else {
 buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
 }
 buffer.append("  ");
 if (maxPage <= (Integer.parseInt(number) + 1)) {
 buffer.append("尾页");
 } else {
 buffer.append("<a href=\"index/hot.action?number=" + (maxPage - 1) + "\">尾页</a>");
 }
 html = buffer.toString();
 this.getRequest().setAttribute("html", html);
 this.getRequest().setAttribute("flimList", flimList);
 return "users/list";
 }
 
 
 | 
| 12
 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
 
 | @RequestMapping("createTopic.action")public String createTopic() {
 List<Users> usersList = this.usersService.getAllUsers();
 this.getRequest().setAttribute("usersList", usersList);
 List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
 this.getRequest().setAttribute("jiancaiList", jiancaiList);
 return "admin/addtopic";
 }
 
 @RequestMapping("addTopic.action")
 public String addTopic(Topic topic) {
 this.topicService.insertTopic(topic);
 return "redirect:/topic/createTopic.action";
 }
 
 
 @RequestMapping("deleteTopic.action")
 public String deleteTopic(String id) {
 this.topicService.deleteTopic(id);
 return "redirect:/topic/getAllTopic.action";
 }
 
 
 @RequestMapping("deleteTopicByIds.action")
 public String deleteTopicByIds() {
 String[] ids = this.getRequest().getParameterValues("topicid");
 for (String topicid : ids) {
 this.topicService.deleteTopic(topicid);
 }
 return "redirect:/topic/getAllTopic.action";
 }
 
 
 @RequestMapping("updateTopic.action")
 public String updateTopic(Topic topic) {
 this.topicService.updateTopic(topic);
 return "redirect:/topic/getAllTopic.action";
 }
 
 @RequestMapping("getAllTopic.action")
 public String getAllTopic(String number) {
 List<Topic> topicList = this.topicService.getAllTopic();
 PageHelper.getPage(topicList, "topic", null, null, 10, number, this.getRequest(), null);
 return "admin/listtopic";
 }
 
 
 @RequestMapping("queryTopicByCond.action")
 public String queryTopicByCond(String cond, String name, String number) {
 Topic topic = new Topic();
 
 | 
| 12
 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
 
 | 	Cart cart1 = new Cart();cart1.setUsersid(userid);
 List<Cart> cartList = this.cartService.getCartByCond(cart1);
 if (cartList.size() == 0) {
 this.getRequest().setAttribute("message", "请选购场地");
 return "redirect:/index/cart.action";
 } else {
 
 String ordercode = "PD" + VeDate.getStringDatex();
 double total = 0;
 for (Cart cart : cartList) {
 Details details = new Details();
 details.setDetailsid(VeDate.getStringDatex() + (Math.random() * 9 + 1) * 1200);
 details.setJiancaiid(cart.getJiancaiid());
 details.setNum(cart.getNum());
 details.setOrdercode(ordercode);
 details.setPrice(cart.getPrice());
 details.setPeihuoid(this.getRequest().getParameter("peihuoid"));
 details.setCityid(this.getRequest().getParameter("cityid"));
 details.setViewdate(this.getRequest().getParameter("viewdate"));
 this.detailsService.insertDetails(details);
 Jiancai goods = this.jiancaiService.getJiancaiById(cart.getJiancaiid());
 goods.setSellnum("" + (Integer.parseInt(goods.getSellnum()) + Integer.parseInt(cart.getNum())));
 this.jiancaiService.updateJiancai(goods);
 total += Double.parseDouble(cart.getPrice()) * Double.parseDouble(cart.getNum());
 this.cartService.deleteCart(cart.getCartid());
 }
 Orders orders = new Orders();
 orders.setAddtime(VeDate.getStringDateShort());
 orders.setOrdercode(ordercode);
 orders.setStatus("未付款");
 orders.setTotal("" + total);
 orders.setUsersid(userid);
 this.ordersService.insertOrders(orders);
 }
 return "redirect:/index/showOrders.action";
 }
 
 
 @RequestMapping("showOrders.action")
 public String showOrders(String number) {
 this.front();
 if (this.getSession().getAttribute("userid") == null) {
 return "redirect:/index/preLogin.action";
 }
 String userid = (String) this.getSession().getAttribute("userid");
 Orders orders = new Orders();
 orders.setUsersid(userid);
 
 | 
| 12
 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
 
 | public String queryJiancaiByCond(String cond, String name, String number) {Jiancai jiancai = new Jiancai();
 if (cond != null) {
 if ("jiancainame".equals(cond)) {
 jiancai.setJiancainame(name);
 }
 if ("image".equals(cond)) {
 jiancai.setImage(name);
 }
 if ("cateid".equals(cond)) {
 jiancai.setCatename(name);
 }
 if ("price".equals(cond)) {
 jiancai.setPrice(name);
 }
 if ("recommend".equals(cond)) {
 jiancai.setRecommend(name);
 }
 if ("thestart".equals(cond)) {
 jiancai.setThestart(name);
 }
 if ("theend".equals(cond)) {
 jiancai.setTheend(name);
 }
 if ("hits".equals(cond)) {
 jiancai.setHits(name);
 }
 if ("sellnum".equals(cond)) {
 jiancai.setSellnum(name);
 }
 if ("contents".equals(cond)) {
 jiancai.setContents(name);
 }
 }
 
 List<String> nameList = new ArrayList<String>();
 List<String> valueList = new ArrayList<String>();
 nameList.add(cond);
 valueList.add(name);
 PageHelper.getPage(this.jiancaiService.getJiancaiByLike(jiancai), "jiancai", nameList, valueList, 10, number, this.getRequest(), "query");
 name = null;
 cond = null;
 return "admin/queryjiancai";
 }
 
 | 
| 12
 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
 
 | 		this.cartService.deleteCart(cartid);}
 return "redirect:/cart/getAllCart.action";
 }
 
 
 @RequestMapping("updateCart.action")
 public String updateCart(Cart cart) {
 this.cartService.updateCart(cart);
 return "redirect:/cart/getAllCart.action";
 }
 
 
 @RequestMapping("getAllCart.action")
 public String getAllCart(String number) {
 List<Cart> cartList = this.cartService.getAllCart();
 PageHelper.getPage(cartList, "cart", null, null, 10, number, this.getRequest(), null);
 return "admin/listcart";
 }
 
 
 @RequestMapping("queryCartByCond.action")
 public String queryCartByCond(String cond, String name, String number) {
 Cart cart = new Cart();
 if (cond != null) {
 if ("username".equals(cond)) {
 cart.setUsername(name);
 }
 if ("jiancainame".equals(cond)) {
 cart.setJiancainame(name);
 }
 if ("num".equals(cond)) {
 cart.setNum(name);
 }
 if ("price".equals(cond)) {
 cart.setPrice(name);
 }
 }
 
 List<String> nameList = new ArrayList<String>();
 List<String> valueList = new ArrayList<String>();
 
 | 
| 12
 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
 
 | 	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)) {
 buffer.append("下一页");
 } else {
 buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
 }
 buffer.append("  ");
 if (maxPage <= (Integer.parseInt(number) + 1)) {
 buffer.append("尾页");
 } else {
 buffer.append("<a href=\"index/article.action?number=" + (maxPage - 1) + "\">尾页</a>");
 }
 html = buffer.toString();
 this.getRequest().setAttribute("html", html);
 this.getRequest().setAttribute("articleList", articleList);
 return "users/article";
 }
 
 // 阅读公告
 @RequestMapping("read.action")
 public String read(String id) {
 this.front();
 Article article = this.articleService.getArticleById(id);
 article.setHits("" + (Integer.parseInt(article.getHits()) + 1));
 this.articleService.updateArticle(article);
 this.getRequest().setAttribute("article", article);
 return "users/read";
 }
 
 // 准备登录
 @RequestMapping("preLogin.action")
 public String prelogin() {
 this.front();
 
 | 
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=141422312105200hv
https://javayms.pages.dev?id=141422312105200hv