基于springboot+vue的“餐饮管理系统”实现与设计(源码+数据库+文档)
开发语言:Java
数据库:MySQL
技术:SpringBoot、vue
工具:IDEA/Ecilpse、Navicat、Maven









互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。针对信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,采用餐饮管理系统可以有效管理,使信息管理能够更加科学和规范。
餐饮管理系统在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,其管理员增删改查菜品信息和菜品信息资料,审核菜品信息预订订单,查看订单评价和评分,通过留言功能回复用户提问。
总之,餐饮管理系统集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。
![]()
互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。所以各行业,尤其是规模较大的企业和学校等都开始借助互联网和软件工具管理信息,传播信息,共享信息等等,以此可以增强自身实力,提高在同行业当中的竞争能力,并从各种激烈的竞争中获取发展的机会。针对菜品信息信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,经过分析和考虑,在目前的情况下,可以引进一款餐饮管理系统这样的现代化管理工具,这个工具就是解决上述问题的最好的解决方案。它不仅可以实时完成信息处理,还缩短菜品信息信息管理流程,使其系统化和规范化。同时还可以减少工作量,节约菜品信息信息管理需要的人力和资金。所以餐饮管理系统是信息管理环节中不可缺少的工具,它对管理者来说非常重要。
![]()
现如今,信息种类变得越来越多,信息的容量也变得越来越大,这就是信息时代的标志。近些年,计算机科学发展得也越来越快,而且软件开发技术也越来越成熟,因此,在生活中的各个领域,只要存在信息管理,几乎都有计算机的影子,可以说很多行业都采用计算机的方式管理信息。信息计算机化处理相比手工操作,有着保密性强,效率高,存储空间大,成本低等诸多优点。针对菜品信息信息管理,采用餐饮管理系统可以有效管理,使信息管理能够更加科学和规范。
总之,在实际中使用餐饮管理系统,其意义如下:第一点:餐饮管理系统的实际运用,可以帮助管理人员在短时间内完成信息处理工作;第二点:通过系统页面的合理排版布局,可以更加直观的展示系统的内容,并且使用者可以随时阅读页面信息,随时操作系统提供的功能;第三点:可以实现信息管理计算机化;第四点:可以降低信息管理成本;


