基于springboot食堂点餐管理系统源码和论文

随着移动支付像微信和支付宝的普及,更多的人不愿意在口袋里放现金,导致本人捡钱的机会大大的降低,当前2021年随着美团和饿了么外卖平台的普及,更多的人不愿意花大量的时间在家自己煮饭吃,宁愿节约时间,甚至有的是不愿意洗碗,都在平台上点外卖,但是目前的两家外卖巨头,平台抽取商家的利润实在是收费太高,让大家很不情愿在上面入驻。

本食堂点餐系统开发根据实际的市场需求调查,以人们具体订餐需要使用点餐服务进行作为开发系统出发点,从系统的需求分析到最终功能规划,从框架的搭建到各个模块功能的实现,本文基于springboot mybatis框架完整的实现了一个食堂食堂点餐系统,可以为消费者提供购买菜品、下单等多个功能。从测试结果来看,系统完整实现了所需功能,而且具有一定的 稳定性和可靠性,并能够为消费者提供良好的消费者体验。总之,本系统界面简洁、易操作、功能较多、安全性高、实用性强,是一个具有良好功能扩展性以及简单维护性的信息管理系统。该系统功能齐全,界面布局比较吸引人,功能比较全,操作简单,符合当今社会的发展趋势。

关键词:食堂点餐  Idea  mysql  springboot

【630】基于springboot食堂点餐管理系统源码和论文

Abstract

With the popularity of mobile payments such as WeChat and Alipay, more people are unwilling to put cash in their pockets, which greatly reduces their chances of picking up money. In 2021, with the popularity of Meituan and Hunglemai takeout platforms, more people are unwilling to spend a lot of time cooking at home, preferring to save time, and even some are unwilling to wash dishes, and order takeout on the platform. However, the current two takeout giants, The platform charges too much to extract the profits of merchants, which makes people reluctant to settle on it.

According to the actual market demand survey, the development of this ordering system is based on the specific ordering needs of people to use ordering services as the starting point of the development system. From the demand analysis of the system to the final function planning, from the building of the framework to the realization of each module function, this paper has completely implemented an online ordering system based on the spring boot mybatis framework, which can provide consumers with multiple functions such as purchasing dishes and placing orders. From the test results, the system has fully realized the required functions, and has certain stability and reliability, and can provide consumers with a good consumer experience. In a word, this system has simple interface, easy operation, many functions, high security, and strong practicability. It is an information management system with good function expansion and simple maintenance. The system has complete functions, attractive interface layout, complete functions and simple operation, which is in line with the development trend of today's society.

Keyword: Online ordering system;Idea; mysql; springboot

 

package com.spring.controller;

import com.spring.dao.GouwucheMapper;
import com.spring.entity.Gouwuche;
import com.spring.service.GouwucheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import tk.mybatis.mapper.entity.Example;
import util.Request;
import util.Info;
import dao.Query;
import java.util.*;


import com.spring.entity.Caipinxinxi;
import com.spring.service.CaipinxinxiService;

/**
 * 购物车 */
@Controller
public class GouwucheController extends BaseController
{
    @Autowired
    private GouwucheMapper dao;
    @Autowired
    private GouwucheService service;

    @Autowired
    private CaipinxinxiService serviceRead;
    /**
     *  后台列表页
     *
     */
    @RequestMapping("/gouwuche_list")
    public String list()
    {
        // 检测是否有登录,没登录则跳转到登录页面
        if(!checkLogin()){
            return showError("尚未登录" , "./login.do");
        }

        String order = Request.get("order" , "id"); // 获取前台提交的URL参数 order  如果没有则设置为id
        String sort  = Request.get("sort" , "desc"); // 获取前台提交的URL参数 sort  如果没有则设置为desc

        Example example = new Example(Gouwuche.class); //  创建一个扩展搜索类
        Example.Criteria criteria = example.createCriteria();          // 创建一个扩展搜索条件类
        String where = " 1=1 ";   // 创建初始条件为:1=1
        where += getWhere();      // 从方法中获取url 上的参数,并写成 sql条件语句
        criteria.andCondition(where);   // 将条件写进上面的扩展条件类中
        if(sort.equals("desc")){        // 判断前台提交的sort 参数是否等于  desc倒序  是则使用倒序,否则使用正序
            example.orderBy(order).desc();  // 把sql 语句设置成倒序
        }else{
            example.orderBy(order).asc();   // 把 sql 设置成正序
        }
        int page = request.getParameter("page") == null ? 1 : Integer.valueOf(request.getParameter("page"));  // 获取前台提交的URL参数 page  如果没有则设置为1
        page = Math.max(1 , page);  // 取两个数的最大值,防止page 小于1
        List<Gouwuche> list = service.selectPageExample(example , page , 12);   // 获取当前页的行数
        // 生成统计语句
        HashMap total = Query.make("gouwuche").field("(sum(xiaoji)) sum_xiaoji").where(where).find();
        // 将统计语句写给界面调用
        request.setAttribute("total" , total);
        // 将列表写给界面使用
        request.setAttribute("list" , list);
        assign("orderby" , order);  // 把当前排序结果写进前台
        assign("sort" , sort);      // 把当前排序结果写进前台
        assign("where" , where);    // 把当前条件写给前台
        return "gouwuche_list";   // 使用视图文件:WebRoot\gouwuche_list.jsp
    }

