分享一套【优质Java源码】SpringBoot+Vue外卖(点餐)平台系统

0 阅读3分钟

大家好,我是java1234_小锋老师,分享一套SpringBoot+Vue外卖(点餐)平台系统  。

1.jpg

项目简介

伴随着我国社会的发展,人民生活质量日益提高。于是对外卖平台系统进行规范而严格是十分有必要的,所以许许多多的信息管理系统应运而生。此时单靠人力应对这些事务就显得有些力不从心了。所以本论文将设计一套外卖平台系统,帮助商家进行菜品分类、菜品信息、订单等繁琐又重复的工作,提高工作效率的同时,也减轻了管理者的压力。

本论文的主要内容包括:

第一,研究分析当下主流的web技术,结合商家日常管理方式,进行外卖平台系统的数据库设计,设计外卖平台系统功能,并对每个模块进行说明。

第二,陈列说明该系统实现所采用的架构、系统搭建采用的服务器、系统开发环境和使用的工具,以及系统后台采用的数据库。

最后,对系统进行全面测试,主要包括功能测试、查询性能测试、安全性能测试。

分析系统存在的不足以及将来改进的方向。

源码下载

链接: pan.baidu.com/s/1mcVTLWbe…

提取码: 1234

相关截图

4.jpg

2.jpg

3.jpg

10.jpg

5.jpg

6.jpg

7.jpg

8.jpg

9.jpg

核心代码

package com.controller;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.CaipinfenleiEntity;
import com.entity.view.CaipinfenleiView;

import com.service.CaipinfenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;

/**
 * 菜品分类
 * 后端接口
 * @author 
 * @email 
 * @date 2023-04-05 10:38:14
 */
@RestController
@RequestMapping("/caipinfenlei")
public class CaipinfenleiController {
    @Autowired
    private CaipinfenleiService caipinfenleiService;


    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei,
		HttpServletRequest request){
        EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();

		PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,CaipinfenleiEntity caipinfenlei, 
		HttpServletRequest request){
        EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();

		PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( CaipinfenleiEntity caipinfenlei){
       	EntityWrapper<CaipinfenleiEntity> ew = new EntityWrapper<CaipinfenleiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei")); 
        return R.ok().put("data", caipinfenleiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(CaipinfenleiEntity caipinfenlei){
        EntityWrapper< CaipinfenleiEntity> ew = new EntityWrapper< CaipinfenleiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei")); 
		CaipinfenleiView caipinfenleiView =  caipinfenleiService.selectView(ew);
		return R.ok("查询菜品分类成功").put("data", caipinfenleiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
        return R.ok().put("data", caipinfenlei);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
        return R.ok().put("data", caipinfenlei);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
    	caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.insert(caipinfenlei);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
    	caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.insert(caipinfenlei);
        return R.ok();
    }



    /**
     * 修改
     */
    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
        //ValidatorUtils.validateEntity(caipinfenlei);
        caipinfenleiService.updateById(caipinfenlei);//全部更新
        return R.ok();
    }


    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        caipinfenleiService.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<CaipinfenleiEntity> wrapper = new EntityWrapper<CaipinfenleiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = caipinfenleiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	









}