-
- 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("/dictionary")
- public class DictionaryController {
- private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
-
- @Autowired
- private DictionaryService dictionaryService;
-
-
- @Autowired
- private TokenService tokenService;
-
- //级联表service
-
- @Autowired
- private YonghuService yonghuService;
- @Autowired
- private YuangongService yuangongService;
-
-
- /**
- * 后端列表
- */
- @RequestMapping("/page")
- @IgnoreAuth
- public R page(@RequestParam Map
params, HttpServletRequest request) { - logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
- if(params.get("orderBy")==null || params.get("orderBy")==""){
- params.put("orderBy","id");
- }
- PageUtils page = dictionaryService.queryPage(params);
-
- //字典表数据转换
- List
list =(List)page.getList(); - for(DictionaryView 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);
- DictionaryEntity dictionary = dictionaryService.selectById(id);
- if(dictionary !=null){
- //entity转view
- DictionaryView view = new DictionaryView();
- BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中
-
- //修改对应字典表字段
- dictionaryService.dictionaryConvert(view, request);
- return R.ok().put("data", view);
- }else {
- return R.error(511,"查不到数据");
- }
-
- }
-
- /**
- * 后端保存
- */
- @RequestMapping("/save")
- public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
- logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
-
- String role = String.valueOf(request.getSession().getAttribute("role"));
- if(false)
- return R.error(511,"永远不会进入");
-
- Wrapper
queryWrapper = new EntityWrapper() - .eq("dic_code", dictionary.getDicCode())
- .eq("index_name", dictionary.getIndexName())
- ;
- if(dictionary.getDicCode().contains("_erji_types")){
- queryWrapper.eq("super_id",dictionary.getSuperId());
- }
-
- logger.info("sql语句:"+queryWrapper.getSqlSegment());
- DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
- if(dictionaryEntity==null){
- dictionary.setCreateTime(new Date());
- dictionaryService.insert(dictionary);
- //字典表新增数据,把数据再重新查出,放入监听器中
- List
dictionaryEntities = dictionaryService.selectList(new EntityWrapper()); - ServletContext servletContext = request.getServletContext();
- Map
> map = new HashMap<>(); - for(DictionaryEntity d :dictionaryEntities){
- Map
m = map.get(d.getDicCode()); - if(m ==null || m.isEmpty()){
- m = new HashMap<>();
- }
- m.put(d.getCodeIndex(),d.getIndexName());
- map.put(d.getDicCode(),m);
- }
- servletContext.setAttribute("dictionaryMap",map);
- return R.ok();
- }else {
- return R.error(511,"表中有相同数据");
- }
- }
-
- /**
- * 后端修改
- */
- @RequestMapping("/update")
- public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){
- logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
-
- String role = String.valueOf(request.getSession().getAttribute("role"));
- // if(false)
- // return R.error(511,"永远不会进入");
- //根据字段查询是否有相同数据
- Wrapper
queryWrapper = new EntityWrapper() - .notIn("id",dictionary.getId())
- .eq("dic_code", dictionary.getDicCode())
- .eq("index_name", dictionary.getIndexName())
- ;
-
- if(dictionary.getDicCode().contains("_erji_types")){
- queryWrapper.eq("super_id",dictionary.getSuperId());
- }
- logger.info("sql语句:"+queryWrapper.getSqlSegment());
- DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
- if(dictionaryEntity==null){
- dictionaryService.updateById(dictionary);//根据id更新
- //如果字典表修改数据的话,把数据再重新查出,放入监听器中
- List
dictionaryEntities = dictionaryService.selectList(new EntityWrapper()); - ServletContext servletContext = request.getServletContext();
- Map
> map = new HashMap<>(); - for(DictionaryEntity d :dictionaryEntities){
- Map
m = map.get(d.getDicCode()); - if(m ==null || m.isEmpty()){
- m = new HashMap<>();
- }
- m.put(d.getCodeIndex(),d.getIndexName());
- map.put(d.getDicCode(),m);
- }
- servletContext.setAttribute("dictionaryMap",map);
- 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());
- dictionaryService.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
- }
-
- /**
- * 最大值
- */
- @RequestMapping("/maxCodeIndex")
- public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){
- logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());
- List
descs = new ArrayList<>(); - descs.add("code_index");
- Wrapper
queryWrapper = new EntityWrapper() - .eq("dic_code", dictionary.getDicCode())
- .orderDesc(descs);
- logger.info("sql语句:"+queryWrapper.getSqlSegment());
- List
dictionaryEntityList = dictionaryService.selectList(queryWrapper); - if(dictionaryEntityList.size()>0 ){
- return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);
- }else{
- return R.ok().put("maxCodeIndex",1);
- }
- }
-
- /**
- * 批量上传
- */
- @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
dictionaryList = new ArrayList<>();//上传的东西 - Map
> 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
> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
- dataList.remove(0);//删除第一行,因为第一行是提示
- for(List
data:dataList){ - //循环
- DictionaryEntity dictionaryEntity = new DictionaryEntity();
- // dictionaryEntity.setDicCode(data.get(0)); //字段 要改的
- // dictionaryEntity.setDicName(data.get(0)); //字段名 要改的
- // dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0))); //编码 要改的
- // dictionaryEntity.setIndexName(data.get(0)); //编码名字 要改的
- // dictionaryEntity.setSuperId(Integer.valueOf(data.get(0))); //父字段id 要改的
- // dictionaryEntity.setBeizhu(data.get(0)); //备注 要改的
- // dictionaryEntity.setCreateTime(date);//时间
- dictionaryList.add(dictionaryEntity);
-
-
- //把要查询是否重复的字段放入map中
- }
-
- //查询是否重复
- dictionaryService.insertBatch(dictionaryList);
- return R.ok();
- }
- }
- }
- }catch (Exception e){
- e.printStackTrace();
- return R.error(511,"批量插入数据异常,请联系管理员");
- }
- }
-
-
-
-
-
-
- }
采用Java结合MySQL数据库开发的餐饮管理系统,旨在满足管理人员对信息管理的需求。系统界面设计追求美观与简洁,操作流程简洁直观,减少用户误操作的可能性。尽管作为毕业设计项目,开发时间有限,系统仍存在一些需要改进的地方。通过参与本系统的设计和开发,我不仅提升了编程技能,还培养了独立分析问题和解决问题的能力。同时,我也认识到了自己在技术知识方面的不足,这将激励我在未来的学习和工作中,不断加强技术知识的学习和实践,以期达到更高的专业水平,不断完善和优化系统。
总结来说,这个餐饮管理系统的开发过程,不仅是一个技术实践的过程,更是一个自我提升和成长的过程。它让我更加清晰地认识到了自己的优势和不足,为我未来的职业发展指明了方向。我将继续努力,不断学习,以期成为一名优秀的软件工程师。
联系我:OliverAAAAA
点击上方卡片关注私信我,回复252-A获取源码、文档及部署服务!