Springboot+Vue项目-基于Java+MySQL的校园外卖服务系统(附源码+演示视频+LW)

news2024/10/6 17:14:47

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

💞当前专栏:Java毕业设计

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

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

开发环境

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

演示视频

springboot292

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

源码下载地址:

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

LW目录

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

目录

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

一、项目简介

本校园外卖服务系统分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及公告的租赁信息,能够与用户进行相互交流等操作,用户可以查看外卖信息,可以查看公告以及查看管理员回复信息等操作。
该校园外卖服务系统采用的是WEB应用程序开发中最受欢迎的B/S三层结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了JSP技术。该校园外卖服务系统能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,校园外卖服务系统性能稳定,功能较全,投入运行使用性价比很高。

二、系统设计

2.1软件功能模块设计

管理员可以管理用户的基本信息,可以管理等功能。管理员功能结构图如下:
在这里插入图片描述

2.2数据库设计

(1)下图是用户实体和其具备的属性。
在这里插入图片描述
(2)下图是公告信息实体和其具备的属性。
在这里插入图片描述(3)下图是购物车实体和其具备的属性。
在这里插入图片描述
(4)下图是外卖评价实体和其具备的属性。
在这里插入图片描述
(5)下图是外卖订单实体和其具备的属性。
在这里插入图片描述
(6)下图是外卖实体和其具备的属性。
在这里插入图片描述
(7)下图是外卖收藏实体和其具备的属性。
在这里插入图片描述
(8)下图是收货地址实体和其具备的属性。
在这里插入图片描述

三、系统项目部分截图

3.1管理员功能模块的实现

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

在这里插入图片描述
公告类型管理
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。公告类型管理界面如图5.3所示。
在这里插入图片描述

四、部分核心代码

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("/waimaiCollection")
public class WaimaiCollectionController {
    private static final Logger logger = LoggerFactory.getLogger(WaimaiCollectionController.class);

    @Autowired
    private WaimaiCollectionService waimaiCollectionService;


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

    //级联表service
    @Autowired
    private WaimaiService waimaiService;
    @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 = waimaiCollectionService.queryPage(params);

