基于javaweb的SpringBoot网上水果超市商城设计和实现(java+ssm+springboot)

运行环境

Java≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

580023032402

590023032402

000023042402

020023042402

030023042402

040023042402

050023042402

060023042402

070023042402

080023042402

090023042402

100023042402

110023042402

130023042402

140023042402

150023042402

160023042402

170023042402

180023042402

190023042402

200023042402

基于javaweb的SpringBoot网上水果超市商城设计和实现(java+ssm+springboot)

主要技术实现:spring、 springmvc、 springboot、  mybatis 、session、 jquery 、 md5 、bootstarp.js  拦截器等。

主要功能实现: 前端:登录、注册、商品分类查看、浏览水果商品、订单管理、发表评论、收藏商品、购物车管理、个人订单管理查看、个人信息查看修改、地址管理等

后台管理员:后台登录、数据统计、系统版本信息等、管理员管理、角色管理、订单管理、通知公告管理、商品种类、和商品详情管理

主要功能截图如下:

用户填写相关信息进行注册:

水果商品数据列表查看:也可以根据关键字搜索水果商品信息

水果商品详情管理:点击可以查看水果商品购买详情数据、可以进行数量操作、加入订单和购物车以及收藏商品和查看排行等功能

我的购物车详情:可以结算以及继续购物和删除购物车信息等操作

订单详情管理:

我的个人信息管理:可以进行密码修改、订单查看管理、收藏查看管理、收获地址管理

我的评论查看:

我的收藏;可以移除收藏

后台管理员端主要实现:

超级管理员admin登录

系统首页:主要功能用户、角色、通知公告信息、商品种类以及商品详情管理和用户管理以及订单信息管理等数据操作。

后台菜单管理:

用户管理:

通知公告列表展示以及内容添加:

后台管理员对水果商品的管理:

上传商品详情信息:

商品评论数据维护:

订单管理和维护:

项目使用eclipse和idea运行、推荐idea、源码架构:

数据库设计ER图:

设计报告:

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;

/**
* 商品种类列表页面
* @param model
* @param id
* @param request
* @param content
* @param pageNum
* @param pageSize
* @return
*/
@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());//把权限中所有菜单id取出来
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;


/**
* 系统登录页面
* @param model
* @return
*/
@RequestMapping(value="/login",method=RequestMethod.GET)
public String login(Model model) {
return "admin/system/login";
}

/**
* 个人信息页面
* @param model
* @return
*/
@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;


/**
* 菜单列表页面
* @param model
* @return
*/
@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());//把权限中所有菜单id取出来
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());//把权限中所有菜单id取出来
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";
}

/**
* 管理员添加页面
* @param model
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.GET)
public String add(Model model) {
model.addAttribute("RoleList", roleMapper.selectAll());
return "admin/admin/add";
}

/**
* 管理员编辑页面
* @param model
* @param id
* @return
*/
@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;



/**
* UEditor图片上传
*/
@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 {


项目链接:
https://javayms.github.io?id=341422292105200fg
https://javayms.pages.dev?id=341422292105200fg