前言介绍
随着网络不断的普及发展,外卖点餐系统依靠网络技术的支持得到了快速的发展,首先要从用户的实际需求出发,通过了解用户的需求开发出具有针对性的用户、餐厅、菜品、订单评价、订单等功能,利用目前网络给用户带来的方便快捷这一特点对系统进行调整,设计的系统让用户的使用起来更加方便,本系统的主要目的就是给用户带来快捷与高效、安全,用户只要在家中就可以进行操作。同时随着电子商务的发展外卖点餐系统已经受到广大用户的关注。
互联网发展至今,已经解决了很多我们解决不了的难题,使得我们工作更加便捷,提高了我们的工作效率。目前各行各业都在运用网络信息管理程序,不同的用户也都接触到信息管理,特别是在各大电商行业广泛的应运起来。通过对当前网络环境发展的分析与总结,开发外卖点餐系统可以改变以往的外卖购买方式,改变传统线下外卖点餐系统的状态,由于用户的不断增多,使用传统的线下手工模式已经远远不能满足于用户需求了,而且越来越多的商家也在开通线上进行外卖点餐系统,所以开发一个外卖点餐系统可以解决商家不利于线下外卖购买的问题,同时商家可以利用网络对外卖购买信息进行管理,设计的网站保证信息的完整安全,这样才能提高工作效率,保证系统安全正常的运行
系统功能分析
本外卖点餐系统主要包括二大功能模块,即用户功能模块和管理员功能模块。
(1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员功能来管理后台系统。主要功能有:首页、个人中心、用户管理、餐厅信息管理、菜品分类管理、菜品信息管理、订单评价管理、系统管理、订单管理等功能。管理员用例图如图
(2)用户:首页、个人中心、订单评价管理、我的收藏管理、订单管理等功能,用户如图
(3)前台首页:首页、餐厅信息、菜品信息、公告信息、个人中心、后台管理、购物车、客服等功能,前台首页如图
系统结构设计
整个系统是由多个功能模块组合而成的,要将所有的功能模块都一一列举出来,然后进行逐个的功能设计,使得每一个模块都有相对应的功能设计,然后进行系统整体的设计。
本外卖点餐系统结构图如图
数据库设计
本外卖点餐系统采用的是MYSQL数据库,数据存储快,因为外卖点餐系统 ,主要的就是对信息的管理,信息内容比较多,这就需要好好的设计一个好的数据库,分类要清楚,不能添加信息的时候,造成信息太过混乱,设计好的数据库首先就需要先把各个实体之间的关系表达明确,系统的E-R图如下图所示:
1、用户信息:用户名、密码、姓名、性别、头像、手机实体图如图
2、餐厅信息:餐厅名称、餐厅类型、配送时间、配送服务、联系电话、餐厅地址实体图如图
3、菜品信息:菜品名称、菜品分类、图片、材料、分量、餐厅名称、联系电话、价格、菜品介绍实体图如图
系统详细设计
前台首页功能模块
外卖点餐系统 ,在前台首页可以查看首页、餐厅信息、菜品信息、公告信息、个人中心、后台管理、购物车、客服等内容,如图
登录
用户注册
在用户注册页面可以填写用户名、密码、姓名、手机等信息进行注册,如图
个人信息
用户进入个人信息可以对用户名、密码、姓名、性别、头像、手机、余额等可以进行余额冲值查看进行添加、删除、详情等操作。程序效果图如下图
菜品信息
在菜品信息页面通过查看菜品名称、菜品分类、图片、材料、分量、餐厅名称、联系电话、价格、菜品介绍等信息进行立即预定、评分,如图
公告信息
在公告信息页面通过查看公告内容等等查看,如图
管理员功能模块
管理员登录,通过填写注册时输入的用户名、密码、角色进行登录,如图
管理员登录进入外卖点餐系统可以查看首页、个人中心、用户管理、餐厅信息管理、菜品分类管理、菜品信息管理、订单评价管理、系统管理、订单管理等信息。如图
个人中心
管理员对个人中心进行操作填写原密码、新密码、确认密码并进行添加、删除、修改以及查看,如图
用户管理
管理员进入系统可以对用户进行编辑用户名、密码、姓名、性别、头像、手机进行添加、修改、删除等操作。程序效果图如下图
餐厅信息管理
在餐厅信息管理页面中可以填写餐厅名称、餐厅类型、配送时间、配送服务、联系电话、餐厅地址等信息,并可根据需要对已有餐厅信息管理进行修改或删除等操作,如图
菜品信息管理
在菜品信息管理页面中可以查看菜品名称、菜品分类、图片、材料、分量、餐厅名称、联系电话、价格、菜品介绍等内容,并且根据需要对已有菜品信息管理进行添加,修改或删除等详细操作,如图
系统管理
管理员通过系统管理页面查看轮播图/公告信息、客服管理等进行上传图片、发布公告、回复等进行添加、删除、修改以及查看并对整个系统进行维护等操作。,如图
订单管理
在订单管理页面中可以查看订单编号、商品名称、商品图片、购买数量、价格/积分、折扣价格、总价格/总积分、折扣总价格、支付类型、状态、地址等内容,并且根据需要对已有订单管理进行添加,修改或删除等详细操作,如图
用户功能模块
用户登录,通过填写用户名、密码、角色进行登录,如图
订单评价管理
在订单评价管理页面中通过填写订单编号、商品名称、菜品分类、评分、评价日期、用户名、手机、评价内容等内容进行查看添加、删除,如图
订单管理
在订单管理页面中可以查看订单编号、商品名称、商品图片、购买数量、价格/积分、折扣价格、总价格/总积分、折扣总价格、支付类型、状态、地址等内容,并且根据需要对已有订单管理进行详情、删除等详细操作,如图
收藏管理
在收藏管理页面可以查看收藏ID 表名 收藏名称、收藏图片等等内容,并进行详情,删除或查看等操作,如图
部分核心代码
菜品信息
/**
* 菜品信息
* 后端接口
* @author
* @email
* @date 2021-01-25 10:23:22
*/
@RestController
@RequestMapping("/caipinxinxi")
public class CaipinxinxiController {
@Autowired
private CaipinxinxiService caipinxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
PageUtils page = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
PageUtils page = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( CaipinxinxiEntity caipinxinxi){
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( caipinxinxi, "caipinxinxi"));
return R.ok().put("data", caipinxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(CaipinxinxiEntity caipinxinxi){
EntityWrapper< CaipinxinxiEntity> ew = new EntityWrapper< CaipinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( caipinxinxi, "caipinxinxi"));
CaipinxinxiView caipinxinxiView = caipinxinxiService.selectView(ew);
return R.ok("查询菜品信息成功").put("data", caipinxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CaipinxinxiEntity caipinxinxi = caipinxinxiService.selectById(id);
caipinxinxi.setClicknum(caipinxinxi.getClicknum()+1);
caipinxinxi.setClicktime(new Date());
caipinxinxiService.updateById(caipinxinxi);
return R.ok().put("data", caipinxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
CaipinxinxiEntity caipinxinxi = caipinxinxiService.selectById(id);
caipinxinxi.setClicknum(caipinxinxi.getClicknum()+1);
caipinxinxi.setClicktime(new Date());
caipinxinxiService.updateById(caipinxinxi);
return R.ok().put("data", caipinxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
caipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caipinxinxi);
caipinxinxiService.insert(caipinxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
caipinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caipinxinxi);
caipinxinxiService.insert(caipinxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody CaipinxinxiEntity caipinxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(caipinxinxi);
caipinxinxiService.updateById(caipinxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
caipinxinxiService.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<CaipinxinxiEntity> wrapper = new EntityWrapper<CaipinxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = caipinxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,CaipinxinxiEntity caipinxinxi, HttpServletRequest request,String pre){
EntityWrapper<CaipinxinxiEntity> ew = new EntityWrapper<CaipinxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = caipinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinxinxi), params), params));
return R.ok().put("data", page);
}
}
登录
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* 根据name获取信息
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
return R.ok().put("data", config);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.insert(config);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
configService.updateById(config);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
configService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
gitCode源码获取入口https://gitcode.com/yuanmadd/ymgg/blob/main/README.md?init=initTree