        //字典表数据转换
        List<WaimaiCollectionView> list =(List<WaimaiCollectionView>)page.getList();
        for(WaimaiCollectionView 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);
        WaimaiCollectionEntity waimaiCollection = waimaiCollectionService.selectById(id);
        if(waimaiCollection !=null){
            //entity转view
            WaimaiCollectionView view = new WaimaiCollectionView();
            BeanUtils.copyProperties( waimaiCollection , view );//把实体数据重构到view中

                //级联表
                WaimaiEntity waimai = waimaiService.selectById(waimaiCollection.getWaimaiId());
                if(waimai != null){
                    BeanUtils.copyProperties( waimai , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setWaimaiId(waimai.getId());
                }
                //级联表
                YonghuEntity yonghu = yonghuService.selectById(waimaiCollection.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 WaimaiCollectionEntity waimaiCollection, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,waimaiCollection:{}",this.getClass().getName(),waimaiCollection.toString());

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

        Wrapper<WaimaiCollectionEntity> queryWrapper = new EntityWrapper<WaimaiCollectionEntity>()
            .eq("waimai_id", waimaiCollection.getWaimaiId())
            .eq("yonghu_id", waimaiCollection.getYonghuId())
            .eq("waimai_collection_types", waimaiCollection.getWaimaiCollectionTypes())
            ;

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

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

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

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        WaimaiCollectionEntity waimaiCollectionEntity = waimaiCollectionService.selectOne(queryWrapper);
        if(waimaiCollectionEntity==null){
            waimaiCollectionService.updateById(waimaiCollection);//根据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());
        waimaiCollectionService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<WaimaiCollectionEntity> waimaiCollectionList = 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){
                            //循环
                            WaimaiCollectionEntity waimaiCollectionEntity = new WaimaiCollectionEntity();
//                            waimaiCollectionEntity.setWaimaiId(Integer.valueOf(data.get(0)));   //外卖 要改的
//                            waimaiCollectionEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            waimaiCollectionEntity.setWaimaiCollectionTypes(Integer.valueOf(data.get(0)));   //类型 要改的
//                            waimaiCollectionEntity.setInsertTime(date);//时间
//                            waimaiCollectionEntity.setCreateTime(date);//时间
                            waimaiCollectionList.add(waimaiCollectionEntity);


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

                        //查询是否重复
                        waimaiCollectionService.insertBatch(waimaiCollectionList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            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 = waimaiCollectionService.queryPage(params);

        //字典表数据转换
        List<WaimaiCollectionView> list =(List<WaimaiCollectionView>)page.getList();
        for(WaimaiCollectionView 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);
        WaimaiCollectionEntity waimaiCollection = waimaiCollectionService.selectById(id);
            if(waimaiCollection !=null){


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

                //级联表
                    WaimaiEntity waimai = waimaiService.selectById(waimaiCollection.getWaimaiId());
                if(waimai != null){
                    BeanUtils.copyProperties( waimai , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setWaimaiId(waimai.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(waimaiCollection.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 WaimaiCollectionEntity waimaiCollection, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,waimaiCollection:{}",this.getClass().getName(),waimaiCollection.toString());
        Wrapper<WaimaiCollectionEntity> queryWrapper = new EntityWrapper<WaimaiCollectionEntity>()
            .eq("waimai_id", waimaiCollection.getWaimaiId())
            .eq("yonghu_id", waimaiCollection.getYonghuId())
            .eq("waimai_collection_types", waimaiCollection.getWaimaiCollectionTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        WaimaiCollectionEntity waimaiCollectionEntity = waimaiCollectionService.selectOne(queryWrapper);
        if(waimaiCollectionEntity==null){
            waimaiCollection.setInsertTime(new Date());
            waimaiCollection.setCreateTime(new Date());
        waimaiCollectionService.insert(waimaiCollection);
            return R.ok();
        }else {
            return R.error(511,"您已经收藏过了");
        }
    }


}

获取源码或论文

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

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

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

相关文章

企业营销战略新思考:营销5.0与开源AI智能名片S2B2C商城小程序引领私域流量经营新纪元

随着互联网的深入发展&#xff0c;企业营销战略已经不再是单一、静态的规划&#xff0c;而是一个持续进化、与市场紧密相连的动态过程。在这个过程中&#xff0c;营销5.0和开源AI智能名片S2B2C商城小程序的结合&#xff0c;为企业营销战略注入了新的活力&#xff0c;也为私域流…

EasyRecovery数据恢复软件2025永久免费电脑版下载

EasyRecovery数据恢复软件是一款业界知名的数据恢复工具&#xff0c;它凭借强大的恢复能力和广泛的数据兼容性&#xff0c;帮助用户从各种存储设备中恢复丢失或删除的数据。以下是关于EasyRecovery数据恢复软件的详细介绍。 EasyRecovery绿色破解下载网盘链接: https://pan.ba…

《QT实用小工具·四十七》可交互的创意动态按钮

1、概述 源码放在文章末尾 该项目实现了可交互的创意动态按钮&#xff0c;包含如下功能&#xff1a; 所有颜色自定义 鼠标悬浮渐变 两种点击效果&#xff1a;鼠标点击渐变 / 水波纹动画&#xff08;可多层波纹叠加&#xff09; 额外鼠标移入/移出/按下/弹起的实时/延迟共8种事…

2024最新版JavaScript逆向爬虫教程-------基础篇之常用的编码与加密介绍(python和js实现)

目录 一、编码与加密原理1.1 ASCII 编码1.2 详解 Base641.2.1 Base64 的编码过程和计算方法1.2.2 基于编码的反爬虫设计1.2.3 Python自带base64模块实现base64编码解码类封装 1.3 MD5消息摘要算法1.3.1 MD5 介绍1.3.2 Python实现md5以及其他常用消息摘要算法封装 1.4 对称加密与…

在kuboard中添加k8s集群

1.登录kuboard后&#xff0c;点击添加集群面板 系统会跳转到k8s集群添加页面&#xff0c;按照页面提示输入自身的集群信息即可&#xff0c;此处没有什么难点。 添加成功后&#xff0c;点击集群面板&#xff0c;然后点击集群概要信息&#xff0c;就可以查看集群节点信息。 集群节…

mac配置maven

在 macOS 上配置 Maven 也相对简单。以下是一种常用的方法&#xff1a; 1. 安装maven **下载 Maven&#xff1a;**首先&#xff0c;你需要从 Maven 官网&#xff08;https://maven.apache.org/download.cgi&#xff09;下载最新版本的 Maven。你可以选择二进制压缩包&#xf…

ctfshow web78 获取flag(用老版的火狐浏览器)

题&#xff1a; 第一种&#xff1a;利用input伪协议 ,获取到flag ?filephp://input POST data <?php system(tac ls) ?> 第二种&#xff1a;利用flter协议,获取到flag https://21d9e58a-c0fd-47ea-a9c4-d875100f2fdb.challenge.ctf.show/?filephp://filter/readcon…

Java网址url工具类

功能描述 无需引入三方依赖文本匹配网址&#xff08;支持多个&#xff09;网址解析&#xff08;包括协议、主机、路径、参数等&#xff09; package com.qiangesoft.image.utils;import org.springframework.util.Assert; import org.springframework.util.CollectionUtils;i…

使用 Wireshark 实现 ARP 嗅探监听网络

前言 Wireshark是一个开源的网络协议分析工具&#xff0c;用于捕获和分析网络数据包。它可以在多个操作系统上运行&#xff0c;并提供了强大的功能和用户友好的界面。 通过Wireshark&#xff0c;用户可以捕获网络流量&#xff0c;并对其进行深入的分析。它支持多种协议的解析…

Unity 合并子物体获得简化Mesh

合并子物体获得简化Mesh &#x1f959;环境&#x1f96a;Demo &#x1f959;环境 PackageManager安装Editor Coroutines 导入插件&#x1f448; &#x1f96a;Demo 生成参数微调&#xff1a;Assets/EasyColliderEditor/Scripts/VHACDSettings/VHACDSettings.asset

大数据开发工作中的数仓设计(Hadoop,hive ,mysql )

1.HUE工具介绍使用 HUE是CDH提供一个hive和hdfs的操作工具&#xff0c;在hue中编写了hiveSQl也可以操作hdfs的文件 http://主机名字:端口号 hdfs的web访问端口 http://主机名字:端口号 hdfs的程序访问端口 进入后确保hdfs hive yarn 开启 在点击hue开启 在这里面也可以进行h…

android studio拍照功能问题解决

1.点击拍照功能直接闪退 2.拍照后不能选择确认键&#xff0c;无法保存 上述是在android studio做项目中经常会使用到模拟器或真机的拍照功能时主要遇到的两个问题。 解决方法&#xff1a; 1.直接闪退问题&#xff1a; if(Build.VERSION.SDK_INT>Build.VERSION_CODES.N)…

【HTML植物大战僵尸源码】

HTML植物大战僵尸源码 效果图部分源码领取源码下期更新预报 效果图 部分源码 index.html <html> <head> <meta http-equiv"Content-Type" content"text/html; charsetUTF-8"> <meta name"KeyWords" content"lonelys…

Vue3 + TS 项目实战 - 后台管理系统 - 按钮权限

前期回顾 网站的打赏 —— 新一代的思路-CSDN博客https://blog.csdn.net/m0_57904695/article/details/136704914?spm1001.2014.3001.5501 目录 &#x1f6a9; XX银行_系统管理_按钮权限控制_前端_提测单 项目信息 提测版本信息 功能列表 测试范围 测试环境 ✅ 步…

05-MessageConverter和ControllerAdvice

准备对象 Data static class User {private String name;private int age;JsonCreator // 默认jackson会使用无参构造器反序列化 这里强制使用当前带参构造器public User(JsonProperty("name") String name, JsonProperty("age") int age) {this.name …

《21天学通C++》(第十一章)多态

为什么需要多态&#xff1f; 为了最大限度地减少代码&#xff0c;提高可读性 1.虚函数 虚函数是C中的一种特殊成员函数&#xff0c;它允许在派生类&#xff08;也称为子类&#xff09;中重写&#xff08;覆盖&#xff09;基类的实现&#xff0c;使用virtual进行声明 在C中&am…

包装类的基础知识

JAVA 是面向对象编程的 但是基本数据类型没有对象的 基本数据类型 byte------>>Byte short------>>Short int------>>Integer long------>>long char------>>Character double------>>Double boolean------>>Boolean 包装类…

ton-http-api安装部署

1、拉取github代码 mkdir /data git clone https://github.com/toncenter/ton-http-api.git cd ton-http-api2、创建环境变量 ./configure.py cat .env TON_API_CACHE_ENABLED0 TON_API_CACHE_REDIS_ENDPOINTcache_redis TON_API_CACHE_REDIS_PORT6379 TON_API_CACHE_REDIS_T…

【酱浦菌-爬虫项目】爬取百度文库文档

1. 首先&#xff0c;定义了一个变量url&#xff0c;指向百度文库的搜索接口 ‘https://wenku.baidu.com/gsearch/rec/pcviewdocrec’。 2. 然后&#xff0c;设置了请求参数data&#xff0c;包括文档ID&#xff08;docId&#xff09;和查询关键词&#xff08;query&#xff09;。…

Unity镂空图像做法

问题和解决方案 现在要完成一个需求&#xff0c;即镂空中间部分的image&#xff0c;外围image可以定义颜色并可选屏蔽点击&#xff0c;而中间的image需要透明且可以穿透&#xff0c;必须不能屏蔽点击。 由此拆分成了两个问题&#xff1a; 1.定义外围image颜色&#xff0c;内…