    public String getWhere()
    {
        String where = " ";
        // 判断URL 参数caipinxinxiid是否大于0
        if( Request.getInt("caipinxinxiid") > 0 ) {
            // 大于0 则写入条件
            where += " AND caipinxinxiid='"+Request.getInt("caipinxinxiid")+"' ";
        }
        // 以下也是一样的操作,判断是否符合条件,符合则写入sql 语句
            if(!Request.get("caipinbianhao").equals("")) {
            where += " AND caipinbianhao LIKE '%"+Request.get("caipinbianhao")+"%' ";
        }
                if(!Request.get("caipinmingcheng").equals("")) {
            where += " AND caipinmingcheng LIKE '%"+Request.get("caipinmingcheng")+"%' ";
        }
                if(!Request.get("fenlei").equals("")) {
            where += " AND fenlei ='"+Request.get("fenlei")+"' ";
        }
                if(!Request.get("goumaishuliang_start").equals("")) {
            where += " AND goumaishuliang >='"+Request.get("goumaishuliang_start")+"' ";
        }
        if(!Request.get("goumaishuliang_end").equals("")) {
            where += " AND goumaishuliang <= '"+Request.get("goumaishuliang_end")+"' ";
        }
                if(!Request.get("xiaoji_start").equals("")) {
            where += " AND xiaoji >='"+Request.get("xiaoji_start")+"' ";
        }
        if(!Request.get("xiaoji_end").equals("")) {
            where += " AND xiaoji <= '"+Request.get("xiaoji_end")+"' ";
        }
            return where;
    }

    /**
     * 发布人列表
     */
    @RequestMapping("/gouwuche_list_faburen")
    public String listfaburen()
    {
        // 检测是否有登录,没登录则跳转到登录页面
        if(!checkLogin()){
            return showError("尚未登录" , "./login.do");
        }
        String order = Request.get("order" , "id"); // 获取前台提交的URL参数 order  如果没有则设置为id
        String sort  = Request.get("sort" , "desc"); // 获取前台提交的URL参数 sort  如果没有则设置为desc

        Example example = new Example(Gouwuche.class);  //  创建一个扩展搜索类
        Example.Criteria criteria = example.createCriteria();           // 创建一个扩展搜索条件类
        // 初始化一个条件,条件为:发布人=当前登录学生
        String where = " faburen='"+request.getSession().getAttribute("username")+"' ";
        where += getWhere();

        criteria.andCondition(where);   // 将条件写入
        if(sort.equals("desc")){        // 注释同list
            example.orderBy(order).desc(); // 注释同list
        }else{
            example.orderBy(order).asc(); // 注释同list
        }

        int page = request.getParameter("page") == null ? 1 : Integer.valueOf(request.getParameter("page")); // 注释同list
        page = Math.max(1 , page); // 注释同list

            List<Gouwuche> list = service.selectPageExample(example , page , 12);
                HashMap total = Query.make("gouwuche").field("(sum(xiaoji)) sum_xiaoji").where(where).find();
        request.setAttribute("total" , total);

        request.setAttribute("list" , list);
        assign("orderby" , order);
        assign("sort" , sort);
        assign("where" , where);
        return "gouwuche_list_faburen";
    }
    /**
     * 购买人列表
     */
    @RequestMapping("/gouwuche_list_goumairen")
    public String listgoumairen() {
        // 检测是否有登录,没登录则跳转到登录页面
        if (!checkLogin()) {
            return showError("尚未登录", "./login.do");
        }
        String order = Request.get("order", "id"); // 获取前台提交的URL参数 order  如果没有则设置为id
        String sort = Request.get("sort", "desc"); // 获取前台提交的URL参数 sort  如果没有则设置为desc

        String where = " goumairen ='" + request.getSession().getAttribute("username") + "' ";
        where += getWhere();

        List<Map> dianjia = Query.make("gouwuche").field("distinct faburen").where(where).select();

        List<Map> resultList = new ArrayList();

        System.out.println(dianjia);

        for (Map map : dianjia) {

            HashMap sjMap = Query.make("dianjia").where("zhanghao", map.get("faburen")).find();

            Example example = new Example(Gouwuche.class);
            Example.Criteria criteria = example.createCriteria();
            String wp = where.concat(" AND faburen='" + map.get("faburen") + "'");
            criteria.andCondition(wp);
            if (sort.equals("desc")) {
                example.orderBy(order).desc();
            } else {
                example.orderBy(order).asc();
            }
            List<Gouwuche> list = service.selectPageExample(example, 1, 100);
            sjMap.put("xiaoji", Query.make("gouwuche").where(wp).sum("xiaoji"));
            sjMap.put("list", list);

            resultList.add(sjMap);
        }

        request.setAttribute("list", resultList);
        assign("orderBy", order);
        assign("sort", sort);
        assign("where", where);
        return "gouwuche_list_goumairen";

    }



