零食商城|基于springboot的零食商城

news2024/9/21 16:27:55

作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、掘金特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、毕业设计、简历模板、学习资料、面试题库、技术互助

收藏点赞不迷路  关注作者有好处

文末获取源码 

项目编号:BS-SC-020

前言:

互联网的兴起从本质上改变了整个社会的商品交易方式,国内各大企业从上个世纪90年代互联网兴起之时,就产生了通过网络进行销售经营商品的想法。但是由于在互联网上企业的信誉难以认证、网络的法规政策不健全、物流不发达等一系列的原因,限制了网上交易发展的步伐。进入21世纪以后,随着整个社会的发展、进步,制约网上交易的各个瓶颈问题逐一被击破,各企业也纷纷的加入到电子商务的洪潮之中。

根据会员企业艾瑞咨询集团的预测,2008年我国网络购物交易将同比增长125.1%,交易总量将达1263亿,形成了中国网络购物的快速增长浪潮,网络购物这一消费方式给人们生活带来的变化,除了购物场所的改变以外,更重要的是大大改变了传统的消费行为习惯,无论是否在网上购物,上网查看产品的相关信息,已经成为购物决策环节的重要组成部分,这一环节对购物行为的实际发生起到了至关重要的指导作用。

与传统销售方式相比,在线销售有很多优点:检索便捷,在线销售提供了多种检索途径,可以从分类、新品、特价等途径进行检索,快捷准确;信息量大,与传统销售方式相比,在线销售能够提供海量产品信息;成本低、风险小、无地域限制,零食购物最突出的优点是:不再限制消费者的购买时段,扩大和巩固了客户群,从而增加了企业的核心竞争力,节省实际开店时需要投入的成本和租用费用。

一,项目简介

(1)研究内容:

基于Spring boot框架搭建一个便捷的网络购物交易平台,极大方便了人们的日常生活,省时省力,只需要几分钟就可以浏览很多商品,在线下单后等待物流到家即可。因此网络购物交易平台的作用很大,研究其的目的和意义也很重要,其中研究内容包括:

  • 研究零食商铺网站的功能需求。
  • 研究零食商铺网站的建设方案。
  • 研究零食商铺网站的理论基础。
  • 研究零食商铺网站的策略和算法。
  • 研究零食商铺网站的数据库逻辑设计。

⑥研究零食商铺网站的总体设计方案和实施方案。

(2)功能要求:

系统的开发基于B/S结构,采用Spring boot技术处理后端数据和服务,采用MySQL数据库对系统数据进行储存,充分保证系统数据的安全性和稳定性。采用模块化设计。模块化设计要求将整个系统划分成基于小的模块,有利于代码的重载,简单方便的系统界面。设计简单友好的系统界面,方便用户较快的适应系统的操作。本系统主要功能有:

普通用户功能:商品信息浏览,在线下订单,在线注册,公告信息浏览,个人信息维护;

管理员用户功能:修改个人密码,商品类别管理,商品信息管理,会员管理,系统公告管理,订单管理。

通过本系统可以实现用户直接在浏览器上实现查看商品以及在线下单的功能,且操作简单,交易时安全系数高。本系统包括前端和后端功能:

I.前端功能

前端为普通用户使用的,包括下面一些功能:

  • 商品信息浏览:浏览网站中所有已经拥有的商品的基本信息。
  • 个人信息维护:用户可以对自己的用户信息进行修改,查看。
  • 在线下订单:用户可以直接在在线下单。
  • 在线注册:新用户可以直接在线注册自己的账号。
  • 公告信息浏览:用户可以直接浏览网站的公告。

II.后端功能

后端由管理员(系统管理员)进行登录,具有下面一些功能:

  • 修改个人密码:管理员可以对自己的密码进行修改。
  • 商品类别管理:管理员可以对商品的类别进行管理,商品类别是否正确合理,可以对商品的类别信息进行增删改等。
  • 商品信息管理:管理员可对商品的信息进行管理。
  • 会员管理:管理会员信息,用户名是否合法,是否存在有损平台利益的用户存在,可清除和更改等。
  • 系统公告管理:管理员可对系统公告进行修改、添加和删除,保证公告的合理正确性。

⑥订单管理:管理员对已经存在的订单进行核对,避免出错。

(3)工作要求:

① 简单方便的系统界面。设计简单友好的系统界面,方便用户较快的适应系统的操作。

② 根据功能设计合理的菜单,分别完成各项子功能。

③ 设计合理的输出界面,比如商品详细信息要简洁明了。

④ 功能完善和改进:做最后的修缮和调整,使得功能全面、运行流畅、贴近实际运行环境。

⑤ 撰写设计报告:整理资料完成设计报告。设计报告的形成要求以研究和设计结果为依据,设计报告的结构合理具有科学性,内容论述清楚,最终能够具有相关领域的参考价值。

⑥ 提交可执行程序及其相关代码、相关文档,进行答辩。

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发技术:Springboot+Mybatis

前台开发技术:Bootstrap+ajax+html+css

三,系统展示

前台首页

全文搜索

商品购买

 收货地址管理

我的订单

后台管理

品牌管理

 商品管理

 订单管理

销售统计

四,核心代码展示

package com.yw.eshop.controller.admin;

import com.yw.eshop.domain.Product;
import com.yw.eshop.domain.TongjiVo;
import com.yw.eshop.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/echart")
public class AdminTongjiController {
    @Autowired
    private ProductMapper productMapper;
    /*得到所有已被销售商品的销售情况*/
    @RequestMapping(value = "/adminEachartzhu")
    @ResponseBody
    public List<TongjiVo> getAllXiaoshou(){
        System.out.println("柱状图数据统计请求");
        return productMapper.tongjiBing();
    }

    /*管理员权限查询近日订单金额*/
    @RequestMapping(value = "/getAllOrdersComeInByDate")
    @ResponseBody
    public List<TongjiVo> getAllOrdersComeInByDate(){
        System.out.println("管理员权限查询近日订单金额");

        return productMapper.tongjiZhu();
    }
    /*跳转到销售柱状图页面*/
    @RequestMapping(value = "/toadminEachartzhu")
    public String toAdminEchart(){
        return "/admin/echart/xiaoshouZhu";
    }

    /*跳转到销售饼状图页面*/
    @RequestMapping(value = "/toadminEachartBin")
    public String  toadminEachartzhu2(){
        return "/admin/echart/xiaoshouBin";
    }

}

package com.yw.eshop.controller.admin;

