Java毕业设计-基于springboot开发的技术美食烹饪互动平台设计与实现-毕业论文(附毕设源代码)


Java毕业设计-基于springboot开发的技术美食烹饪互动平台设计与实现-毕业论文(附毕设源代码)

如需其他项目或毕设源码,可进主页看下往期的毕设资源分享哦,希望对您有帮助!

逃逸的卡路里

前言

随着信息技术的飞速发展,Java语言作为一种成熟、稳定且功能强大的编程语言,已经广泛应用于企业级应用、移动开发、大数据处理等多个领域。作为本科大学生,我们在学习Java编程语言的过程中,不仅掌握了其语法规则和编程技巧,更重要的是学会了如何利用Java解决实际问题,实现软件系统的设计与开发。

本次毕业设计旨在通过实际项目的开发,将我们在大学期间所学的Java编程语言知识与实践相结合,进一步加深对Java语言的理解和应用。毕业设计的宗旨在于培养我们的独立思考能力、团队协作精神和创新能力,提升我们解决实际问题的能力,为未来的职业发展打下坚实的基础。

在毕业设计中,我们将综合运用Java编程语言、数据库技术、前端开发技术等,设计并实现一个具有实际应用价值的软件系统。通过需求分析、系统设计、编码实现、测试维护等阶段的实践,我们将全面提升自己的软件开发能力,为未来的学习和工作积累宝贵的经验。


美食烹饪互动平台可以实现美食知识类型管理,美食管理,美食留言管理,美食收藏管理,美食知识管理,用户管理等功能。该系统采用了Mysql数据库,Java语言,Spring Boot框架等技术进行编程实现。

美食烹饪互动平台可以提高美食信息管理问题的解决效率,优化美食信息处理流程,保证美食信息数据的安全,它是一个非常可靠,非常安全的应用程序。

关键词:美食烹饪互动平台;Mysql数据库;Java语言

一、毕设成果演示(源代码在文末)

在这里插入图片描述
在这里插入图片描述

二、毕设摘要展示

1、开发说明

开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7(一定要5.7版本)
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

推荐使用:谷歌浏览器

前台登录页面
http://localhost:8080/meishipengrenhudong/front/index.html

后台登录页面
http://localhost:8080/meishipengrenhudong/admin/dist/index.html

管理员 账户:admin 密码:admin
用户 账户:a1 密码:123456
用户 账户:a2 密码:123456
用户 账户:a3 密码:123456

在src\main\resources\application.yml中编辑

url: jdbc:mysql://127.0.0.1:3306/meishipengrenhudong?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
username: root	    数据库用户名 root
password: 123456	用户密码    123456

图片存放路径: src\main\webapp\upload 里面上传图片名里面不能有中文

2、需求/流程分析

在这里插入图片描述

在这里插入图片描述


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

    @Autowired
    private MeishiLiuyanService meishiLiuyanService;


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

    //级联表service
    @Autowired
    private MeishiService meishiService;
    @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 = meishiLiuyanService.queryPage(params);

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

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

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

        meishiLiuyan.setInsertTime(new Date());
        meishiLiuyan.setCreateTime(new Date());
        meishiLiuyanService.insert(meishiLiuyan);
        return R.ok();
    }

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

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            meishiLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        //根据字段查询是否有相同数据
        Wrapper<MeishiLiuyanEntity> queryWrapper = new EntityWrapper<MeishiLiuyanEntity>()
            .eq("id",0)
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        MeishiLiuyanEntity meishiLiuyanEntity = meishiLiuyanService.selectOne(queryWrapper);
        meishiLiuyan.setUpdateTime(new Date());
        if(meishiLiuyanEntity==null){
            meishiLiuyanService.updateById(meishiLiuyan);//根据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());
        meishiLiuyanService.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<MeishiLiuyanEntity> meishiLiuyanList = 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){
                            //循环
                            MeishiLiuyanEntity meishiLiuyanEntity = new MeishiLiuyanEntity();
//                            meishiLiuyanEntity.setMeishiId(Integer.valueOf(data.get(0)));   //美食 要改的
//                            meishiLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            meishiLiuyanEntity.setMeishiLiuyanText(data.get(0));                    //留言内容 要改的
//                            meishiLiuyanEntity.setInsertTime(date);//时间
//                            meishiLiuyanEntity.setReplyText(data.get(0));                    //回复内容 要改的
//                            meishiLiuyanEntity.setUpdateTime(sdf.parse(data.get(0)));          //回复时间 要改的
//                            meishiLiuyanEntity.setCreateTime(date);//时间
                            meishiLiuyanList.add(meishiLiuyanEntity);


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

                        //查询是否重复
                        meishiLiuyanService.insertBatch(meishiLiuyanList);
                        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 = meishiLiuyanService.queryPage(params);

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


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

                //级联表
                    MeishiEntity meishi = meishiService.selectById(meishiLiuyan.getMeishiId());
                if(meishi != null){
                    BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setMeishiId(meishi.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(meishiLiuyan.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 MeishiLiuyanEntity meishiLiuyan, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,meishiLiuyan:{}",this.getClass().getName(),meishiLiuyan.toString());
        meishiLiuyan.setInsertTime(new Date());
        meishiLiuyan.setCreateTime(new Date());
        meishiLiuyanService.insert(meishiLiuyan);
        return R.ok();
        }


}

3、系统功能结构

在这里插入图片描述

在这里插入图片描述

三、系统实现展示

1、管理员功能实现

1.1 美食管理

美食管理界面,美食信息包括美食名称,美食照片,美食相关食材,美食做法,美食名称等信息,对于本界面展示的美食信息,管理员可以下架,上架,修改,删除,查询等。

图5.1 美食管理界面

1.2 用户管理

用户管理界面,管理员在用户管理界面中可以为本界面显示的所有用户信息进行查询,修改,删除。

图5.2 用户管理界面

1.3 美食留言管理

美食留言管理界面,用户查看美食之后,会发布跟美食相关的留言信息,管理员在美食留言管理界面对这些留言进行查看以及回复。

图5.3 美食留言管理界面

1.4 美食知识管理

美食知识管理界面,用户在前台查看的美食知识信息都是管理员在美食知识管理界面发布的信息,美食知识管理界面展示的美食知识信息可以让管理员修改,查询,删除等。

图5.4 美食知识管理界面

2、用户功能实现

2.1 美食信息

美食信息界面,用户在美食信息界面查看美食详细介绍以及相关食材信息,可以观看美食做法视频,可以收藏美食,也能在美食信息界面的下方留言区域发布留言。

图5.5 美食信息界面

2.2 美食知识

美食知识界面,用户可以通过美食知识类型来筛选美食知识信息,可以在查询框中编辑美食知识名称来实现对美食知识信息的查询。

图5.6 美食知识界面

2.3 公告信息

公告信息界面,用户可以通过公告类型来筛选公告信息,可以在查询框中编辑公告名称来实现对公告信息的查询。

图5.7 公告信息界面

四、毕设内容和源代码获取

JJava毕业设计-基于springboot开发的技术美食烹饪互动平台设计与实现-毕业论文(附毕设源代码):https://download.csdn.net/download/u014740628/88921803

如需其他项目或毕设源码,可进主页看下往期的毕设资源分享哦,希望对您有帮助!

逃逸的卡路里


总结

通过本次毕业设计,我们不仅巩固了所学的Java编程语言知识,还学会了如何将理论知识应用于实际项目中。我们设计的软件系统具有一定的实际应用价值,这让我们对自己的能力充满了信心,也为未来的职业发展打下了坚实的基础。

参考文献

[1]鲜易洲,杨蕊,吴蓉,巩培桢,吴丽丽. 时食美食分享系统的设计与分析[J]. 电脑知识与技术,2021,17(09):85-87.
[2]卢红霞,方晓亮. 社会化顾客价值在美食分享网站的应用研究[J]. 物流工程与管理,2015,37(11):230-233.
[3]余涛.计算机软件开发中Java编程语言的应用研究[J].信息记录材料,2020,21(01):113-115.
[4]王子虎,胡丽珍.基于计算机软件安全开发的JAVA编程语言研究[J].数字技术与应用,2019,37(12):133-134.
[5]刘星淇.Java编程语言的特点与应用分析[J].通讯世界,2019,26(09):149-150.
[6]张云健.计算机软件Java编程特点及其技术应用[J].信息与电脑(理论版),2019(13):97-98.
[7]张振超,吴杰,陈序蓬.浅谈Java中Mysql数据库的连接与操作[J].信息记录材料,2020,21(02):144-145.
[8]范开勇,陈宇收.MySQL数据库性能优化研究[J].中国新通信,2019,21(01):57.
[9]丁佳.基于JSP+MySQL的用户登录系统SQL注入实例及防范[J].网络安全技术与应用,2020(09):49-51.
[10]王丹,孙晓宇,杨路斌,高胜严.基于SpringBoot的软件统计分析系统设计与实现[J].软件工程,2019,22(03):40-42.
[11]张峰.应用SpringBoot改变web应用开发模式[J].科技创新与应用,2017(23):193-194.
[12]谢志坚.计算机应用软件开发技术支撑思考[J].电子世界,2020(15):53-54.
[13]姬晓鹏.计算机软件开发技术与设计探究[J].电子测试,2020(16):133-134.
[14]Raffi Khatchadourian.Automated refactoring of legacy Java software to enumerated types[J].Automated Software Engineering,2017,24(4).
[15]Ben White.Marx and Chayanov at the margins:understanding agrarian change in Java[J].The Journal of Peasant Studies,2018,45(5-6).

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

逃逸的卡路里

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

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

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

打赏作者

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

抵扣说明:

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

余额充值