开发工具:
后端: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;
}
}
管理员多商家配置,每个商家都有独立的后台,可以上传自己的商品类目,和商品信息。
文章来源地址https://www.toymoban.com/news/detail-571522.html
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();
}
}
文章来源:https://www.toymoban.com/news/detail-571522.html
到了这里,关于微信扫码点餐小程序springboot外卖点餐系统源码和论文的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!