import com.yw.eshop.domain.Brand;
import com.yw.eshop.domain.ProductType;
import com.yw.eshop.service.BrandService;
import com.yw.eshop.service.ProductTypeService;
import com.yw.eshop.utils.PageModel;
import com.yw.eshop.service.BrandService;
import com.yw.eshop.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/admin/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;
    @Autowired
    private ProductTypeService productTypeService;
    @RequestMapping("/list")
    public String list( @RequestParam(defaultValue = "1") Integer pageNo,
                       @RequestParam(defaultValue = "5")Integer pageSize,
                       Model model){
        try {
            PageModel<Brand> brandPages = brandService.queryBrandPages(pageNo, pageSize);
            model.addAttribute("brandPages", brandPages);
        } catch (Exception e) {
            e.printStackTrace();
            model.addAttribute("errMessage", "查询失败:"+e.getMessage());
            return  "500";
        }
        return "admin/brand/list";
    }
    @RequestMapping("addPage")
    public String addPage(Model model){
        List<ProductType> productTypes= productTypeService.queryProductTypeAll();
        model.addAttribute("productTypes",productTypes);
        return "admin/brand/add";
    }
    @RequestMapping("/add")
    private String addBrand(Brand brand,Model model){
        try {
            int i = brandService.addBrand(brand);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/brand/list");
        return "success";


    }
    @RequestMapping("updatePage")
    public String updatePage(String id,Model model){
       Brand brand= brandService.queryBrandById(id);
        List<ProductType> productTypes= productTypeService.queryProductTypeAll();
        model.addAttribute("productTypes",productTypes);
        model.addAttribute("brand",brand);
        return "admin/brand/update";
    }
    @RequestMapping("/update")
    private String update(Brand brand,Model model){
        try {
            int i = brandService.updateBrand(brand);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/brand/list");
        return "success";


    }
    @RequestMapping("deletePage")
    public String deletePage(String id,Model model){
        model.addAttribute("id",id);
        return "admin/carousel/delete";
    }
    @RequestMapping("/delete")
    public String delete(String id, Model model){
        try {
            int i = brandService.delete(id);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/brand/list");
        return "success";

    }
    @RequestMapping("batchDel")
    @ResponseBody
    public String batchDel(String[] ids) {
        System.out.println("进来了");
        brandService.batchProductTypeDel(ids);
        return "/admin/brand/list";

    }
}
package com.yw.eshop.controller.admin;

import com.yw.eshop.domain.User;
import com.yw.eshop.service.UserService;
import com.yw.eshop.utils.PageModel;
import com.yw.eshop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Controller
@RequestMapping("/admin")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/user/list")
    public String list(@RequestParam(defaultValue = "1")Integer pageNo,
                       @RequestParam(defaultValue = "10") Integer pageSize, Model model){
        PageModel<User> userPages = userService.queryUserList(pageNo, pageSize);
        model.addAttribute("userPages",userPages);
        return "admin/user/list";
    }
    @RequestMapping("/user/addPage")
    public String addPage(){
        return "admin/user/add";
    }
    @RequestMapping("/user/add")
    public String addUser(User user,Model model){
        try {
            user.setType(0);
            int i = userService.addUser(user);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙添加失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/user/list");
        return "success";

    }
    @RequestMapping("user/updatePage")
    public String updatePage(String id,Model model){
        User user = userService.queryUserById(id);
        model.addAttribute("user",user);
        return "admin/user/update";
    }
    @RequestMapping("/user/update")
    public String updateUser(User user,Model model){
        try {
            int i = userService.updateUser(user);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙修改失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/user/list");
        return "success";

    }
    @RequestMapping("user/deletePage")
    public String deletePage(String id,Model model){
        model.addAttribute("id",id);
        return "admin/user/delete";
    }
    @RequestMapping("user/delete")
    public String deleteUser(String id,Model model){
        try {
            int i = userService.deleteUser(id);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙修改失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/user/list");
        return "success";
    }
}

package com.yw.eshop.controller.front;

import com.yw.eshop.domain.Carousel;
import com.yw.eshop.domain.Product;
import com.yw.eshop.domain.ProductType;
import com.yw.eshop.domain.SearchHistory;
import com.yw.eshop.service.CarouselService;
import com.yw.eshop.service.ProductService;
import com.yw.eshop.service.ProductTypeService;
import com.yw.eshop.service.SearchHistoryService;
import com.yw.eshop.service.CarouselService;
import com.yw.eshop.service.ProductService;
import com.yw.eshop.service.ProductTypeService;
import com.yw.eshop.service.SearchHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/front")
public class FrontIndexController {

    @Autowired//轮播图
    private CarouselService carouselService ;
    @Autowired//商品类型
    private ProductTypeService productTypeService ;
    @Autowired//商品
    private ProductService productService ;
    @Autowired
    private SearchHistoryService searchHistoryService;
    @RequestMapping("/index")
    public String index(Model model){
        //轮播图
        List<Carousel> carousels = carouselService.queryCarouselAll();
        model.addAttribute("allcarouselFigures",carousels);
        //分类
        List<ProductType> productTypes = productTypeService.queryProductTypeAll();
        model.addAttribute("allProductTypes",productTypes);
        //新品
        List<Product> newProducts = productService.queryNewProduct(6);
        model.addAttribute("newProducts", newProducts);
        //查询热搜词
        List<SearchHistory> searchHistorys = searchHistoryService.querySearchHistoryPages(10);
        model.addAttribute("searchHistorys",searchHistorys);
        //排行榜
        List<Product> rankings = productService.queryProductRankings();
        model.addAttribute("rankings", rankings);
        //饼干
        ProductType productType = new ProductType();
        productType.setProductTypeName("饼干");
        Product product = new Product();
        product.setProductType(productType);
        List<Product> list = productService.queryProductsByType(product, 5);
        model.addAttribute("list", list);
        //肉铺
        productType.setProductTypeName("肉铺");
        product.setProductType(productType);
        List<Product> list2 = productService.queryProductsByType(product, 12);
        model.addAttribute("list2", list2);
        //坚果
        productType.setProductTypeName("坚果");
        product.setProductType(productType);
        List<Product> list3 = productService.queryProductsByType(product, 5);
        model.addAttribute("list3", list3);
        //果干
        productType.setProductTypeName("果干");
        product.setProductType(productType);
        List<Product> list4 = productService.queryProductsByType(product, 12);
        model.addAttribute("list4", list4);
        return "front/index/index";
    }
}

五,项目总结

本项目功能完整,美观大方,数据完善,人机交互符合要求,是一个不错的毕业设计作品。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/182385.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

GuLi商城-简介-项目介绍、分布式基础概念、微服务架构图

一、项目简介 1 、项目背景 1 &#xff09;、电商模式 市面上有 5 种常见的电商模式 B2B、B2C、C2B、C2C、O2O&#xff1b; 1 、 B2B 模式 B2B (Business to Business)&#xff0c; 是指商家与商家建立的商业关系。 如&#xff1a;阿里巴巴 2 、 B2C 模式 B2C (Business…

Win7安装高版本的NodeJS方法,亲测可用

Win7安装高版本的NodeJS方法 正常情况下&#xff0c;Win7所能支持的Node.js最高版本为:V13.14&#xff0c;在开发过程中&#xff0c;git下来的项目由于node版本比较高的原因&#xff0c;好多package都不能还原或出现诸多警告 网络大神分享的安装高版本的方法&#xff1a; 1、…

Express 通过 CORS 或 JSONP 解决跨域问题

文章目录参考描述同源策略同源同源策略示例CSRF 攻击解决跨域问题CORSCORS 响应头部Access-Control-Allow-Origin简单请求预检请求预检请求包含的两次请求解决CORS 中间件使用 CORS 中间件处理跨域请求JSONP通过原生 JS 向服务器端发起 JSONP 请求通过 jQuery 向客户端发起 JSO…

mysql:如何在windows环境下配置并随意切换两种mysql版本

系列文章目录 文章目录系列文章目录前言一、去官网下载zip安装包二、配置创建my.ini文件2.环境变量3、使用管理员身份打开dos命令窗口4、安装mysql8的服务和初始化data5、启动6 错误解决&#xff1a;修改mysql8服务的注册表最后前言 之前安装过5.7的版本 后来由于需要 就安装了…

天龙八部TLBB从0到1搭建教程-上

服务器的配置选择与购买 我们需要准备的东西,是环境安装和4核8G的服务器一台。 其实购买服务器的地方很多以下这些服务商都可以,具体看服务器的配置选择,像这种4核8G的 服务器价格在260-400之间一台仅供参考,当然还有带防的服务器价格就偏高了阿里云、腾讯、百度、西部数码…

年后公司新来一00后卷王,我们这帮老油条真干不过.....

都说00后躺平了&#xff0c;但是有一说一&#xff0c;该卷的还是卷。这不&#xff0c;我们公司来了个00后&#xff0c;工作没两年&#xff0c;跳槽到我们公司起薪18K&#xff0c;都快接近我了。后来才知道人家是个卷王&#xff0c;从早干到晚就差搬张床到工位睡觉了。 2023年春…

MySQL深分页 + 多字段排序场景的优化方案【三百万级数据量】

需求背景 目前产品需要针对一个大范围地区内的所有用户做排行榜功能&#xff0c;且这个排行榜有几个比较蛋疼的附加需求&#xff1a; 排行榜需要全量展示所有用户&#xff0c;且做分页展示&#xff08;大坑&#x1f4a5;&#xff09; 排行榜有4种排序条件&#xff0c;且每个排…

fatal error怎么解决,有什么快捷的解决方法

fatal error怎么解决&#xff0c;其实是有多种的解决方法的&#xff0c;主要是看你想用哪种解决方法去进行解决&#xff0c;下面一起来看看。 一.fatal error的解决方法 1、按winR&#xff0c;弹出运行窗口。 2、输入regedit点击确定&#xff0c;弹出注册表编辑器。 3、在注…

2023年数据库优化顶级原理

毫不夸张的说咱们后端工程师&#xff0c;无论在哪家公司&#xff0c;呆在哪个团队&#xff0c;做哪个系统&#xff0c;遇到的第一个让人头疼的问题绝对是数据库性能问题。如果我们有一套成熟的方法论&#xff0c;能让大家快速、准确的去选择出合适的优化方案&#xff0c;我相信…

Acwing-1116. 马走日

本题求有多少路径遍历棋盘上的所有点&#xff0c;属于外部搜索&#xff0c;所以需要回溯。另外&#xff0c;对于递归终止条件&#xff0c;我们添加一个参数用来表示当前遍历到第几个点&#xff0c;如果是n*m表明已经将棋盘遍历一遍了&#xff0c;方案数1&#xff0c;return即可…

Linux常用命令——screen命令

在线Linux命令查询工具(http://www.lzltool.com/LinuxCommand) screen 用于命令行终端切换 补充说明 Screen是一款由GNU计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地或远程的命令行会话&#xff0c;并在其间自由切换。GNU Screen可以看作是…

Linux学习笔记本(不定期持续更新)

一、概述 2023年&#xff0c;打算系统自学一遍Linux&#xff0c;分享到这里来&#xff0c;和大家一起相互学习&#xff0c;探讨。 二、Linux基础知识 Linux学习环境搭建学习每一门技术&#xff0c;系统环境很重要&#xff0c;好的系统环境能够极大提高学习效率。学习Linux也是一…

33. 实战:实现某网站店铺信息的查询与批量抓取(附源码)

目录 前言 目的 思路 代码实现 1. 请求URL&#xff0c;获取源代码 2. 解析源代码&#xff0c;获取数据 3. 完善保存数据的函数save_data 4. 理清main函数逻辑&#xff0c;循环传递每一页有效信息的参数 完整代码 运行效果 总结 前言 近日&#xff0c;我们每周四都能…

ESP-C3入门5. 使用通用计时器

ESP-C3入门5. 使用通用计时器一、 简介二、使用步骤三、操作函数1. 基本操作&#xff08;1&#xff09;定时器实例 gptimer_handle_t &#xff08;2&#xff09; 定时器配置结构体 gptimer_config_t&#xff08;3&#xff09; 定时器初始化 timer_init()&#xff08;3&#xff…

探索 Vue.js 中引用的力量:访问和操作 DOM 元素”

0.简介 Vue.js 是一个用于构建用户界面的渐进式 JavaScript 框架。它由 Evan You 于 2014 年创建&#xff0c;此后作为构建 Web 应用程序的工具越来越受欢迎。 Vue 的核心特性包括&#xff1a; 反应式数据绑定&#xff1a;Vue 使用反应式系统来跟踪对数据模型的更改并自动更新…

22年部署之docker学习

以下记录的是&#xff0c;我在学习中的一些学习笔记&#xff0c;这篇笔记是自己学习的学习大杂烩&#xff0c;主要用于记录&#xff0c;方便查找https://hub.docker.com/ 镜像中心Docker 常用命令&#xff1a; docker 运行相关运行&#xff1a; service docker start停止&#…

【三年面试五年模拟】算法工程师的独孤九剑秘籍(前十二式汇总篇)V1版

写在前面 【三年面试五年模拟】栏目专注于分享AI行业中实习/校招/社招维度的必备面积知识点与面试方法&#xff0c;并向着更实战&#xff0c;更真实&#xff0c;更从容的方向不断优化迭代。也欢迎大家提出宝贵的意见或优化ideas&#xff0c;一起交流学习&#x1f4aa; 大家好&a…

ABB机器人系统输入输出信号System Input和Output详解(一)

ABB机器人系统输入输出信号System Input和Output详解 System Input类型: 输入I/O信号可指定具体的系统输入项,比如Start或Motors on。该输入项会在不使用FlexPendant示教器或其它硬件装置的情况下触发一项交由系统处理的系统行动。 可以用一个PLC来触发相应的系统输入项。 注…

Node.js教程笔记(三)express

学习目标 能够使用express.static()快速托管静态资源 能够使用express路由精简项目结构 能够使用常见的express中间件 能够使用express创建API接口 能够在express中启用cors跨域资源共享 目录 初识Express Express路由 Express中间件 使用Express写接口 1、初识Expres…

【通信原理(含matlab程序)】实验三 数字基带信号及其频谱特性

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; 本人持续分享更多关于电子通信专业内容以及嵌入式和单片机的知识&#xff0c;如果大家喜欢&#xff0c;别忘点个赞加个关注哦&#xff0c;让我们一起共同进步~ &#x…