当前位置: 首页> 汽车> 维修 > 农林行业网站开发公司_微信公众号小程序怎么开通_厦门百度关键词优化_互联网营销具体做什么

农林行业网站开发公司_微信公众号小程序怎么开通_厦门百度关键词优化_互联网营销具体做什么

时间:2025/7/9 16:21:45来源:https://blog.csdn.net/qq_28245905/article/details/142935825 浏览次数: 0次
农林行业网站开发公司_微信公众号小程序怎么开通_厦门百度关键词优化_互联网营销具体做什么

摘要

本文旨在探讨一种基于Java Spring Boot和Vue框架的校园食堂网站管理系统的设计。首先,介绍了系统开发的背景及意义,即为了提高校园食堂的管理效率和改善学生的就餐体验。接着,详细阐述了系统的技术选型,包括后端采用Spring Boot框架以简化企业级应用开发,前端选用Vue框架以实现响应式界面和良好的用户体验。然后,描述了系统的主要功能模块,如用户管理、菜单浏览、在线点餐、支付结算等,并强调了其在数据处理和安全性方面的设计考虑。最后,总结了该系统的优势,如易于维护、扩展性强和用户友好等,同时也指出了未来改进的方向,如增加个性化推荐和优化用户交互设计。本研究对于推动校园食堂信息化建设具有一定的参考价值。

功能介绍

管理员、商家和学生三种用户角色;

管理员:个人中心、管理员管理、商家管理、用户管理、用户管理、食堂管理、美食管理、基础数据管理、论坛管理、新闻公告管理、轮播图管理等;

商家:个人中心、食堂管理、美食管理、论坛管理、新闻公告管理等;

学生:首页浏览、论坛交流、美食下单、公告查看、个人中心(地址管理、收藏管理评价管理、订单管理)等。

技术介绍

后端:Java语言的Spring Boot框架、MySQL数据库、Maven依赖管理等;

前端:Vue、element-ui、axios等。

部分代码展示

/*** 后端列表*/@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"));else if("商家".equals(role))params.put("shangjiaId",request.getSession().getAttribute("userId"));CommonUtil.checkMap(params);PageUtils page = cartService.queryPage(params);//字典表数据转换List<CartView> list =(List<CartView>)page.getList();for(CartView 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);CartEntity cart = cartService.selectById(id);if(cart !=null){//entity转viewCartView view = new CartView();BeanUtils.copyProperties( cart , view );//把实体数据重构到view中//级联表 美食//级联表MeishiEntity meishi = meishiService.selectById(cart.getMeishiId());if(meishi != null){BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setMeishiId(meishi.getId());}//级联表 用户//级联表YonghuEntity yonghu = yonghuService.selectById(cart.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到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 CartEntity cart, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,cart:{}",this.getClass().getName(),cart.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))cart.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<CartEntity> queryWrapper = new EntityWrapper<CartEntity>().eq("yonghu_id", cart.getYonghuId()).eq("meishi_id", cart.getMeishiId()).eq("buy_number", cart.getBuyNumber());logger.info("sql语句:"+queryWrapper.getSqlSegment());CartEntity cartEntity = cartService.selectOne(queryWrapper);if(cartEntity==null){cart.setCreateTime(new Date());cart.setInsertTime(new Date());cartService.insert(cart);return R.ok();}else {return R.error(511,"商品已添加到购物车");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody CartEntity cart, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,cart:{}",this.getClass().getName(),cart.toString());CartEntity oldCartEntity = cartService.selectById(cart.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));cart.setUpdateTime(new Date());cartService.updateById(cart);//根据id更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<CartEntity> oldCartList =cartService.selectBatchIds(Arrays.asList(ids));//要删除的数据cartService.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<CartEntity> cartList = 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){//循环CartEntity cartEntity = new CartEntity();cartList.add(cartEntity);//把要查询是否重复的字段放入map中}//查询是否重复cartService.insertBatch(cartList);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));CommonUtil.checkMap(params);PageUtils page = cartService.queryPage(params);//字典表数据转换List<CartView> list =(List<CartView>)page.getList();for(CartView 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);CartEntity cart = cartService.selectById(id);if(cart !=null){//entity转viewCartView view = new CartView();BeanUtils.copyProperties( cart , view );//把实体数据重构到view中//级联表MeishiEntity meishi = meishiService.selectById(cart.getMeishiId());if(meishi != null){BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setMeishiId(meishi.getId());}//级联表YonghuEntity yonghu = yonghuService.selectById(cart.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 CartEntity cart, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,cart:{}",this.getClass().getName(),cart.toString());Wrapper<CartEntity> queryWrapper = new EntityWrapper<CartEntity>().eq("yonghu_id", cart.getYonghuId()).eq("meishi_id", cart.getMeishiId()).eq("buy_number", cart.getBuyNumber())
//            .notIn("cart_types", new Integer[]{102});logger.info("sql语句:"+queryWrapper.getSqlSegment());CartEntity cartEntity = cartService.selectOne(queryWrapper);if(cartEntity==null){cart.setCreateTime(new Date());cart.setInsertTime(new Date());cartService.insert(cart);return R.ok();}else {return R.error(511,"表中有相同数据");}}}

演示视频

Java SpringBoot和Vue校园食堂网站管理系统

关键字:农林行业网站开发公司_微信公众号小程序怎么开通_厦门百度关键词优化_互联网营销具体做什么

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: