餐厅点餐系统详细设计与系统实现

一.主要业务逻辑设计

1.登陆操作

package com.ibooking.action;

import com.ibooking.action.base.*;

import com.ibooking.util.*;

import com.opensymphony.xwork2.ActionContext;

public class LoginProcessAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private String userName;

private String userPasswd;

@Override

public String execute() {

ActionContext ctx = ActionContext.getContext();

if (daoService.validatePasswd(userName, userPasswd)) {

String userAuth = daoService.getUserAuthByName(userName);

//save the user info

ctx.getSession().put(WebConstant.LOGIN_USER, userName);

ctx.getSession().put(WebConstant.LOGIN_AUTH, userAuth);

fillTitle();

return fillIndexPage();

}else {

failReason = getText("loginFailure");

return RET_FAIL;

}

}

}

2.登出操作

package com.ibooking.action;

import com.ibooking.action.base.*;

import com.ibooking.util.*;

import com.opensymphony.xwork2.ActionContext;

public class LogoutProcessAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

@Override

public String execute() {

ActionContext ctx = ActionContext.getContext();

String userName = (String)ctx.getSession().get(WebConstant.LOGIN_USER);

if (!userName.isEmpty()) {

//clear the user info

ctx.getSession().put(WebConstant.LOGIN_USER, null);

ctx.getSession().put(WebConstant.LOGIN_AUTH, null);

ctx.getSession().clear();

fillTitle();

return fillIndexPage();

}else {

return RET_FAIL;

}

}

}

3.点餐操作

3.1添加菜品

package com.ibooking.action;

import com.ibooking.action.base.*;

public class OrderDetailPageEnterAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private int orderId;

@Override

public String execute() {

fillTitle();

return fillOrderDetailPage(orderId);

}

}

3.2订单提交

package com.ibooking.action;

import java.io.ByteArrayInputStream;

import java.io.InputStream;

import java.io.UnsupportedEncodingException;

import com.ibooking.action.base.*;

import com.ibooking.util.WebConstant;

import com.opensymphony.xwork2.ActionContext;

public class MenuSubmitAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private String menuName;

private String menuPrice;

private InputStream inputStream;

@Override

public String execute() throws UnsupportedEncodingException {

ActionContext ctx = ActionContext.getContext();

String userName = (String)ctx.getSession().get(WebConstant.LOGIN_USER);

int amount = daoService.changeShoppingAmount(userName, menuName, menuPrice, true);

if (amount == WebConstant.INVALID_VALUE) {

amount = 0;

}

String result = String.valueOf(amount);

inputStream = new ByteArrayInputStream(result.getBytes("UTF-8"));

return RET_SUCC;

}

4.顾客菜单修改操作

package com.ibooking.action;

import java.io.UnsupportedEncodingException;

import com.ibooking.action.base.*;

public class OrderListChangeAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private String opt;

private int orderId;

@Override

public String execute() throws UnsupportedEncodingException {

//analysis and process the opt param

if (opt.equals("orderDel")){

daoService.deleteOrderTrans(orderId);

}

return fillOrderListPage();

}

5.管理员修改菜单

package com.ibooking.action.manager;

import java.io.UnsupportedEncodingException;

import com.ibooking.action.base.*;

public class ManMenuChangeAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private String opt;

private int id;

private String name;

private Integer price;

private String pic;

private Integer type;

@Override

public String execute() throws UnsupportedEncodingException {

//analysis and process the opt param

if (opt.equals("menuAdd")){

daoService.insertMenu(name, price, pic, type);

}else if (opt.equals("menuMod")){

daoService.updateMenuById(id, name, price, pic, type);

}else if (opt.equals("menuDel")){

daoService.deleteMenu(id);

}

return fillManMenuPage();

}

}

6.管理员对用户管理

package com.ibooking.action.manager;

import java.io.UnsupportedEncodingException;

import com.ibooking.action.base.*;