        @RequestMapping("/gouwuche_add")
    public String add()
    {
        int id = Request.getInt("id");  // 根据id 获取 菜品信息模块中的数据
        Caipinxinxi readMap = serviceRead.find(id);
        // 将数据行写入给前台jsp页面
        request.setAttribute("readMap" , readMap);
        return "gouwuche_add";
    }

    @RequestMapping("/gouwucheadd")
    public String addWeb()
    {
        if(!checkLogin()){
            return showError("尚未登录" , "./");
        }
        int id = Request.getInt("id"); // 根据id 获取 菜品信息模块中的数据
        Caipinxinxi readMap = serviceRead.find(id);
        request.setAttribute("readMap" , readMap);
        return "gouwucheadd";
    }


    @RequestMapping("/gouwuche_updt")
    public String updt()
    {
        int id = Request.getInt("id");
        // 获取行数据,并赋值给前台jsp页面
        Gouwuche mmm = service.find(id);
        request.setAttribute("mmm" , mmm);
        request.setAttribute("updtself" , 0);
        return "gouwuche_updt";
    }
    /**
     * 添加内容
     * @return
     */
    @RequestMapping("/gouwucheinsert")
    public String insert()
    {
        String tmp="";
        Gouwuche post = new Gouwuche();  // 创建实体类
        // 设置前台提交上来的数据到实体类中
        post.setCaipinbianhao(Request.get("caipinbianhao"));

        post.setCaipinmingcheng(Request.get("caipinmingcheng"));

        post.setFenlei(Request.get("fenlei"));

        post.setCaipintupian(Request.get("caipintupian"));

        post.setJiage(Request.getDouble("jiage"));

        post.setFaburen(Request.get("faburen"));

        post.setZhekoujia(Request.getInt("zhekoujia"));

        post.setGoumaishuliang(Request.getInt("goumaishuliang"));

        post.setXiaoji(Request.getDouble("xiaoji"));

        post.setBeizhu(Request.get("beizhu"));

        post.setGoumairen(Request.get("goumairen"));

        post.setCaipinxinxiid(Request.getInt("caipinxinxiid"));
        post.setIssh("否");


        post.setAddtime(Info.getDateStr()); // 设置添加时间
                service.insert(post); // 插入数据
        int charuid = post.getId().intValue();
        Query.execute("UPDATE gouwuche SET xiaoji=(zhekoujia*goumaishuliang) WHERE id='"+charuid+"'");



        return showSuccess("保存成功" , Request.get("referer").equals("") ? request.getHeader("referer") : Request.get("referer"));
    }

