鲜花商城|基于Springboot实现鲜花商城系统

时间:2022-12-06 08:54:11

作者主页:编程千纸鹤

作者简介:Java、前端、Pythone开发多年,做过高程,项目经理,架构师

主要内容:Java项目开发、毕业设计开发、面试技术整理、最新技术分享

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

文末获得源码

项目编号:BS-SC-017

前言:

本文设计并实现的商城系统,通过互联网来实现电子商城这一新兴产业,电子商城主要依靠于计算机互联网技术。如果缺少了这个技术,就没有办法实现电子商城,如果要想完美实现,互联网技术就要有重大发展。这样,电子商城就带动了科技的巨大进步。用户就可以随时随地完成搜索商品、挑选商品、购买商品的全部过程。对于商家而言,网上购买商品有如下优点:不受场地限制、购买成本低、降低了风险、有利于更好的刺激用户去消费购买。对于消费者来说,网上购买商品有如下优点:价格便宜方便性、足不出户就能买到满意的商品。对商家而言,网上出售商品有如下优点:可以为商家节省了商店的租金、人力成本减少,最重要的是商品的价格也会大大降低。

本系统不同于传统的购物方式,用户使用起来更加方便,获得一个良好的购物体验。基于人们对美好生活的热爱,本电商系统主要以售卖鲜花为主。希望能通过本次毕业设计给自己四年大学所学的技术有一个很的总结,也希望通过这次毕业设计来检验和提升自己的技术能力。

一,项目简介

“花香”鲜花网店主要研究内容是引导用户挑选最适合自己的鲜花。使用户根据自身情况做出最科学的选择,选择最适合自己的鲜花。网店包括两种角色:用户、管理员。具体实现以下功能模块:

用户模块:

  1. 游客页面:网店最开始的页面,陈列了所有商品信息,任何人皆可访问。

但是重要权限受限制。

  1. 用户登录:用于实现用户登录功能,登录需要账号密码,若无则需注册。
  2. 网站首页:用户登录成功后跳转的页面,陈列了所有商品信息,用户具有一些重要权限。
  3. 物品搜索:用于输入物品名称(以及禁忌,好处等关键词)搜索相应物品。
  4. 物品详情:用于查看物品详情及下单购买。
  5. 订单管理:用于管理自己下单的物品。
  6. 个人中心:用于修改个人资料、登录密码、收货地址等。

   管理员模块:

  1. 用户管理:用于管理员对用户进行增删改查操作。
  2. 物品类别管理:用于管理员对物品类别进行增删改查操作。
  3. 物品管理:用于管理员对发布的物品进行查、删操作。
  4. 品牌管理:主要管理鲜花品牌信息
  5. 订单管理:用于取消订单,修改订单信息。
  6. 统计页面:用于统计各类鲜花的销售情况。
  7. 个人中心:用于管理员对自身信息的修改。

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发:Springboot+Mybatis

前端开发技术:HTML+Bootstrap+Jquery

三,系统展示

首页

鲜花商城|基于Springboot实现鲜花商城系统

 

分类浏览

鲜花商城|基于Springboot实现鲜花商城系统

全文检索

鲜花商城|基于Springboot实现鲜花商城系统

 

品牌查询

鲜花商城|基于Springboot实现鲜花商城系统

详情浏览

鲜花商城|基于Springboot实现鲜花商城系统

 

 相似性推荐

 鲜花商城|基于Springboot实现鲜花商城系统

前端用户登陆

鲜花商城|基于Springboot实现鲜花商城系统

 

购物车查看

鲜花商城|基于Springboot实现鲜花商城系统

 

我的订单

鲜花商城|基于Springboot实现鲜花商城系统

收货地址管理

鲜花商城|基于Springboot实现鲜花商城系统 

 

 

后台管理员管理

用户管理

鲜花商城|基于Springboot实现鲜花商城系统

 

轮播图管理

鲜花商城|基于Springboot实现鲜花商城系统

 

商品分类管理

鲜花商城|基于Springboot实现鲜花商城系统

商品品牌管理

鲜花商城|基于Springboot实现鲜花商城系统

 

 商品管理

鲜花商城|基于Springboot实现鲜花商城系统

 

订单管理

鲜花商城|基于Springboot实现鲜花商城系统

 统计报表

鲜花商城|基于Springboot实现鲜花商城系统

 

四,核心代码展示

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.Carousel;
import com.yw.eshop.service.CarouselService;
import com.yw.eshop.utils.PageModel;
import com.yw.eshop.service.CarouselService;
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/carousel")
public class CarouselController {
    @Autowired
    private CarouselService service;
    @RequestMapping("/list")
    public String list(@RequestParam(defaultValue = "1") Integer pageNo,
                       @RequestParam(defaultValue = "5")Integer pageSize,
                       Model model){
        try {
            PageModel<Carousel> CarouselPages = service.queryCarouselPages(pageNo, pageSize);
            model.addAttribute("CarouselPages", CarouselPages);
        } catch (Exception e) {
            e.printStackTrace();
            model.addAttribute("errMessage", "查询失败:"+e.getMessage());
            return  "500";
        }
        return "admin/carousel/list";
    }

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

    }
    @RequestMapping("updatePage")
    public String updatePage(String id,Model model){
        Carousel carousel=service.queryCarouselById(id);
        model.addAttribute("carousel",carousel);
        return "admin/carousel/update";
    }
    @RequestMapping("/update")
    public String update(Carousel carousel, Model model){
        try {
            int i = service.updateCarousel(carousel);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/carousel/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 = service.delete(id);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/carousel/list");
        return "success";

    }

}

五,项目总结

 本网站的实现将经历软件的定义及规划、需求分析、软件设计、程序编码、软件测试这五个主要阶段。在软件的定义及规划和需求分析阶段对网站的需求进行分析并给出详细定义。通过软件设计阶段形成交互框架与视觉框架。之后进行详细设计,对概要设计进行细化。接着使用html,js,css进行前端设计,使用Spring Boot,Spring Security,Mybatis,Spring Mvc处理后端,最后结合MySql数据库,在idea平台上进行编码。最后对各个部分进行多次测试完成网站检验。