基于Springboot实现快消品商城管理系统

作者主页:编程千纸鹤

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

主要内容:Java项目开发、Python项目开发、大学数据和AI项目开发、单片机项目设计、面试技术整理、最新技术分享

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

文末获得源码

 项目编号:BS-SC-048

一,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:Springboot+HTML

二,项目简介

信息化技术在商业上的应用越来越突出,其中最典型的就是电商平台的大量使用,将传统的购物模式从线下搬到了线上,让商业和用户的距离更近,购买更方便,大大刺激了终端用户的消费。但与此同时也带来了商品信息爆炸给人们带来的选择困难及相关的干扰。如何能让用户在海量的商品数据中快速寻找到适合自己的商品,也一直是技术人员们力求解决的问题。随着大数据技术的发展以及各种推荐系统的应用,相关的推荐算法应用也越来越成熟,本课题就是主要研究如何通过电商平台实现为用户的商品推荐系统。

本系统主要以快消品的垂直电商平台为例进行研究,采用Java开发语言平台的相关技术,整体基于B/S的三层体系结构来进行开发,并同时使用MVC设计模式有效的前端代码和数据模型分离,有效的实现了系统的可重用性设计。具体系统的后台服务接口采用Springboot框架集成Mybatis框架来实现业务逻辑编程和服务接口开发,前端采用HTML和Ajax实现与后台的异步交互和数据展示。

这次设计基于Springboot实现的快消品商城网站,它的核心主要功能有前台功能模块,和后台功能模块。前台功能模块中,主要涉及和包含用户注册登陆 、个人订单管理模块、购物车管理模块等[24]。后台管理模块,主要涉及和包含有快消品分类管理模块(主要管理快消品分类信息),快消品信息管理模块(主要管理涉及到网站的快消品信息),用户管理模块(主要管理用户的基本信息),订单管理模块(主要管理前端用户生成的订单信息),品牌管理模块(主要管理快消品的品牌信息),销售统计模块(以图形报表的方式统计交易订单)等[18],

前端用户功能描述:

   1)注册登陆:商品推荐系统中的用户只有注册为会员,并在线登陆后才可以进行在线下单等相关的操作,它是一些需要授权模块操作的前提。

   2)分类浏览:用户在商品推荐系统中可以根据商品信息的分类来进行浏览,以便快速定位自己想要的商品。

   3)全文检索:主要提供以搜索关键词进行模糊查询匹配的商品搜索功能。

   4)购物车:用户可以将自己选中的商品临时添加到购物车中,它模拟了线下商场中的购物车功能,可以进行商品的增减。

   5)在线下单:完成商品的在线购物操作,下单时需要选择自己的收货地址。

   6)地址管理:主要管理会员自己的订单收货地址信息。

   7)个人订单:完成个人订单信息的基本管理操作,可以进行确认收货等操作。

   8)个人信息:主要是管理个人的基本信息和登陆密码等。

   后端管理用户功能描述:

  1. 用户管理:主要对前端注册的会员用户进行信息管理操作。
  2. 分类管理:主要对在线展示的商品信息更加方便的管理,物以类聚。
  3. 商品管理:对前端展示的售卖商品和推荐的商品进行管理操作。

   4)订单管理:对用户下单信息进行管理操作,可以根据订单处理的进度来修改订单状态。

   5)品牌管理:商品关联的有品牌信息,用户在前端也可以根据品牌进行查询。

   6)轮播图管理:管理前端展示的轮播广告图片。

   7)订单统计:主要以图形报表的形式来统计各类商品的销售情况,看看哪些是热销商品,目前实现饼状图和柱状图。

   8)个人密码修改:主要给管理提供一个修改密码的功能。

三,系统展示

首页

用户注册

用户登录

商品详情

购物车

订单

后台管理

四,核心代码展示

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";

    }

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

import com.yw.eshop.domain.*;
import com.yw.eshop.service.*;
import com.yw.eshop.domain.Order;
import com.yw.eshop.domain.OrderProduct;
import com.yw.eshop.domain.ReceiveAddress;
import com.yw.eshop.domain.User;
import com.yw.eshop.utils.PageModel;
import com.yw.eshop.service.*;
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/order")
public class OrderController {
    @Autowired
    private ProductService productService;
    @Autowired
    private ProductTypeService productTypeService;

    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderProductService orderProductService;
    @Autowired
    private UserService userService;
    @Autowired
    private ReceiveAddressService receiveAddressService;
    /**
     * 订单查询列表
     * @param pageNo
     * @param pageSize
     * @param id
     * @param model
     * @return
     */
    @RequestMapping("/list")
    public String list( @RequestParam(defaultValue = "1") Integer pageNo,
                        @RequestParam(defaultValue = "5")Integer pageSize,
                        String id,
                        Model model){
        try {
            if(id==null || id.length()<=0){
                id=null;
            }
            PageModel<Order> orderPage = orderService.queryOrderPage(pageNo, pageSize, id);
            List<Order> orderList = orderPage.getList();
            for (Order order : orderList) {
                List<OrderProduct> orderProducts = orderProductService.queryOrderProByOrderId(order.getId());
                order.setList(orderProducts);
                User user = userService.queryUserById(order.getUserId());
                order.setUser(user);
                ReceiveAddress receiveAddress = receiveAddressService.queryAddressByID(order.getReceivingAddress());
                order.setReceiveAddress(receiveAddress);
            }
            orderPage.setList(orderList);

            model.addAttribute("id",id);
            model.addAttribute("orderPage",orderPage);
        } catch (Exception e) {
            e.printStackTrace();
            model.addAttribute("errMessage", "查询失败:"+e.getMessage());
            return  "500";
        }
        return "admin/order/list";
    }


    /**
     * 更新订单状态
     * @param id
     * @param status
     * @param model
     * @return
     */
    @RequestMapping("update")
    private String update(String id,Integer status,Model model){
        try {
            int i = orderService.updateStatus(id,status);
            if (i==0){
                model.addAttribute("errMessage","服务器繁忙操作失败");
                return "500";
            }
        }catch (Exception e){
            model.addAttribute("errMessage",e.getMessage());
            return "500";
        }
        model.addAttribute("url", "admin/order/list");
        return "success";


    }

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

    }

    /**
     * 批量删除订单
     * @param ids
     * @return
     */
    @RequestMapping("batchDel")
    @ResponseBody
    public String batchDel(String[] ids) {
        orderService.batchOrderDel(ids);
        return "/admin/order/list";

    }

}

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程千纸鹤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值