    /**
    * 更新内容
    * @return
    */
    @RequestMapping("/gouwucheupdate")
    public String update()
    {
        // 创建实体类
        Gouwuche post = new Gouwuche();
        // 将前台表单数据填充到实体类
        if(!Request.get("caipinbianhao").equals(""))
        post.setCaipinbianhao(Request.get("caipinbianhao"));
                if(!Request.get("caipinmingcheng").equals(""))
        post.setCaipinmingcheng(Request.get("caipinmingcheng"));
                if(!Request.get("fenlei").equals(""))
        post.setFenlei(Request.get("fenlei"));
                if(!Request.get("caipintupian").equals(""))
        post.setCaipintupian(Request.get("caipintupian"));
                if(!Request.get("jiage").equals(""))
        post.setJiage(Request.getDouble("jiage"));
            if(!Request.get("faburen").equals(""))
        post.setFaburen(Request.get("faburen"));
                if(!Request.get("zhekoujia").equals(""))
        post.setZhekoujia(Request.getInt("zhekoujia"));
            if(!Request.get("goumaishuliang").equals(""))
        post.setGoumaishuliang(Request.getInt("goumaishuliang"));
            if(!Request.get("xiaoji").equals(""))
        post.setXiaoji(Request.getDouble("xiaoji"));
            if(!Request.get("beizhu").equals(""))
        post.setBeizhu(Request.get("beizhu"));
                if(!Request.get("goumairen").equals(""))
        post.setGoumairen(Request.get("goumairen"));

        post.setId(Request.getInt("id"));
                service.update(post); // 更新数据
        int charuid = post.getId().intValue();
        Query.execute("UPDATE gouwuche SET xiaoji=(zhekoujia*goumaishuliang) WHERE id='"+request.getParameter("id")+"'");


                return showSuccess("保存成功" , Request.get("referer")); // 弹出保存成功,并跳转到前台提交的 referer 页面
    }
    /**
     *  后台详情
     */
    @RequestMapping("/gouwuche_detail")
    public String detail()
    {
        int id = Request.getInt("id");
        Gouwuche map = service.find(id);  // 根据前台url 参数中的id获取行数据
        request.setAttribute("map" , map);  // 把数据写到前台
        return "gouwuche_detail";  // 详情页面:WebRoot\gouwuche_detail.jsp
    }
        /**
    *  删除
    */
    @RequestMapping("/gouwuche_delete")
    public String delete()
    {
        if(!checkLogin()){
            return showError("尚未登录");
        }
        int id = Request.getInt("id");  // 根据id 删除某行数据
        HashMap delMap = Query.make("gouwuche").find(id);

                service.delete(id);// 根据id 删除某行数据
                return showSuccess("删除成功",request.getHeader("referer"));//弹出删除成功,并跳回上一页
    }
}
package com.spring.controller;

import com.spring.dao.CaipinfenleiMapper;
import com.spring.entity.Caipinfenlei;
import com.spring.service.CaipinfenleiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import tk.mybatis.mapper.entity.Example;
import util.Request;
import util.Info;
import dao.Query;
import java.util.*;



/**
 * 菜品分类 */
@Controller
public class CaipinfenleiController extends BaseController
{
    @Autowired
    private CaipinfenleiMapper dao;
    @Autowired
    private CaipinfenleiService service;

    /**
     *  后台列表页
     *
     */
    @RequestMapping("/caipinfenlei_list")
    public String list()
    {
        // 检测是否有登录,没登录则跳转到登录页面
        if(!checkLogin()){
            return showError("尚未登录" , "./login.do");
        }

        String order = Request.get("order" , "id"); // 获取前台提交的URL参数 order  如果没有则设置为id
        String sort  = Request.get("sort" , "desc"); // 获取前台提交的URL参数 sort  如果没有则设置为desc

        Example example = new Example(Caipinfenlei.class); //  创建一个扩展搜索类
        Example.Criteria criteria = example.createCriteria();          // 创建一个扩展搜索条件类
        String where = " 1=1 ";   // 创建初始条件为:1=1
        where += getWhere();      // 从方法中获取url 上的参数,并写成 sql条件语句
        criteria.andCondition(where);   // 将条件写进上面的扩展条件类中
        if(sort.equals("desc")){        // 判断前台提交的sort 参数是否等于  desc倒序  是则使用倒序,否则使用正序
            example.orderBy(order).desc();  // 把sql 语句设置成倒序
        }else{
            example.orderBy(order).asc();   // 把 sql 设置成正序
        }
        int page = request.getParameter("page") == null ? 1 : Integer.valueOf(request.getParameter("page"));  // 获取前台提交的URL参数 page  如果没有则设置为1
        page = Math.max(1 , page);  // 取两个数的最大值,防止page 小于1
        List<Caipinfenlei> list = service.selectPageExample(example , page , 12);   // 获取当前页的行数
        // 将列表写给界面使用
        request.setAttribute("list" , list);
        assign("orderby" , order);  // 把当前排序结果写进前台
        assign("sort" , sort);      // 把当前排序结果写进前台
        assign("where" , where);    // 把当前条件写给前台
        return "caipinfenlei_list";   // 使用视图文件:WebRoot\caipinfenlei_list.jsp
    }

