当前位置: 首页 > news >正文

基于springboot,vue校园点餐系统

开发工具:IDEA

服务器:Tomcat9.0, jdk1.8

项目构建:maven

数据库:mysql5.7

系统分前后台,非前后端分离

前端技术:vue.js+elementUI等框架实现

服务端技术:springboot+mybatis-plus

项目功能描述:

用户前台:登录、注册、个人中心、消息留言管理、我的收藏管理、订单管理、菜品信息、菜品资讯

管理员后台:登录、个人中心、用户管理、食堂管理、食堂菜单管理、菜系分类管理、消息留言管理、留言板管理、系统管理、订单管理等功能

目    录

1 概述

1.1课题背景及意义

1.2 国内外研究现状

1.3 本课题主要工作

2 系统开发环境

2.1 java简介

2.2 Mysql数据库

2.3 B/S结构

2.4 JSP技术介绍

3 系统分析

3.1 可行性分析

3.1.1 技术可行性

3.1.2操作可行性

3.1.3 经济可行性

3.1.4 法律可行性

3.2系统流程分析

3.2.1系统开发流程

3.2.2 用户登录流程

3.2.3 系统操作流程

3.2.4 添加信息流程

3.2.5 修改信息流程

3.2.6 删除信息流程

3.3系统用例分析

3.3.1管理员用例图

3.3.2用户用例图

4 系统设计

4.1 系统概述

4.2 系统结构设计

4.3数据库设计

4.3.1 数据库设计原则

4.3.2 数据库实体

4.3.3 数据库表设计

5统详细设计

5.1前台首页功能模块

5.2管理员功能模块

5.3食堂功能模块

5.4用户功能模块

6系统测试

6.1系统测试的意义

6.2 测试方法

6.3测试分析

    

    

参考文献

前台截图:

 

 

 

 

 

后台截图:

 

 

 

 

 

 

 

 

 

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.CaipinfenleiEntity;
import com.entity.view.CaipinfenleiView;

import com.service.CaipinfenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 菜品分类
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-20 21:35:40
 */
@RestController
@RequestMapping("/caipinfenlei")
public class CaipinfenleiController {
    @Autowired
    private CaipinfenleiService caipinfenleiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei,
		HttpServletRequest request){
        EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
		PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
        EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
		PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( CaipinfenleiEntity caipinfenlei){
       	EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei")); 
        return R.ok().put("data", caipinfenleiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(CaipinfenleiEntity caipinfenlei){
        EntityWrapper< CaipinfenleiEntity> ew = new EntityWrapper< CaipinfenleiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei")); 
		CaipinfenleiView caipinfenleiView =  caipinfenleiService.selectView(ew);
		return R.ok("查询菜品分类成功").put("data", caipinfenleiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
        return R.ok().put("data", caipinfenlei);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
        return R.ok().put("data", caipinfenlei);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
    	caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.insert(caipinfenlei);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
    	caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.insert(caipinfenlei);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
        //ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.updateById(caipinfenlei);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        caipinfenleiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<CaipinfenleiEntity> wrapper = new EntityWrapper<CaipinfenleiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = caipinfenleiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.CaipinpingjiaEntity;
import com.entity.view.CaipinpingjiaView;

import com.service.CaipinpingjiaService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 菜品评价
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-20 21:35:40
 */
@RestController
@RequestMapping("/caipinpingjia")
public class CaipinpingjiaController {
    @Autowired
    private CaipinpingjiaService caipinpingjiaService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,CaipinpingjiaEntity caipinpingjia,
      HttpServletRequest request){
      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("yonghu")) {
         caipinpingjia.setYonghuming((String)request.getSession().getAttribute("username"));
      }
        EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
      PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
        EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
      PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params));
        return R.ok().put("data", page);
    }

   /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( CaipinpingjiaEntity caipinpingjia){
           EntityWrapper<CaipinpingjiaEntity> ew = new EntityWrapper<CaipinpingjiaEntity>();
       ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia")); 
        return R.ok().put("data", caipinpingjiaService.selectListView(ew));
    }

    /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(CaipinpingjiaEntity caipinpingjia){
        EntityWrapper< CaipinpingjiaEntity> ew = new EntityWrapper< CaipinpingjiaEntity>();
      ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia")); 
      CaipinpingjiaView caipinpingjiaView =  caipinpingjiaService.selectView(ew);
      return R.ok("查询菜品评价成功").put("data", caipinpingjiaView);
    }
   
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id);
        return R.ok().put("data", caipinpingjia);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id);
        return R.ok().put("data", caipinpingjia);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
       caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(caipinpingjia);
        caipinpingjiaService.insert(caipinpingjia);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
       caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(caipinpingjia);
        caipinpingjiaService.insert(caipinpingjia);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){
        //ValidatorUtils.validateEntity(caipinpingjia);
        caipinpingjiaService.updateById(caipinpingjia);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        caipinpingjiaService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
   @RequestMapping("/remind/{columnName}/{type}")
   public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
                   @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
      map.put("column", columnName);
      map.put("type", type);
      
      if(type.equals("2")) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         Date remindStartDate = null;
         Date remindEndDate = null;
         if(map.get("remindstart")!=null) {
            Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
            c.setTime(new Date()); 
            c.add(Calendar.DAY_OF_MONTH,remindStart);
            remindStartDate = c.getTime();
            map.put("remindstart", sdf.format(remindStartDate));
         }
         if(map.get("remindend")!=null) {
            Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
            c.setTime(new Date());
            c.add(Calendar.DAY_OF_MONTH,remindEnd);
            remindEndDate = c.getTime();
            map.put("remindend", sdf.format(remindEndDate));
         }
      }
      
      Wrapper<CaipinpingjiaEntity> wrapper = new EntityWrapper<CaipinpingjiaEntity>();
      if(map.get("remindstart")!=null) {
         wrapper.ge(columnName, map.get("remindstart"));
      }
      if(map.get("remindend")!=null) {
         wrapper.le(columnName, map.get("remindend"));
      }

      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("yonghu")) {
         wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
      }

      int count = caipinpingjiaService.selectCount(wrapper);
      return R.ok().put("count", count);
   }
   


}

