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





















基于javaweb的SpringBoot网上水果超市商城设计和实现(java+ssm+springboot)
主要技术实现:spring、 springmvc、 springboot、 mybatis 、session、 jquery 、 md5 、bootstarp.js 拦截器等。
主要功能实现: 前端:登录、注册、商品分类查看、浏览水果商品、订单管理、发表评论、收藏商品、购物车管理、个人订单管理查看、个人信息查看修改、地址管理等
后台管理员:后台登录、数据统计、系统版本信息等、管理员管理、角色管理、订单管理、通知公告管理、商品种类、和商品详情管理
主要功能截图如下:
用户填写相关信息进行注册:
水果商品数据列表查看:也可以根据关键字搜索水果商品信息
水果商品详情管理:点击可以查看水果商品购买详情数据、可以进行数量操作、加入订单和购物车以及收藏商品和查看排行等功能
我的购物车详情:可以结算以及继续购物和删除购物车信息等操作
订单详情管理:
我的个人信息管理:可以进行密码修改、订单查看管理、收藏查看管理、收获地址管理
我的评论查看:
我的收藏;可以移除收藏
后台管理员端主要实现:
超级管理员admin登录
系统首页:主要功能用户、角色、通知公告信息、商品种类以及商品详情管理和用户管理以及订单信息管理等数据操作。
后台菜单管理:
用户管理:
通知公告列表展示以及内容添加:
后台管理员对水果商品的管理:
上传商品详情信息:
商品评论数据维护:
订单管理和维护:
项目使用eclipse和idea运行、推荐idea、源码架构:
数据库设计ER图:
设计报告:
——————————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
| @Autowired private AdminMapper adminMapper;
@Autowired private AuthorityMapper authorityMapper;
@Autowired private IProductCategoryService productCategoryService;
@Autowired private ProductCategoryMapper productCategoryMapper;
@RequestMapping(value="/index",method= RequestMethod.GET) public String index(Model model, Integer id, HttpServletRequest request, String content, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize //每页5个数据 ) { if(StringUtil.isEmpty(content)) { model.addAttribute("PageInfo", productCategoryService.getProductCategoryByPage(pageNum, pageSize).getData()); }else { model.addAttribute("PageInfo", productCategoryService.getProductCategoryByPageAndContent(pageNum, pageSize, content).getData()); model.addAttribute("content",content); } Menu selectByPrimaryKey = menuMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } Admin loginedAdmin = (Admin) request.getSession().getAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY); List<Authority> selectByRoleId = authorityMapper.selectByRoleId(loginedAdmin.getRoleId()); Set<Integer> menuIdSet = selectByRoleId.stream().map(Authority :: getMenuId).collect(Collectors.toSet()); List<Menu> allMenusByStateAndPrimaryKeys = menuMapper.selectByStateAndPrimaryKeys(MenuStateEnum.OPEN.getCode(), menuIdSet); model.addAttribute("allAdmins", adminMapper.selectAll()); model.addAttribute("onThirdMenus", menuService.getThirdMenus(allMenusByStateAndPrimaryKeys).getData()); model.addAttribute("parentMenu", menuMapper.selectByPrimaryKey(selectByPrimaryKey.getParentId())); model.addAttribute("currentMenu", selectByPrimaryKey); return "admin/product_category/index"; }
|
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
|
@RequestMapping("/admin/system") @Controller public class SystemController {
@Autowired private AdminMapper adminMapper; @Autowired private AuthorityMapper authorityMapper;
@RequestMapping(value="/login",method=RequestMethod.GET) public String login(Model model) { return "admin/system/login"; }
@RequestMapping(value="/person_info",method=RequestMethod.GET)
|
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
|
@RequestMapping("/admin/menu") @Controller public class MenuController {
@Autowired private IMenuService menuService; @Autowired private MenuMapper menuMapper; @Autowired private AuthorityMapper authorityMapper;
@RequestMapping(value="/index",method=RequestMethod.GET) public String index(Model model,Integer id,HttpServletRequest request) { List<Menu> allMenus = menuMapper.selectAll(); model.addAttribute("FirstMenus",menuService.getFirstMenus(allMenus).getData()); model.addAttribute("SecondMenus",menuService.getSecondMenus(allMenus).getData()); model.addAttribute("ThirdMenus",menuService.getThirdMenus(allMenus).getData()); Menu selectByPrimaryKey = menuMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } Admin loginedAdmin = (Admin) request.getSession().getAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY); List<Authority> selectByRoleId = authorityMapper.selectByRoleId(loginedAdmin.getRoleId()); Set<Integer> menuIdSet = selectByRoleId.stream().map(Authority :: getMenuId).collect(Collectors.toSet()); List<Menu> allMenusByStateAndPrimaryKeys = menuMapper.selectByStateAndPrimaryKeys(MenuStateEnum.OPEN.getCode(), menuIdSet);
|
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
| public String index(Model model,Integer id,String name,HttpServletRequest request, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize //每页5个数据 ) { if(StringUtil.isEmpty(name)) { model.addAttribute("PageInfo", adminService.getAdminListByPage(pageNum, pageSize).getData()); }else { model.addAttribute("PageInfo", adminService.getAdminListByPageAndName(pageNum, pageSize, name).getData()); model.addAttribute("name",name); } model.addAttribute("RoleList", roleMapper.selectAll()); Menu selectByPrimaryKey = menuMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } Admin loginedAdmin = (Admin) request.getSession().getAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY); List<Authority> selectByRoleId = authorityMapper.selectByRoleId(loginedAdmin.getRoleId()); Set<Integer> menuIdSet = selectByRoleId.stream().map(Authority :: getMenuId).collect(Collectors.toSet()); List<Menu> allMenusByStateAndPrimaryKeys = menuMapper.selectByStateAndPrimaryKeys(MenuStateEnum.OPEN.getCode(), menuIdSet); model.addAttribute("onThirdMenus", menuService.getThirdMenus(allMenusByStateAndPrimaryKeys).getData()); model.addAttribute("parentMenu", menuMapper.selectByPrimaryKey(selectByPrimaryKey.getParentId())); model.addAttribute("currentMenu", selectByPrimaryKey); return "admin/admin/index"; }
@RequestMapping(value="/add",method=RequestMethod.GET) public String add(Model model) { model.addAttribute("RoleList", roleMapper.selectAll()); return "admin/admin/add"; }
@RequestMapping(value="/edit",method=RequestMethod.GET) public String edit(Model model,Integer id) { Admin selectByPrimaryKey = adminMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } model.addAttribute("RoleList", roleMapper.selectAll()); model.addAttribute("editAdmin", selectByPrimaryKey); return "admin/admin/edit";
|
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
| package com.demo.controller.common;
@Controller @RequestMapping("/ueditor") public class FileController {
private String uploadPhotoPath = System.getProperty("user.dir") + "/src/main/resources/upload/photo/";
@RequestMapping(value = "/file") @ResponseBody public String file(HttpServletRequest request) { String s = "{\n" + " \"imageActionName\": \"uploadimage\",\n" + " \"imageFieldName\": \"file\", \n" + " \"imageMaxSize\": 2048000, \n" + " \"imageAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"], \n" + " \"imageCompressEnable\": true, \n" + " \"imageCompressBorder\": 1600, \n" + " \"imageInsertAlign\": \"none\", \n" + " \"imageUrlPrefix\": \"\",\n" + " \"imagePathFormat\": \"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}\" }"; return s; }
@RequestMapping(value = "/imgUpdate") @ResponseBody public String imgUpdate(MultipartFile file, HttpServletRequest request) throws FileNotFoundException {
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=341422292105200fg
https://javayms.pages.dev?id=341422292105200fg