    public String getWhere()
    {
        String where = " ";
        // 以下也是一样的操作,判断是否符合条件,符合则写入sql 语句
            if(!Request.get("fenleimingcheng").equals("")) {
            where += " AND fenleimingcheng LIKE '%"+Request.get("fenleimingcheng")+"%' ";
        }
            return where;
    }





        @RequestMapping("/caipinfenlei_add")
    public String add()
    {
        return "caipinfenlei_add";
    }



    @RequestMapping("/caipinfenlei_updt")
    public String updt()
    {
        int id = Request.getInt("id");
        // 获取行数据,并赋值给前台jsp页面
        Caipinfenlei mmm = service.find(id);
        request.setAttribute("mmm" , mmm);
        request.setAttribute("updtself" , 0);
        return "caipinfenlei_updt";
    }
    /**
     * 添加内容
     * @return
     */
    @RequestMapping("/caipinfenleiinsert")
    public String insert()
    {
        String tmp="";
        Caipinfenlei post = new Caipinfenlei();  // 创建实体类
        // 设置前台提交上来的数据到实体类中
        post.setFenleimingcheng(Request.get("fenleimingcheng"));


        
        post.setAddtime(Info.getDateStr()); // 设置添加时间
                service.insert(post); // 插入数据
        int charuid = post.getId().intValue();
        
        return showSuccess("保存成功" , Request.get("referer").equals("") ? request.getHeader("referer") : Request.get("referer"));
    }

    /**
    * 更新内容
    * @return
    */
    @RequestMapping("/caipinfenleiupdate")
    public String update()
    {
        // 创建实体类
        Caipinfenlei post = new Caipinfenlei();
        // 将前台表单数据填充到实体类
        if(!Request.get("fenleimingcheng").equals(""))
        post.setFenleimingcheng(Request.get("fenleimingcheng"));
        
        post.setId(Request.getInt("id"));
                service.update(post); // 更新数据
        int charuid = post.getId().intValue();
                        return showSuccess("保存成功" , Request.get("referer")); // 弹出保存成功,并跳转到前台提交的 referer 页面
    }
        /**
    *  删除
    */
    @RequestMapping("/caipinfenlei_delete")
    public String delete()
    {
        if(!checkLogin()){
            return showError("尚未登录");
        }
        int id = Request.getInt("id");  // 根据id 删除某行数据
        HashMap delMap = Query.make("caipinfenlei").find(id);

                service.delete(id);// 根据id 删除某行数据
                return showSuccess("删除成功",request.getHeader("referer"));//弹出删除成功,并跳回上一页
    }
}

售饭系统采用Delphi7+SQLServer2000,里面包括数据库的创建,数据库备份还原,以及.dll文件等,多个网友下载了本系统,说不能编译,是因为以前刚做好,收尾工作还没有完成,软件的连接上还有点问题,所以不能编译的。这次我去掉了第三方控件,添加了连接直接用Delphi7编译顺利成功,不需要任何其他控件。希望给您提供一些帮助。如果您修改了本程序,希望能给本人邮寄一份,以共交流,本人不胜感激。本次编译删除了一些无用的备份文件,但是包含全部可执行文件全部源代码.感谢您参考本人编写软件的源代码,欢迎交流!本压缩包含全部源代码/////////////////////////////////////////////////// 软件开发:苏军涛// 设计时间:2003年// Email : sjt61991@163.com// QQ : 48572512// POPO : sjt61991@163.com // blogs : http://yzty.cnblogs.com//////////////////////////////////////////////////软件说明:1、CreateDataCreateDB.exe为创建数据库2、MycommConsumeCom.dll是数据通信的Dll文件,在编译这个dll之前请先安装spcomm目录下的这个通信控件3、mainConsumeSys.exe主程序4、BackupDataBackUpDB.exe备份还原数据库其他的看看就明白了软件使用方法:1、安装SQL Server2000,那个版本都可以。2、将CreateDataCreateDB.exe,MycommConsumeCom.dll,BackupDataBackUpDB.exe,以及Main目录下的chis.ini,Config.ini,SysSet.ini,temp.txt,MyDBData.txt,myWaiting.avi文件,Main目录下的Cur,Rav,Skin,TempData,Update目录考到一个文件夹下。3、使用CreateDB.exe创建数据库4、打开主程序ConsumeSys.exe即可运行5、使用BackUpDB.exe备份还原数据库说明:这里不包含升级程序,需要的话,可以上网搜索一下,很多都有源代码的
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

程序猿毕业分享网

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

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

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

打赏作者

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

抵扣说明:

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

余额充值