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








基于javaweb的SSM在线图书商城系统(java+ssm+freemarker+bootstrap+mysql+redis)
项目介绍
本项目分为前后台,有管理员与用户两种角色; 管理员角色包含以下功能: 管理员登录,商品分类管理,商品管理,商品属性管理,商品参数管理,订单管理,退款管理,退货管理,会员等级管理,客户信息管理,评论管理,文章分类管理,公告管理,文章管理,滚动图片管理,广告管理,热门查询管理,查询订单销售,查询商品销售,用户管理,角色管理,资源管理,修改密码,区域管理,配送方式管理,查看系统设置,缓存管理,查询到货通知等功能。
用户角色包含以下功能: 用户登录,查看首页,查看商品详情,查看购物车,提交订单,修改个人信息,修改密码,查看我的订单,添加配送地址,查看收藏夹等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:Eclipse;注:本项目目前仅支持Eclipse,暂不支持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+Mbytes 2. 前端:Freemarker+css+javascript+bootstrap+jQuery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用Eclipse导入项目,将项目中src目录下的conf.properties配置文件中的数据库配置改为自己的配置; 3. 运行项目,在浏览器中输入localhost:8080/ssm_zxbookshop 用户账号/密码: 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 43 44 45 46
|
accountService.sendEmail(e, NotifyTemplate.email_reg); } else {
throw new NullPointerException("不支持!"); }
model.addAttribute("uid", e.getId());
return "redirect:/account/checkEmail.html"; }
@RequestMapping(value = "sendEmailAgain", method = RequestMethod.POST) public String sendEmailAgain(String uid, ModelMap model) throws IOException{ if(StringUtils.isBlank(uid)){ throw new NullPointerException("参数不正确!"); } Account acc = accountService.selectById(uid); if(acc==null){ throw new NullPointerException("根据用户ID查询不到用户信息!"); } accountService.sendEmail(acc, NotifyTemplate.email_reg); model.addAttribute("uid", acc.getId());
return "redirect:/account/checkEmail.html"; }
@RequestMapping("checkEmail") public String checkEmail(){ logger.info("checkEmail");
|
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
|
model.addAttribute("e", e); return "/rate"; }
private PagerModel selectCommentList(Comment commentParam) throws Exception { HttpServletRequest request = RequestHolder.getRequest(); int offset = 0; if (request.getParameter("pager.offset") != null) { offset = Integer .parseInt(request.getParameter("pager.offset")); } if (offset < 0) offset = 0;
((PagerModel) commentParam).setOffset(offset); PagerModel pager = commentService.selectPageList(commentParam); if(pager==null)pager = new PagerModel(); pager.setPagerSize((pager.getTotal() + pager.getPageSize() - 1) / pager.getPageSize());
pager.setPagerUrl("rate"); return pager; }
|
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
| } public void setError(String error) { this.error = error; } }
class StockErrorProduct{ String id; String tips; public StockErrorProduct(){} public StockErrorProduct(String id,String tips){ this.id = id; this.tips = tips; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTips() { return tips; } public void setTips(String tips) { this.tips = tips; } }
class CartProductInfo { String code; String msg; String total0; String amount; int totalExchangeScore; int amountExchangeScore; public String getCode() { return code;
|
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
| e.setOffset(offset); PagerModel pager = getService().selectPageList(e); if (pager == null) { pager = new PagerModel(); } pager.setPagerSize((pager.getTotal() + pager.getPageSize() - 1) / pager.getPageSize()); pager.setPagerUrl("myCarts"); model.addAttribute("pager", pager); return "redirect:/account/orders"; }
@RequestMapping("deletes") public String deletes(String[] ids, HttpServletRequest request, @ModelAttribute("e") Order e, ModelMap model) throws Exception { getService().deletes(ids); return selectList(request, e, model); }
@RequestMapping("shouhuo") public String shouhuo(String id,HttpServletRequest request, @ModelAttribute("e") Order e, ModelMap model) throws Exception { Order order = orderService.selectById(id); order.setStatus("ok"); orderService.update(order); int offset = 0; if (request.getParameter("pager.offset") != null) { offset = Integer.parseInt(request.getParameter("pager.offset")); } if (offset < 0) offset = 0; e.setOffset(offset); PagerModel pager = getService().selectPageList(e); if (pager == null) { pager = new PagerModel(); } pager.setPagerSize((pager.getTotal() + pager.getPageSize() - 1) / pager.getPageSize()); pager.setPagerUrl("myCarts"); model.addAttribute("pager", pager); return "redirect:/account/orders";
|
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
| e.clear();
return "productList"; }
@RequestMapping("productListByAttrID") public String productListByAttrID(ModelMap model, @ModelAttribute("e")Product e) throws Exception{ try {
productList(model, e); } catch (Exception ex) { logger.error("productListByAttrID()异常:"+ex.getMessage()); ex.printStackTrace(); throw ex; } return "productList"; }
@RequestMapping("productList") public String productList(ModelMap model, @ModelAttribute("e")Product e) throws Exception{ try { String catalogCode = getCatalogCode(); logger.error("special="+e.getSpecial() + ",orderBy="+e.getOrderBy() + ",catalogCode="+catalogCode); Catalog item = systemManager.getCatalogsCodeMap().get(catalogCode); if(item==null){ throw new NullPointerException("目录为空!"); } logger.error("item.getId()="+item.getId());
|
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
| return toLogin; }
String id = address.getId(); if(StringUtils.isBlank(id)){ throw new NullPointerException("id is null!"); } Address add = new Address(); add.setId(id); addressService.delete(add); return address(model, address); }
@RequestMapping("editAddress") public String editAddress(ModelMap model, Address address){ Account acc = LoginUserHolder.getLoginAccount(); if (acc == null || StringUtils.isBlank(acc.getAccount())) { return toLogin; }
String id = address.getId(); if(StringUtils.isBlank(id)){ throw new NullPointerException("id is null!"); } address = addressService.selectById(id); if(StringUtils.isNotBlank(address.getArea())){
Map<String, Area> areaMap = SystemManager.getInstance().getAreaMap(); Area area = areaMap.get(address.getProvince()); if(area!=null && area.getChildren()!=null && area.getChildren().size()>0){ for(int i=0;i<area.getChildren().size();i++){ Area city = area.getChildren().get(i); if(city.getCode().equals(address.getCity())){ logger.error("address.getCity()="+address.getCity()); logger.error(city.toString()); address.setAreaList(city.getChildren()); break; } } } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=231122572008200tg
https://javayms.pages.dev?id=231122572008200tg