——————————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——————————
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 List<String> valueList = new ArrayList<String>(); nameList.add(cond); valueList.add(name); PageHelper.getPage(this .cartService.getCartByLike(cart), "cart" , nameList, valueList, 10 , number, this .getRequest(), "query" ); name = null ; cond = null ; return "admin/querycart" ; } @RequestMapping("getCartById.action") public String getCartById (String id) { Cart cart = this .cartService.getCartById(id); this .getRequest().setAttribute("cart" , cart); List<Users> usersList = this .usersService.getAllUsers(); this .getRequest().setAttribute("usersList" , usersList); List<Jiancai> jiancaiList = this .jiancaiService.getAllJiancai(); this .getRequest().setAttribute("jiancaiList" , jiancaiList); return "admin/editcart" ; } public CartService getCartService () { return cartService; } public void setCartService (CartService cartService) { this .cartService = cartService; } } package com.action;@Controller @RequestMapping(value = "/orders" , produces = "text/plain;charset=utf-8") public class OrdersAction extends BaseAction {@Autowired @Resource private OrdersService ordersService;@Autowired
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 @RequestMapping("addCity.action") public String addCity (City city) { this .cityService.insertCity(city); return "redirect:/city/createCity.action" ; } @RequestMapping("deleteCity.action") public String deleteCity (String id) { this .cityService.deleteCity(id); return "redirect:/city/getAllCity.action" ; } @RequestMapping("deleteCityByIds.action") public String deleteCityByIds () { String[] ids = this .getRequest().getParameterValues("cityid" ); for (String cityid : ids) { this .cityService.deleteCity(cityid); } return "redirect:/city/getAllCity.action" ; } @RequestMapping("updateCity.action") public String updateCity (City city) { this .cityService.updateCity(city); return "redirect:/city/getAllCity.action" ; } @RequestMapping("getAllCity.action") public String getAllCity (String number) { List<City> cityList = this .cityService.getAllCity(); PageHelper.getPage(cityList, "city" , null , null , 10 , number, this .getRequest(), null ); return "admin/listcity" ; } @RequestMapping("queryCityByCond.action") public String queryCityByCond (String cond, String name, String number) { City city = new City(); if (cond != null ) { if ("cityname" .equals(cond)) { city.setCityname(name); } } List<String> nameList = new ArrayList<String>(); List<String> valueList = new ArrayList<String>(); nameList.add(cond); valueList.add(name);
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 @Resource private OrdersService ordersService;@Autowired @Resource private UsersService usersService;@RequestMapping("createOrders.action") public String createOrders () {List<Users> usersList = this .usersService.getAllUsers(); this .getRequest().setAttribute("usersList" , usersList);return "admin/addorders" ;} @RequestMapping("addOrders.action") public String addOrders (Orders orders) {this .ordersService.insertOrders(orders);return "redirect:/orders/createOrders.action" ;} @RequestMapping("deleteOrders.action") public String deleteOrders (String id) {this .ordersService.deleteOrders(id);return "redirect:/orders/getAllOrders.action" ;} @RequestMapping("deleteOrdersByIds.action") public String deleteOrdersByIds () {String[] ids = this .getRequest().getParameterValues("ordersid" ); for (String ordersid : ids) {this .ordersService.deleteOrders(ordersid);} return "redirect:/orders/getAllOrders.action" ;} @RequestMapping("updateOrders.action") public String updateOrders (Orders orders) {this .ordersService.updateOrders(orders);return "redirect:/orders/getAllOrders.action" ;} @RequestMapping("getAllOrders.action") public String getAllOrders (String number) {List<Orders> ordersList = this .ordersService.getAllOrders(); PageHelper.getPage(ordersList, "orders" , null , null , 10 , number, this .getRequest(), null ); return "admin/listorders" ;}
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 } if ("peihuoid" .equals(cond)) { details.setPeihuoid(name); } if ("viewdate" .equals(cond)) { details.setViewdate(name); } } List<String> nameList = new ArrayList<String>(); List<String> valueList = new ArrayList<String>(); nameList.add(cond); valueList.add(name); PageHelper.getPage(this .detailsService.getDetailsByLike(details), "details" , nameList, valueList, 10 , number, this .getRequest(), "query" ); name = null ; cond = null ; return "admin/querydetails" ; } @RequestMapping("getDetailsById.action") public String getDetailsById (String id) { Details details = this .detailsService.getDetailsById(id); this .getRequest().setAttribute("details" , details); List<Jiancai> jiancaiList = this .jiancaiService.getAllJiancai(); this .getRequest().setAttribute("jiancaiList" , jiancaiList); List<City> cityList = this .cityService.getAllCity(); this .getRequest().setAttribute("cityList" , cityList); List<Peihuo> peihuoList = this .peihuoService.getAllPeihuo(); this .getRequest().setAttribute("peihuoList" , peihuoList); return "admin/editdetails" ; } public DetailsService getDetailsService () { return detailsService; } public void setDetailsService (DetailsService detailsService) { this .detailsService = detailsService; } } package com.action;
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(value = "/jiancai", produces = "text/plain;charset=utf-8") public class JiancaiAction extends BaseAction { @Autowired @Resource private JiancaiService jiancaiService; @Autowired @Resource private CateService cateService; @RequestMapping("createJiancai.action") public String createJiancai () { List<Cate> cateList = this .cateService.getAllCate(); this .getRequest().setAttribute("cateList" , cateList); return "admin/addjiancai" ; } @RequestMapping("addJiancai.action") public String addJiancai (Jiancai jiancai) { jiancai.setHits("0" ); jiancai.setSellnum("0" ); this .jiancaiService.insertJiancai(jiancai); return "redirect:/jiancai/createJiancai.action" ; } @RequestMapping("deleteJiancai.action") public String deleteJiancai (String id) { this .jiancaiService.deleteJiancai(id); return "redirect:/jiancai/getAllJiancai.action" ; } @RequestMapping("deleteJiancaiByIds.action") public String deleteJiancaiByIds () { String[] ids = this .getRequest().getParameterValues("jiancaiid" ); for (String jiancaiid : ids) { this .jiancaiService.deleteJiancai(jiancaiid); } return "redirect:/jiancai/getAllJiancai.action" ; }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=421422312105200it https://javayms.pages.dev?id=421422312105200it