Springboot+Vue项目-基于Java+MySQL的宠物商城网站系统(附源码+演示视频+LW)

news2024/10/6 16:17:58

大家好!我是程序猿老A,感谢您阅读本文,欢迎一键三连哦。

💞当前专栏:Java毕业设计

精彩专栏推荐👇🏻👇🏻👇🏻

🎀 Python毕业设计
🌎微信小程序毕业设计

开发环境

开发语言:Java
框架:Springboot+Vue
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7
数据库工具:Navicat12
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

演示视频

springboot273宠物商城网站设计与实现录像

原版高清演示视频-编号273:
https://pan.quark.cn/s/5cda95b17ee0

源码下载地址:

https://download.csdn.net/download/2301_76953549/89099786

LW目录

【如需全文请按文末获取联系】
在这里插入图片描述

目录

  • 开发环境
  • 演示视频
  • 源码下载地址:
  • LW目录
  • 一、项目简介
  • 二、系统设计
    • 2.1软件功能模块设计
    • 2.2数据库设计
  • 三、系统项目部分截图
    • 3.1管理员功能模块的实现
  • 四、部分核心代码
    • 4.1 用户部分
  • 获取源码或论文

一、项目简介

本次开发的宠物商城网站实现了收货地址管理、百科信息管理、购物车管理、字典管理、论坛管理、留言版管理、商品管理、商品收藏管理、商品评价管理、商品订单管理、用户管理、管理员管理等功能。

二、系统设计

2.1软件功能模块设计

在这里插入图片描述

2.2数据库设计

(1)下图是用户实体和其具备的属性。
在这里插入图片描述
(2)下图是留言版实体和其具备的属性。
在这里插入图片描述
(3)下图是购物车实体和其具备的属性。
在这里插入图片描述
(4)下图是论坛实体和其具备的属性。
在这里插入图片描述
(5)下图是百科信息实体和其具备的属性。
在这里插入图片描述
(9)下图是商品订单实体和其具备的属性。
在这里插入图片描述

三、系统项目部分截图

3.1管理员功能模块的实现

商品列表
如图5.1显示的就是商品列表页面,此页面提供给管理员的功能有:查看商品、新增商品、修改商品、删除商品等。

在这里插入图片描述
百科类型管理
百科类型管理页面显示所有百科类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的百科类型信息执行编辑更新,失效的百科类型信息也能让管理员快速删除。下图就是百科类型管理页面。百科类型管理界面如图5.3所示。
在这里插入图片描述
商品收藏管理
管理员可以对商品收藏进行管理,可以设置查看所有用户的收藏,可以删除某个用户的收藏。商品收藏管理界面如图5.2所示。
在这里插入图片描述

四、部分核心代码

4.1 用户部分


package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 留言版
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/liuyan")
public class LiuyanController {
    private static final Logger logger = LoggerFactory.getLogger(LiuyanController.class);

