微信扫码点餐小程序springboot外卖点餐系统源码和论文

 开发工具:

     后端:idea   用户端:微信开发者工具

    数据库 :mysql5.7+

    技术:java  springboot  mybatis  微信原生技术

   角色:   管理员  多商家    用户

在中国餐饮业的开展现状看,中国餐饮业当今的特点之一就是在线点餐效劳开展迅速,随着互联网普及率的进步,以及互联网应用的深化,网上点餐这个课题已经提出,在线点餐效劳已经陆续在北京、上海以及经济兴旺的一级城市开展,并得到餐饮消费者的欢送。为了方便人们生活,进步人们的生活效率,本系统根据现实点餐方式虚拟于网络之上,使人们通过网络就可以完成生活中必要的事情〔饮食〕。系统的完成不仅可以根本实现客户点餐的功能,还能在此根底上提供更多的、更贴心的效劳。信息技术的开展将更快的推动互联网的开展,点餐系统的重要性也将越显其强大的作用。

平台演示视频:

微信扫码点餐小程序springboot外卖点餐系统

国内在线订餐网站的兴起并非来源于国外,食色性也,“吃”是人们的最根本要求,也是每个人都避不开的话题。现在随着物价的飞涨和生活节奏的加快,都市白领想要在高楼林立中安稳的吃上一顿实惠便捷的午餐变得越来越难,越来越多的上班族中午会点外卖,由此产生了巨大的外卖需求.有关数据显示,在长沙市城区90%以上的餐馆都提供送餐服务,营业额一般要占总营业额的10%左右。在商贸集中区域,外卖营业额占总营业额的30%。随着人们生活节奏的加快和生活习惯的改变,外卖营业额还将继续攀升,外卖市场的潜力是巨大的。而随着互联网的高速发展,越来越多的传统企业开始试水电子商务。日前,连锁巨头麦当劳在继肯德基、必胜客之后开通网上订餐业务,与此同时,以爱送餐网为代表的一大批网上订餐平台也如雨后春笋般应运而生.据爱送餐网提供的数据显示,今年,全国新开通的第三方外卖订餐网站已超过50家,仅北京地区就已存在10家左右。和LivingSocial即时服务频道相似,国内外卖订餐网站不仅提供了餐馆的详细菜单等信息,还拥有丰富的商家资源,给用户提供了更多的选择。爱送餐(www.aisongcan.com)是国内领先的外卖订餐网站之一,总部在湖南长沙,致力于为中国广大消费者提供最优质的、最便捷的网上外卖订餐服务,打造中国网上外卖订餐第一品牌,为用户提供精准的小半径点餐服务,解决城市白领、大学生群体、宅男宅女们的吃饭问题。爱送餐提供海量外卖菜单随你挑选,您只需轻点鼠标,就能享受送上门来的美味佳肴香哈网(http://www.xiangha。com)是一个免费的外卖订餐平台,涵盖了中餐、西餐、糕点等各种类型的餐馆,为用户提供周边餐馆的详细信息。海量菜单随心挑选,仅需一个电话,美食到身边,足不出户,也能享尽美味佳肴!目前,香哈网上的餐馆信息已覆盖了北京市大多数的区域。美餐网(http://meican。com)主打“附近的外卖详细菜单”,目前已经收集了北京的上千家餐厅的几十万道外卖美食。用户登陆美餐网之后,会进入一个“餐厅地图”的页面,然后把自己喜欢的餐厅放到网站的首页,定制一个属于自己的外卖订餐页面,最后通过美餐网直接在线订餐。综上所述,加之我们所关注的是针对各高校学生的订餐系统,我们服务的对象是高校学生,我们认为网上点餐系统的前景还是非常光明的,伴随着移动通信终端的迅速发展网上点餐系统将会更加丰富人们的生活,满足人们的需要。

package com.student.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.student.common.controller.BaseController;
import com.student.common.model.PageParams;
import com.student.common.model.view.AjaxJson;
import com.student.common.model.view.TablePage;
import com.student.common.utils.StringUtil;
import com.student.config.shiro.ShiroUtil;
import com.student.entity.Category;
import com.student.entity.Goods;
import com.student.entity.Order;
import com.student.entity.OrderDetail;
import com.student.entity.SysUser;
import com.student.service.CategoryService;
import com.student.service.GoodsService;
import com.student.service.OrderDetailService;
import com.student.service.OrderService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;




@Controller
@RequestMapping(value = "${path.admin}/base/order")
public class OrderController extends BaseController {

    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderDetailService orderDetailService;
    @Autowired
    private CategoryService categoryService;
    @Autowired
    private GoodsService goodsService;

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(Model model) {
        return "/base/order/list";
    }

    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    public String detail(String id, Model model) {
        Order bean = this.orderService.getById(id);
        List<OrderDetail> details = this.orderDetailService.find(id);
        model.addAttribute("bean", bean);
        model.addAttribute("details", details);
        return "/base/order/detail";
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson delete(String[] ids) {
        this.orderService.removeByIds(Arrays.asList(ids));
        return sucDelete();
    }

    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
    public TablePage list(Order params, PageParams pageParams) {

        QueryWrapper<Order> wrapper = new QueryWrapper<>();

        wrapper.eq("user_id", Objects.requireNonNull(ShiroUtil.getCurrentUser()).getId());
        wrapper.like(StringUtil.isNotEmpty2(params.getOrderNo()), "order_no", params.getOrderNo());
        wrapper.eq(StringUtil.isNotEmpty2(params.getStatus()), "status", params.getStatus());
        wrapper.orderByDesc("create_time");
        IPage<Order> page = this.orderService.page(pageParams.parsePage(Order.class), wrapper);
        return new TablePage(page);
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson update(String id, String status) {
        Order order = this.orderService.getById(id);
        order.setStatus(status);
        this.orderService.updateById(order);

        return AjaxJson.createSuccess();
    }

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public String add(Model model) {
        String userId = ShiroUtil.getCurrentUser().getId();
        List<Category> categories = this.categoryService.find(userId);
        List<Goods> goods = this.goodsService.find(userId);
        model.addAttribute("categories", categories);
        model.addAttribute("goods", goods);
        return "/base/order/form";
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson add(Par p) {

        SysUser user = ShiroUtil.getCurrentUser();
        assert user != null;

        Order order = new Order();
        order.setStatus("已支付");
        order.setUserNickName("前台");
        order.setType("到店");
        order.setOrderNo(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));

        order.setUserId(user.getId());
        order.setUserName(user.getRealName());
        System.out.println("------------------"+order.getCreateTime());
        order.setCreateTime(LocalDateTime.now());
        System.out.println("----------------------"+order.getCreateTime());

        List<OrderDetail> details = new ArrayList<>();
        for (OrderDetail pa : p.getDetails()) {
            if (pa.getCount() != null && pa.getCount() > 0) {
                Goods goods = this.goodsService.getById(pa.getId());
                OrderDetail d = new OrderDetail();
                d.setCategoryId(goods.getCategoryId());
                d.setCategoryName(goods.getCategoryName());
                d.setCount(pa.getCount());
                d.setGoodsNo(goods.getGoodsNo());
                d.setImage(goods.getImage());
                d.setPrice(goods.getPrice());
                details.add(d);
            }
        }

        if (details.size() == 0) {
            return AjaxJson.createError("没有商品信息");
        }

        order.setAddress("").setPhone("").setName("");
        order.setCount(details.stream().mapToInt(OrderDetail::getCount).sum());
        order.setPrice(details.stream().mapToDouble(v -> v.getCount() * v.getPrice()).sum());

        this.orderService.submit(order, details);

        return sucSave();
    }

    @Data
    public static class Par {

        private List<OrderDetail> details;
    }
}

管理员多商家配置,每个商家都有独立的后台,可以上传自己的商品类目,和商品信息。 

 

 

package com.student.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.student.common.controller.BaseController;
import com.student.common.controller.UploadFile;
import com.student.common.model.PageParams;
import com.student.common.model.view.AjaxJson;
import com.student.common.model.view.TablePage;
import com.student.config.shiro.ShiroUtil;
import com.student.entity.Category;
import com.student.entity.Goods;
import com.student.service.CategoryService;
import com.student.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;




@Controller
@RequestMapping(value = "${path.admin}/base/goods")
public class GoodsController extends BaseController {

    @Autowired
    private CategoryService categoryService;
    @Autowired
    private GoodsService goodsService;

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(Model model) {
        model.addAttribute("categories", this.categoryService.find());
        return "/base/goods/list";
    }

    @RequestMapping(value = "/list", method = RequestMethod.POST)
        @ResponseBody
        public TablePage list(String categroyId, PageParams pageParams) {
            IPage<Goods> page = this.goodsService.find(categroyId, pageParams);
            return new TablePage(page);
    }

    @RequestMapping(value = "/isOn", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson isOn(String[] ids, boolean isOn) {
        this.goodsService.isOn(ids, isOn);
        return sucDelete();
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson delete(String[] ids) {
        this.goodsService.delete(ids);
        return sucDelete();
    }

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public String add(Model model) {
        model.addAttribute("categories", this.categoryService.find());
        return "/base/goods/form";
    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson add(Goods params, HttpServletRequest request, MultipartFile file) throws Exception {
        params.setUserId(Objects.requireNonNull(ShiroUtil.getCurrentUser()).getId());
        Category category = this.categoryService.getById(params.getCategoryId());
        params.setCategoryName(category.getName());
        params.setDelFlag(false);
        params.setIsOn(true);
        params.setCreateTime(LocalDateTime.now());

        UploadFile uploadFile = super.uploadFile(request, file, "photo");
        if (uploadFile.getHasFile()) {
            params.setImage(uploadFile.getPath());
        } else {
            return AjaxJson.createError("请上传商品图片");
        }

        this.goodsService.save(params);
        return sucSave();
    }

    @RequestMapping(value = "/update", method = RequestMethod.GET)
    public String update(String id, Model model) {
        Goods bean = this.goodsService.getById(id);
        model.addAttribute("bean", bean);
        return add(model);
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson update(Goods params, HttpServletRequest request, MultipartFile file) throws Exception {

        Category category = this.categoryService.getById(params.getCategoryId());
        params.setCategoryName(category.getName());

        UploadFile uploadFile = super.uploadFile(request, file, "photo");
        if (uploadFile.getHasFile()) {
            params.setImage(uploadFile.getPath());
        }

        this.goodsService.updateById(params);
        return sucUpdate();
    }

    @RequestMapping(value = "/validate", method = RequestMethod.POST)
    @ResponseBody
    public AjaxJson validate(String property, String value) {
        QueryWrapper<Goods> wrapper = new QueryWrapper<>();
        wrapper.eq("goods_no", value);
        wrapper.eq("user_id", Objects.requireNonNull(ShiroUtil.getCurrentUser()).getId());
        boolean flag = this.goodsService.count(wrapper) > 0;
        if (flag) {
            return invalid(property, "");
        }
        return new AjaxJson();
    }
}

 

  • 4
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
校园食堂订餐系统,是将计算机、通信等现代化技术运用到传统校园食堂服务的新型校园食堂服务方式。 校园食堂订餐系统为了解决以下几个问题:一是疫情期间,学生面临着开学,食堂是学生最聚集的场所之一,食堂订餐系统可以良好的解决学生饮食期间的拥挤等问题;二是让学生健康饮食,减轻目前的大学生吃外卖和不健康食品的问题;三是方便和改善学生的伙食,让学生可以随时随地的选购菜品;四是提高食堂商家的利润,改善商家的销售额。 本文在考虑到以上的问题的基础上,利用大学期间中所学到的的专业知识,独立开发一个基于Spring Boot和vue.js的校园食堂订餐系统。论文首先进行了系统功能的总体设计,使本系统具有以下主要功能:一是具有手机端让学生可以随时随地挑选食堂商家的菜品;二是可以让学生可以提交订、一定时间范围修改和撤销订;三是具有线上学生一卡通支付功能;四是对菜品销售情况具有统计功能方便商家查看与统计。 本文系统后台使用Spring Boot新型轻量开发框架,采用基本的B/S的互联网架构,前台技术使用可跨Android、IOS、H5、小程序的uni-app进行开发,使用IDEA的IntelliJ IDEA 2019.3.1 x64和WebStorm 2020.1 x64开发工具实现后台与前台的编码。使用MySQL数据库存储技术进行开发。最后完成了系统测试工作和调试工作,满足了校园食堂订餐系统的要求。 最后,对课题工作进行了总结,并对未来研究工作给予了展望。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

程序猿毕业分享网

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

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

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

打赏作者

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

抵扣说明:

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

余额充值