基于java+ssm+jsp的高校食堂订餐系统

该文介绍了基于SSM框架的高校食堂订餐系统,采用Java编程语言和MySQL数据库,实现了包括学生管理、公告管理、菜品管理在内的后台功能,以及用户登录注册、菜品信息展示的前端功能,提高了数据处理效率并确保了安全性。
摘要由CSDN通过智能技术生成

项目介绍

现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本高校食堂订餐系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此高校食堂订餐系统利用当下成熟完善的SSM框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发。实现了菜品基础数据的管理,菜品收藏,菜品评价,基础数据,公告信息的发布等功能。高校食堂订餐系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。

在这里插入图片描述

开发环境

编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序ue/爬虫/c#/asp.net

系统实现

5.1 管理员功能介绍
5.1.1 学生管理
如图5.1显示的就是学生管理页面,此页面提供给管理员的功能有:新增需而生,修改学生,删除学生。
在这里插入图片描述

图5.1 学生管理页面

5.1.2 公告管理
如图5.2显示的就是公告管理页面,此页面提供给管理员的功能有:新增公告,删除公告,修改公告。
在这里插入图片描述

图5.2 公告管理页面

5.1.3 轮播图管理
如图5.3显示的就是轮播图管理页面,此页面提供给管理员的功能有:新增轮播图,修改轮播图,删除轮播图。
在这里插入图片描述

图5.3 轮播图管理页面

5.1.4 菜品管理
如图5.4显示的就是菜品管理页面,此页面提供给管理员的功能有:新增菜品,修改菜品,删除菜品。
在这里插入图片描述

图5.4 菜品管理页面

5.2前台首页功能模块
高校食堂订餐系统,在高校食堂订餐系统可以查看介绍,菜品,公告等,如图5-17所示。
在这里插入图片描述

图5-17系统首页界面图

登录、注册,通过注册填写用户账号、用户姓名、密码、联系电话、电子邮箱等信息进行注册操作,如图5-18所示。
在这里插入图片描述

在这里插入图片描述

图5-18登录、注册界面图

菜品信息,在菜品信息页面可以查看菜品的类型,菜品的名称,菜品单价,菜品详情等,如图5-19所示。
在这里插入图片描述

图5-19商品信息界面图

个人中心,在个人中心页面可以查看用户账号、用户姓名、密码、性别、联系电话等如图5-20所示。
在这里插入图片描述

图5-20个人中心界面图

核心代码

package com.controller;


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.StringUtil;
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.CaipinEntity;

import com.service.CaipinService;
import com.entity.view.CaipinView;

import com.utils.PageUtils;
import com.utils.R;

/**
 * 菜品
 * 后端接口
 * @author
 * @email
 * @date 
*/
@RestController
@Controller
@RequestMapping("/caipin")
public class CaipinController {
    private static final Logger logger = LoggerFactory.getLogger(CaipinController.class);

    @Autowired
    private CaipinService caipinService;


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



    //级联表service


    /**
    * 后端列表
    */
    @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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        params.put("orderBy","id");
        PageUtils page = caipinService.queryPage(params);

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

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

            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("ve")
    public R save(@RequestBody CaipinEntity caipin, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,caipin:{}",this.getClass().getName(),caipin.toString());
        Wrapper<CaipinEntity> queryWrapper = new EntityWrapper<CaipinEntity>()
            .eq("caipin_name", caipin.getCaipinName())
            .eq("caipin_new_money", caipin.getCaipinNewMoney())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CaipinEntity caipinEntity = caipinService.selectOne(queryWrapper);
        if(caipinEntity==null){
            caipin.setCreateTime(new Date());
        //  String role = String.valueOf(request.getSession().getAttribute("role"));
        //  if("".equals(role)){
        //      caipin.set
        //  }
            caipinService.insert(caipin);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody CaipinEntity caipin, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,caipin:{}",this.getClass().getName(),caipin.toString());
        //根据字段查询是否有相同数据
        Wrapper<CaipinEntity> queryWrapper = new EntityWrapper<CaipinEntity>()
            .notIn("id",caipin.getId())
            .andNew()
            .eq("caipin_name", caipin.getCaipinName())
            .eq("caipin_new_money", caipin.getCaipinNewMoney())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        CaipinEntity caipinEntity = caipinService.selectOne(queryWrapper);
        if("".equals(caipin.getCaipinPhoto()) || "null".equals(caipin.getCaipinPhoto())){
                caipin.setCaipinPhoto(null);
        }
        if(caipinEntity==null){
            //  String role = String.valueOf(request.getSession().getAttribute("role"));
            //  if("".equals(role)){
            //      caipin.set
            //  }
            caipinService.updateById(caipin);//根据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());
        caipinService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }



    /**
    * 前端列表
    */
    @RequestMapping("st")
    public R list(@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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        // 没有指定排序字段就默认id倒序
        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
            params.put("orderBy","id");
        }
        PageUtils page = caipinService.queryPage(params);

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

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        CaipinEntity caipin = caipinService.selectById(id);
            if(caipin !=null){
                //entity转view
        CaipinView view = new CaipinView();
                BeanUtils.copyProperties( caipin , view );//把实体数据重构到view中

                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody CaipinEntity caipin, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,caipin:{}",this.getClass().getName(),caipin.toString());
        Wrapper<CaipinEntity> queryWrapper = new EntityWrapper<CaipinEntity>()
            .eq("caipin_name", caipin.getCaipinName())
            .eq("caipin_new_money", caipin.getCaipinNewMoney())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
    CaipinEntity caipinEntity = caipinService.selectOne(queryWrapper);
        if(caipinEntity==null){
            caipin.setCreateTime(new Date());
        //  String role = String.valueOf(request.getSession().getAttribute("role"));
        //  if("".equals(role)){
        //      caipin.set
        //  }
        caipinService.insert(caipin);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


}

论文参考

在这里插入图片描述

目 录
目 录 III
1 绪论 1
1.1 研究背景 1
1.2 目的和意义 1
1.3 论文结构安排 2
2 相关技术 3
2.1 SSM框架介绍 3
2.2 B/S结构介绍 3
2.3 Mysql数据库介绍 4
3 系统分析 6
3.1 系统可行性分析 6
3.1.1 技术可行性分析 6
3.1.2 经济可行性分析 6
3.1.3 运行可行性分析 6
3.2 系统性能分析 7
3.2.1 易用性指标 7
3.2.2 可扩展性指标 7
3.2.3 健壮性指标 7
3.2.4 安全性指标 8
3.3 系统流程分析 8
3.3.1 操作流程分析 8
3.3.2 登录流程分析 9
3.3.3 信息添加流程分析 10
3.3.4 信息删除流程分析 11
4 系统设计 12
4.1 系统概要设计 12
4.2 系统功能结构设计 12
4.3 数据库设计 13
4.3.1 数据库E-R图设计 13
4.3.2 数据库表结构设计 14
5 系统实现 17
5.1 管理员功能介绍 17
5.1.1 学生管理 17
5.1.2 公告管理 17
5.1.3 轮播图管理 18
5.1.4 菜品管理 18
5.2前台首页功能模块 19
6 系统测试 22
6.1 系统测试的特点  22
6.2 系统功能测试 23
6.2.1 登录功能测试 23
6.2.2 添加类别功能测试 23
6.3 测试结果分析 23
结 论 25
致 谢 26
参考文献 27

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

qq_3306428634

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

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

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

打赏作者

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

抵扣说明:

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

余额充值