public class ManUserChangeAction extends BaseAction {

/**

*

*/

private static final long serialVersionUID = 1L;

private String opt;

private int id;

private String user;

private String passwd;

private String auth;

private String tel;

private String addr;

@Override

public String execute() throws UnsupportedEncodingException {

//analysis and process the opt param

if (opt.equals("userAdd")){

daoService.insertUser(user, passwd, auth, tel, addr);

}else if (opt.equals("userMod")){

daoService.updateUserById(id, user, passwd, auth, tel, addr);

}else if (opt.equals("userDel")){

daoService.deleteUser(id);

}

return fillManUserPage();

}

}

二.表现层设计与实现

1.登陆及注册界面

" />

" />

$("#ib_login_submit_btn").click(

function() {

if ($("#ib_login_user_input").val() == "" || $("#ib_login_passwd_input").val() == "") {

alert("");

return false;

}

}

)

界面图:

2.菜单主页面

">

:

menuName=''

menuPrice=''>

function fnSubmitBtn(data, code, request) {

//exclude the error page

var menuAmount = data.match(//);

if (menuAmount == null) {

var menuName = this.data.match(/menuName=(.+)&/);

if (menuName != null && menuName[1] != null) {

$("button").each(function() {

if ($(this).attr("menuName") == menuName[1]) {

$(this).children("span").text(data);

}

});

}

}

}

$("button").click(

function() {

alert("please login!");

window.location.href = 'loginPageEnter';

return;

var ajaxUrl = "menuSubmit";

var ajaxData = "menuName=" + $(this).attr("menuName") + "&" + "menuPrice=" + $(this).attr("menuPrice");

jQuery.ajax({

type: "POST",

url: ajaxUrl,

data: ajaxData,

dataType: "html",

contentType: "application/x-www-form-urlencoded; charset=utf-8",

success: fnSubmitBtn

});

}

)

界面图:

3.用户订单修改

function fnChangeFinish(data, code, request) {

if (code == "success") {

$("#ib_orderlist_content_div").html(data);

}

}

function onBtnDelClick(data) {

var ajaxUrl = "orderListChange";

jQuery.ajax({

type: "POST",

url: ajaxUrl,

data: data,

dataType: "html",

contentType: "application/x-www-form-urlencoded; charset=utf-8",

success: fnChangeFinish

});

}

界面图:

4.管理员菜单修改及客户订单处理

function onBtnNewClick() {

var status = $("#ib_man_menu_new_btn").attr("status");

if (status == "new") {

$("#ib_man_menu_new_name_input").removeAttr("readOnly");

$("#ib_man_menu_new_price_input").removeAttr("readOnly");

$("#ib_man_menu_new_pic_select").removeAttr("disabled");

$("#ib_man_menu_new_type_select").removeAttr("disabled");

$("#ib_man_menu_add_btn").removeAttr("disabled");

$("#ib_man_menu_new_btn").attr("status", "cancel");

$("#ib_man_menu_new_btn").text("");

}else if (status == "cancel") {

$("#ib_man_menu_new_name_input").attr("readOnly", "true");

$("#ib_man_menu_new_price_input").attr("readOnly", "true");

$("#ib_man_menu_new_pic_select").attr("disabled", "disabled");

$("#ib_man_menu_new_type_select").attr("disabled", "disabled");

$("#ib_man_menu_add_btn").attr("disabled", "disabled");

$("#ib_man_menu_new_btn").attr("status", "new");

$("#ib_man_menu_new_btn").text("");

}

}

function fnChangeFinish(data, code, request) {

if (code == "success") {

$("#ib_man_menu_content_div").html(data);

}

}

function onBtnAddClick(data) {

var ajaxUrl = "manMenuChange";

data = data +

"&name=" + $("#ib_man_menu_new_name_input").val() +

"&price=" + $("#ib_man_menu_new_price_input").val() +

"&pic=" + $("#ib_man_menu_new_pic_select").val() +

"&type=" + $("#ib_man_menu_new_type_select").val();

jQuery.ajax({

type: "POST",

url: ajaxUrl,

data: data,

dataType: "html",

contentType: "application/x-www-form-urlencoded; charset=utf-8",

success: fnChangeFinish

});

}

function onBtnEditClick(data) {

$(".ib_man_menu_id_label").each(function() {

if ($(this).text() == data) {

var name_input = $(this).next();

var price_input = $(this).parent().next().children();

var pic_select = price_input.parent().next().children();

var type_select = pic_select.parent().next().children()

var edit_btn = type_select.parent().next().children("#ib_man_menu_edit_btn");

var mod_btn = edit_btn.next();

var status = edit_btn.attr("status");

if (status == "edit") {

name_input.removeAttr("readOnly");

price_input.removeAttr("readOnly");

pic_select.removeAttr("disabled");

type_select.removeAttr("disabled");

mod_btn.removeAttr("disabled");

edit_btn.attr("status", "cancel");

edit_btn.text("");

}else if (status == "cancel") {

name_input.attr("readOnly", "true");

price_input.attr("readOnly", "true");

pic_select.attr("disabled", "disabled");

type_select.attr("disabled", "disabled");

mod_btn.attr("disabled", "disabled");

edit_btn.attr("status", "edit");

edit_btn.text("");

}

}

});

}

function onBtnModClick(data) {

var ajaxUrl = "manMenuChange";

var id = data.match(/id=(.+)&opt=menuMod/);

if (id != null && id[1] != null) {

$(".ib_man_menu_id_label").each(function() {

if ($(this).text() == id[1]) {

var name_input = $(this).next();

var price_input = $(this).parent().next().children();

var pic_select = price_input.parent().next().children();

var type_select = pic_select.parent().next().children()

data = data +

"&name=" + name_input.val() +

"&price=" + price_input.val() +

"&pic=" + pic_select.val() +

"&type=" + type_select.val();

jQuery.ajax({

type: "POST",

url: ajaxUrl,

data: data,

dataType: "html",

contentType: "application/x-www-form-urlencoded; charset=utf-8",

success: fnChangeFinish

});

}

});

}

}

function onBtnDelClick(data) {

var ajaxUrl = "manMenuChange";

jQuery.ajax({

type: "POST",

url: ajaxUrl,

data: data,

dataType: "html",

contentType: "application/x-www-form-urlencoded; charset=utf-8",

success: fnChangeFinish

});

}

界面图:

python界面实现点餐系统_餐厅点餐系统详细设计与系统实现相关推荐

  1. 扫码点菜系统代码_餐厅点餐只能选择“桌上扫码”?点餐方式岂能“一刀切”...

    国庆长假期间,餐饮市场异常火爆.不少餐厅都推出了"桌上扫码点餐",个别餐厅甚至没有纸菜单,顾客只能手机扫码点餐,这样的方式真的合适吗? 在南京新街口一家餐厅,服务员提醒记者通过桌子 ...

  2. 手机点餐系统 电脑服务器,手机点餐系统_手机点餐软件大全【最新】-太平洋电脑网...

    在美味不用等软件中点餐的详细操作方法介绍 使用美味不用等的用户们,知道在其中如何点餐吗?不太懂的话可以去下文中看看美味不用等中点餐的详细操作方法. 支付宝中怎么点餐?支付宝点餐的具体操作步骤 除了在外 ...

  3. 点餐推荐系统_自助点餐、自助收银…智慧餐厅的下一步又会是什么?

    说到智慧餐饮,很多人想到的是扫码点餐.自助点餐等功能.在餐饮场景的前端--点餐环节中进行无人化,可以减少人力成本和点餐出错几率,为餐厅节省三到五成的成本.据美团点评统计,中小型餐厅饭馆使用自助点餐(包 ...

  4. python制作图形化成绩查询系统_怎样制作考试成绩在线查询系统呢?

    谢谢邀请 考试成绩查询系统是可以让学生自己从网上查询自己考试成绩的系统,学生输入查询条件,比如学号.姓名等就可以看到自己的考试成绩,建立考试成绩查询系统需要开发查询系统源码,购买服务器空间等,非常繁琐 ...

  5. 山东省特种设备作业考试系统_山东省特种设备作业人员考试系统使用手册详解.doc...

    山东省特种设备作业人员考试系统 用户使用手册 (考生用户) 山东省特种设备作业人员考试系统项目组 二〇一二年四月 目 录 一.考试申请1 二.现场考试6 2.1照片采集6 2.2考生登陆6 2.3 现 ...

  6. 基于Java的电子作业提交系统_基于jsp的网上作业提交系统-JavaEE实现网上作业提交系统 - java项目源码...

    基于jsp+servlet+pojo+mysql实现一个javaee/javaweb的网上作业提交系统, 该项目可用各类java课程设计大作业中, 网上作业提交系统的系统架构分为前后台两部分, 最终实 ...

  7. 安卓原生系统_全球首个原生安卓车载系统实测!操作流畅 可跟手机媲美

    ch共 看点:全球首个原生安卓汽车系统落在了Polestar 2上,到底能否带来质变呢? 车东西(公众号:chedongxi)编 | 吴垚 导语:Polestar 2作为沃尔沃旗下高端纯电动汽车,因其 ...

  8. java课设超市收银系统_基于jsp的超市收银系统-JavaEE实现超市收银系统 - java项目源码...

    基于jsp+servlet+pojo+mysql实现一个javaee/javaweb的超市收银系统, 该项目可用各类java课程设计大作业中, 超市收银系统的系统架构分为前后台两部分, 最终实现在线上 ...

  9. 用java做小学数学系统_小学生数学练习题目自动生成系统——java课程设计

    <小学生数学练习题目自动生成系统--java课程设计>由会员分享,可在线阅读,更多相关<小学生数学练习题目自动生成系统--java课程设计(37页珍藏版)>请在金锄头文库上搜索 ...

  10. MySQL长途售票系统_基于SSH的长途汽车票务售票系统的设计(Struts2,MySQL)(含录像)...

    基于SSH的长途汽车票务售票系统的设计(Struts2,MySQL)(含录像)(毕业论文说明书14000字,程序代码,MySQL数据库)摘  要 随着科学技术的不断提高,计算机科学日渐成熟,其强大的功 ...

最新文章

  1. Java学习总结:32(Runtime类)
  2. No module named 'torch._C'
  3. 有窗体和无窗体覆盖的问题
  4. Windows进程与线程学习笔记(二)—— 线程结构体
  5. linux mysql 5.5 安装_Linux 安装 mysql5.5.19
  6. android.os.binderproxy cannot be cast to,Android服务android.os.BinderProxy错误
  7. python实现链表的删除_Python垃圾回收机制
  8. Base64编码的原理与常用实现
  9. 2021谷饶中学高考成绩查询,高考成绩
  10. Python基础——6面向对象编程
  11. 西门子修复因使用第三方组件引起的90多个漏洞
  12. 机器学习之K-means算法
  13. STM32菜鸟成长记录---RS485通讯协议的应用
  14. 局域网共享打印机教程
  15. 对于学习编程,你认为英语和数学哪个重要?
  16. C++程序员的职业生涯规划
  17. PHP之Smarty
  18. php ios表情包,[iOS] 自定义表情包
  19. Linux中ssh基于密匙的安全验证过程是怎样的?
  20. 打开计算机首先映入眼帘的一整屏称之为桌面,利用“活动桌面” 让桌面也“闪”起来...

热门文章

  1. twitter最多关注者_Twitter的10个最具创意的用途
  2. python3 词频统计代码_Python词频统计代码,python
  3. 用Matlab筛选mirbase,一种基于miRBase数据库的植物有参的miRNA数据分析方法与流程...
  4. android 两点距离计算公式,Android 计算地球上任意两点(经纬度)距离
  5. sql查询将字段值转换成汉字
  6. decodeURI方法,中文乱码转换为汉字, 将url地址中的乱码转换为正常的
  7. python多层bp网络_多层bp神经网络 python
  8. 01-Mybatis持久层框架快速入门(环境搭建、xml配置文件、注解)
  9. 根据Word模板动态生成PDF
  10. NLP数据标注工具调研