相关文章:

  • qmake 文件扩展名操作
  • 【javaweb简单教程】9.Servlet与过滤器超简单教程
  • 猛淦,阿里大老纯手撸Spring高级源码手册,啃起来真TM香啊
  • ES6导入与导出(module)
  • 【opencv-c++】cv::imshow和cv::waitKey函数显示图像
  • 第二课 我的第一个程序 hello world
  • 消息队列实现分布式事务
  • 前端性能优化指标 + 检测工具
  • CubeMx笔记 --pwm输出+输入捕获
  • 轻松玩转树莓派Pico之一、新手上路
  • 目前我国网络安全人才市场状况
  • Redis源码解读之用RedisAe实现一个简单的HTTP服务器
  • 【极简python】第一章 print与变量
  • HAL库与Cubemx\rt-thread Nano系列教程-01-新建HAL工程及移植RT-Nano到Alios Developer Kit
  • 论文阅读_知识蒸馏_MobileBERT
  • 自己简单写的 事件订阅机制
  • [译]Python中的类属性与实例属性的区别
  • “大数据应用场景”之隔壁老王(连载四)
  • 2017-09-12 前端日报
  • Docker下部署自己的LNMP工作环境
  • Electron入门介绍
  • Java超时控制的实现
  • Mithril.js 入门介绍
  • overflow: hidden IE7无效
  • PaddlePaddle-GitHub的正确打开姿势
  • vagrant 添加本地 box 安装 laravel homestead
  • vue--为什么data属性必须是一个函数
  • Webpack 4x 之路 ( 四 )
  • 阿里研究院入选中国企业智库系统影响力榜
  • 从输入URL到页面加载发生了什么
  • 等保2.0 | 几维安全发布等保检测、等保加固专版 加速企业等保合规
  • 订阅Forge Viewer所有的事件
  • 分享自己折腾多时的一套 vue 组件 --we-vue
  • 深入体验bash on windows,在windows上搭建原生的linux开发环境,酷!
  • 小程序button引导用户授权
  • 云大使推广中的常见热门问题
  • 宾利慕尚创始人典藏版国内首秀,2025年前实现全系车型电动化 | 2019上海车展 ...
  • 完善智慧办公建设,小熊U租获京东数千万元A+轮融资 ...
  • #经典论文 异质山坡的物理模型 2 有效导水率
  • $.each()与$(selector).each()
  • (26)4.7 字符函数和字符串函数
  • (ibm)Java 语言的 XPath API
  • (NSDate) 时间 (time )比较
  • (独孤九剑)--文件系统
  • (附源码)spring boot网络空间安全实验教学示范中心网站 毕业设计 111454
  • (附源码)springboot炼糖厂地磅全自动控制系统 毕业设计 341357
  • (免费领源码)python#django#mysql公交线路查询系统85021- 计算机毕业设计项目选题推荐
  • (一)80c52学习之旅-起始篇
  • (转)shell调试方法
  • *ST京蓝入股力合节能 着力绿色智慧城市服务
  • . Flume面试题
  • .bat批处理(十一):替换字符串中包含百分号%的子串
  • .java 9 找不到符号_java找不到符号
  • .NET Standard 支持的 .NET Framework 和 .NET Core
  • .net 提取注释生成API文档 帮助文档