    @Autowired
    private LiuyanService liuyanService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表service
    @Autowired
    private YonghuService yonghuService;



    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("用户".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = liuyanService.queryPage(params);

        //字典表数据转换
        List<LiuyanView> list =(List<LiuyanView>)page.getList();
        for(LiuyanView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        LiuyanEntity liuyan = liuyanService.selectById(id);
        if(liuyan !=null){
            //entity转view
            LiuyanView view = new LiuyanView();
            BeanUtils.copyProperties( liuyan , view );//把实体数据重构到view中

                //级联表
                YonghuEntity yonghu = yonghuService.selectById(liuyan.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody LiuyanEntity liuyan, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");
        else if("用户".equals(role))
            liuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        Wrapper<LiuyanEntity> queryWrapper = new EntityWrapper<LiuyanEntity>()
            .eq("yonghu_id", liuyan.getYonghuId())
            .eq("liuyan_name", liuyan.getLiuyanName())
            .eq("liuyan_text", liuyan.getLiuyanText())
            .eq("reply_text", liuyan.getReplyText())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        LiuyanEntity liuyanEntity = liuyanService.selectOne(queryWrapper);
        if(liuyanEntity==null){
            liuyan.setInsertTime(new Date());
            liuyan.setCreateTime(new Date());
            liuyanService.insert(liuyan);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody LiuyanEntity liuyan, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            liuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        //根据字段查询是否有相同数据
        Wrapper<LiuyanEntity> queryWrapper = new EntityWrapper<LiuyanEntity>()
            .notIn("id",liuyan.getId())
            .andNew()
            .eq("yonghu_id", liuyan.getYonghuId())
            .eq("liuyan_name", liuyan.getLiuyanName())
            .eq("liuyan_text", liuyan.getLiuyanText())
            .eq("reply_text", liuyan.getReplyText())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        LiuyanEntity liuyanEntity = liuyanService.selectOne(queryWrapper);
        liuyan.setUpdateTime(new Date());
        if(liuyanEntity==null){
            liuyanService.updateById(liuyan);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        liuyanService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        try {
            List<LiuyanEntity> liuyanList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            LiuyanEntity liuyanEntity = new LiuyanEntity();
//                            liuyanEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            liuyanEntity.setLiuyanName(data.get(0));                    //留言标题 要改的
//                            liuyanEntity.setLiuyanText(data.get(0));                    //留言内容 要改的
//                            liuyanEntity.setReplyText(data.get(0));                    //回复内容 要改的
//                            liuyanEntity.setInsertTime(date);//时间
//                            liuyanEntity.setUpdateTime(new Date(data.get(0)));          //回复时间 要改的
//                            liuyanEntity.setCreateTime(date);//时间
                            liuyanList.add(liuyanEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        liuyanService.insertBatch(liuyanList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }





    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        // 没有指定排序字段就默认id倒序
        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
            params.put("orderBy","id");
        }
        PageUtils page = liuyanService.queryPage(params);

        //字典表数据转换
        List<LiuyanView> list =(List<LiuyanView>)page.getList();
        for(LiuyanView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        LiuyanEntity liuyan = liuyanService.selectById(id);
            if(liuyan !=null){


                //entity转view
                LiuyanView view = new LiuyanView();
                BeanUtils.copyProperties( liuyan , view );//把实体数据重构到view中

                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(liuyan.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody LiuyanEntity liuyan, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());
        Wrapper<LiuyanEntity> queryWrapper = new EntityWrapper<LiuyanEntity>()
            .eq("yonghu_id", liuyan.getYonghuId())
            .eq("liuyan_name", liuyan.getLiuyanName())
            .eq("liuyan_text", liuyan.getLiuyanText())
            .eq("reply_text", liuyan.getReplyText())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        LiuyanEntity liuyanEntity = liuyanService.selectOne(queryWrapper);
        if(liuyanEntity==null){
            liuyan.setInsertTime(new Date());
            liuyan.setCreateTime(new Date());
        liuyanService.insert(liuyan);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


}

获取源码或论文

如需对应的LW或源码,以及其他定制需求,也可以点我头像查看个人简介联系。

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

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

相关文章

调试记录 CPU PCIE 找不到设备,AC 耦合电容的问题

1. 问题 现象&#xff1a; 1. 国产CPU的主板&#xff0c;主板内的PCIE 设备找的到&#xff0c;但是另一块板子上连接的PCIE 设备找不到。 2. 排查问题在哪里的计划 1. 检查原理图先排除信号定义的问题&#xff0c; TXRX是否反接。 2. 示波器检查PCIE 的时钟频率是否正确。 3. …

图神经网络(GNNs)在时间序列分析中的应用

时间序列数据是记录动态系统测量的主要数据类型&#xff0c;由物理传感器和在线过程&#xff08;虚拟传感器&#xff09;大量生成。时间序列分析对于解锁可用数据中隐含的丰富信息至关重要。随着图神经网络&#xff08;GNNs&#xff09;的最近进展&#xff0c;基于GNN的方法在时…

[嵌入式系统-73]:RT-Thread-快速上手:如何选择RT Thread的版本?

目录 如何选择合适的 RT-Thread 版本进行开发&#xff1f; RT-Thread 分支与版本介绍 如何选择 发布版本&#xff08;GitHub releases&#xff09; 开发分支&#xff08;GitHub master 主分支&#xff09; 长期支持分支&#xff08;GitHub lts-v3.1.x 分支&#xff09; …

面向对象设计之套路——设计模式

1、总则 面向对象的分析设计编程思想&#xff0c;通过封装、继承、多态把程序的耦合度降低&#xff0c;用设计模式使得程序更加灵活&#xff0c;容易修改&#xff0c;并且易于复用。 让业务逻辑与界面逻辑分开&#xff0c;让它们的耦合度下降&#xff0c;只有分离&#xff0c;…

JAVA使用Apache POI动态导出Word文档

文章目录 一、文章背景二、实现步骤2.1 需要的依赖2.2 创建模板2.3 书写java类2.3.1 模板目录2.3.2 Controller类2.3.2 工具类 2.4 测试2.4.1 浏览器请求接口2.4.2 下载word 三、注意事项四、其他导出word实现方式 一、文章背景 基于Freemarker模版动态生成并导出word文档存在弊…

西米支付:数字藏品元宇宙的介绍与骗局套路解析

一、什么是元宇宙&#xff1f; 元宇宙是一个集体虚拟共享空间&#xff0c;由虚拟增强的物理现实和物理持久的虚拟空间融合而创造&#xff0c;包括所有虚拟世界、增强现实和互联网的总和。简单地说&#xff0c;元宇宙是Web3.0时期的数字世界。 这类新兴概念被非法分子包装后&am…

JVM基础之垃圾回收

垃圾回收 1. Base 内存泄漏&#xff1a;不再使用的对象在系统中未被回收 内存溢出&#xff1a;内存泄漏的积累 手动触发垃圾回收&#xff1a;System.gc(),该方法不一定会立即回收垃圾&#xff0c;仅仅是向JVM发送一个垃圾回收请求&#xff0c;具体是否需要垃圾回收由JVM自行…

【树莓派4B】如何用树莓派的串口发送数据给单片机

文章目录 查看路由器中的树莓派IProot连接打开vnc远程桌面服务打开win的远程桌面软件输入IP和端口串口发送数据硬件连接树莓派发送 查看路由器中的树莓派IP root连接 打开vnc远程桌面服务 vncserver :1打开win的远程桌面软件 输入IP和端口 192.168.3.33:1输入密码qwer1234后点…

draw.io-24-windows-no-installer.exe是一个自解压文件

draw.io-24-windows-no-installer.exe是一个自解压文件&#xff0c;每次启动都会执行解压操作&#xff0c;在以下两个位置产生程序主体文件draw.io.exe&#xff0c;大约170M&#xff0c;程序关闭后再删除解压后的文件&#xff0c;给硬盘增加不必要的读写操作。 C:\Users\AAA\Ap…

工作中使用Optional过滤出符合条件的数据

工作中使用Optional获取非空对象的属性 实体类Optional对非空对象的处理满足过滤条件返回的值不满足条件返回的值 实体类 package po;import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;import java.io.Serializable;Data AllArgsConst…

从零开始写 Docker(十四)---重构:实现容器间 rootfs 隔离

本文为从零开始写 Docker 系列第十四篇&#xff0c;实现容器间的 rootfs 隔离&#xff0c;使得多个容器间互不影响。 完整代码见&#xff1a;https://github.com/lixd/mydocker 欢迎 Star 推荐阅读以下文章对 docker 基本实现有一个大致认识&#xff1a; 核心原理&#xff1a;…

数据库基础语法二

一、数据库 1、登陆数据库 2、创建数据库zoo 3、修改数据库zoo字符集为gbk 4、选择当前数据库为zoo 5、查看创建数据库zoo信息 6、删除数据库zoo mysql -uroot -p #登陆数据库 create database zoo; #创建数据库zoo alter database zoo character set gbk collate gbk_…

ArrayList的深拷贝与浅拷贝

1、深拷贝 通过以下代码进行理解 import java.util.ArrayList; import java.util.List;public class Demo {public static void main(String[] args) {List<Integer> c new ArrayList<>();c.add(1);c.add(2);c.add(3);List<Integer> c1 new ArrayList<…

理解Go语言中的测试种类

测试金字塔将测试分为不同的类别,如下图所示 单元测试在金字塔的底部。大部分测试都是单元测试,它们编写成本代、执行速度快且执行结果高度确定。通常,越往金子塔的上层走,测试变得越复杂,运行速度越慢,并且越难保证执行结果的确定性。 一个常见的技巧是明确说明要运行哪…

xhci 寄存器学习

xhci 寄存器介绍 查看linux 代码&#xff1a; 1733 /* There is one xhci_hcd structure per controller */ 1734 struct xhci_hcd { 1735 struct usb_hcd *main_hcd; 1736 struct usb_hcd *shared_hcd; 1737 /* glue to PCI and HCD framework */ 1738 stru…

爱喵喵宠物网站系统asp.netmvc

c#asp.net mvc爱喵喵宠物网站系统asp.netmvc 说明文档 运行前附加数据库.mdf&#xff08;或sql生成数据库&#xff09; 主要技术&#xff1a; 基于asp.net mvc架构和sql server数据库 功能模块&#xff1a; 首页 预约 猫生活 猫科普 参馆 个人中心 管理员后台可以对猫猫和猫…

闲聊大模型

人工智能&#xff0c;机器学习&#xff0c;神经网络&#xff0c;深度学习&#xff0c;大模型 https://www.ibm.com/cn-zh/topics/machine-learning https://www.ibm.com/cloud/blog/ai-vs-machine-learning-vs-deep-learning-vs-neural-networks ChatGPT https://openai.com/…

使用Pycharm编写Python程序时对基本类结构中方法的重写的两种初步操作方式

使用Pycharm编写Python程序时对基本类结构中方法的重写的两种初步操作方式 Python和其他一些高级面向对象的编程语言中&#xff0c;子类可继承父类中的方法&#xff0c;而不需要重新编写相同的方法。但有时子类并不想原封不动地继承父类的方法&#xff0c;而是想作一定的修改&…

02.文件IO

文件描述符 表述打开的文件的 它是open函数的返回值&#xff0c;一个进程启动之后&#xff0c;会默认打开3个文件标识符 0标准输入&#xff0c;1标准输出&#xff0c;2标准错误 新的打开的文件返回文件描述符表中未使用过的最小的文件描述符 open函数 用来打开或者新建一个文件…

Nvidia V100 GPU 运行 InternVL 1.5-8bit

InternVL 运行 InternVL 1.5-8bit教程 InternVL 官网仓库及教程 1. 设置最小环境 conda create --name internvl python3.10 -y conda activate internvl conda install pytorch2.2.2 torchvision pytorch-cuda11.8 -c pytorch -c nvidia -y pip install transf…