java酒店管理系统课程设计推荐文档.docx

上传人:b****6 文档编号:6029918 上传时间:2023-01-03 格式:DOCX 页数:37 大小:261.45KB
下载 相关 举报
java酒店管理系统课程设计推荐文档.docx_第1页
第1页 / 共37页
java酒店管理系统课程设计推荐文档.docx_第2页
第2页 / 共37页
java酒店管理系统课程设计推荐文档.docx_第3页
第3页 / 共37页
java酒店管理系统课程设计推荐文档.docx_第4页
第4页 / 共37页
java酒店管理系统课程设计推荐文档.docx_第5页
第5页 / 共37页
点击查看更多>>
下载资源
资源描述

java酒店管理系统课程设计推荐文档.docx

《java酒店管理系统课程设计推荐文档.docx》由会员分享,可在线阅读,更多相关《java酒店管理系统课程设计推荐文档.docx(37页珍藏版)》请在冰豆网上搜索。

java酒店管理系统课程设计推荐文档.docx

java酒店管理系统课程设计推荐文档

Java语言程序设计课程设计

 

题目酒店管理系统

学院南湖学院

专业计算机科学与技术

班级计科N112

学号201145209133

学生姓名吴威宗

指导教师李永刚

编写日期2014/6/26

一、需求分析

随着餐饮行业的迅速发展,现有的人工管理方式已经不能呢个满足管理者的需求,广大餐饮业经营者已经意识到使用计算机应用软件的重要性,决定在餐饮企业的经营管理上引入计算机应用软件管理系统。

酒店管理系统的大致功能:

1.开台点餐

2.菜品管理

3.自动结账

4.后台菜系菜品管理

5.日月年结账报表

6.用户设置

根据需求分析,本系统采用的语言:

(1)本系统采用Java语言,Java是目前使用最为广泛的计算机语言之一。

它具有简单,面向对象,稳定,与平台无关等特点。

说他简单,并不是说这门语言很干瘪,而是一种清楚更容易理解的方式实现程序。

面向对象是基于对象的变成更符合人的思维方式,使人们更容易编写程序。

(2)本系统还采用SQL语言,SQLServer具有许多显著优点:

易用性、适合分布组织的可伸缩性、用于决策支持的数据仓库功能、与许多其他服务器软件紧密关联的集成性、良好的性价比等。

(3)本系统有效的利用Java和SQL的优点。

二、系统运行环境

操作系统为Windows7、windowsXP或windows2003使用的集成开发工具Eclipse数据库采用SQLServer2008,项目运行环境为JDK7。

三、功能需求描述

1.开台签单工作区的功能:

主要功能有开台、点菜、加菜、签单、查看开台信息和签单信息。

2.自动结账工作区的功能:

一个功能是自动计算当前选中餐台的消费金额;另一个功能是在结账时自动计算找零金额。

3.结账报表工作区功能:

日结帐报表,月结账报表,年结账报表。

4.后天管理工作区功能:

管理添加信息

四、模块结构图

模块结构图

五、数据库设计

5.1数据库分析

酒店管理系统的需求包括开台点菜功能、智能化获取菜品功能、自动结账功能、营业额报表功能等。

在这些功能总主要涉及的数据表包括台号表、菜品表、消费单表;为了使系统更加的完善,还需要为菜品分类,即需要用到菜系表;为了实现菜品的日销售情况统计,还要建立一个消费项目表,用来记录消费单消费的菜品。

5.2数据库概念设计

数据库设计是系统设计过程中的重要组成部分,它是通过管理系统的整天需求而制定的,数据库设计的好坏直接影响到系统的后期开发。

5.3数据库逻辑结构设计

台号表

菜品表

菜系表

消费单表

消费项目表

管理员表

六、程序模块设计

功能模块整体设计:

用户功能界面:

代码:

packagecom.mwq.frame;

importjava.awt.BorderLayout;

importjava.awt.Dimension;

importjava.awt.GridBagConstraints;

importjava.awt.GridBagLayout;

importjava.awt.Insets;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjava.awt.event.FocusEvent;

importjava.awt.event.FocusListener;

import.URL;

importjava.util.Vector;

importjavax.swing.BoxLayout;

importjavax.swing.ImageIcon;

importjavax.swing.JButton;

importjavax.swing.JComboBox;

importjavax.swing.JFrame;

importjavax.swing.JLabel;

importjavax.swing.JOptionPane;

importjavax.swing.JPanel;

importjavax.swing.JPasswordField;

importcom.mwq.dao.Dao;

importcom.mwq.mwing.MPanel;

publicclassLandFrameextendsJFrame{

privateJPasswordFieldpasswordField;//密码框

privateJComboBoxusernameComboBox;//用户名下拉菜单

publicstaticvoidmain(Stringargs[]){

try{

LandFrameframe=newLandFrame();

frame.setVisible(true);

}catch(Exceptione){

e.printStackTrace();

}

}

publicLandFrame(){

//首先设置窗口的相关信息

super();//调用父类的构造方法

setTitle("小组:

吴威宗周志远");//设置窗口的标题

setResizable(false);//设置窗口不可以改变大小

setAlwaysOnTop(true);//设置窗口总在最前方

setBounds(100,100,428,292);//设置窗口的大小

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置当关闭窗口时执行的动作

//下面将创建一个面板对象并添加到窗口的容器中

finalMPanelpanel=newMPanel(this.getClass().getResource(

"land_background.jpg"));//创建一个面板对象

panel.setLayout(newGridBagLayout());//设置面板的布局管理器为网格组布局

getContentPane().add(panel,BorderLayout.CENTER);//将面板添加到窗体中

finalJLabeltopLabel=newJLabel();

topLabel.setPreferredSize(newDimension(0,126));

finalGridBagConstraintsgridBagConstraints_5=newGridBagConstraints();

gridBagConstraints_5.gridx=0;

gridBagConstraints_5.gridy=0;

panel.add(topLabel,gridBagConstraints_5);

finalJLabelleftLabel=newJLabel();

leftLabel.setPreferredSize(newDimension(140,0));

finalGridBagConstraintsgridBagConstraints_3=newGridBagConstraints();

gridBagConstraints_3.gridy=1;

gridBagConstraints_3.gridx=0;

panel.add(leftLabel,gridBagConstraints_3);

finalJLabelrightLabel=newJLabel();

rightLabel.setPreferredSize(newDimension(55,0));

finalGridBagConstraintsgridBagConstraints_2=newGridBagConstraints();

gridBagConstraints_2.gridy=1;

gridBagConstraints_2.gridx=1;

panel.add(rightLabel,gridBagConstraints_2);

//创建并设置用户名下拉菜单

usernameComboBox=newJComboBox();//创建用户名下拉菜单组件对象

usernameComboBox.setMaximumRowCount(5);//设置下拉菜单最多可显示的选项数

usernameComboBox.addItem("请选择");//为下拉菜单添加提示项

usernameComboBox

.addActionListener(newUsernameComboBoxActionListener());//为下拉菜单添加事件监听器

finalGridBagConstraintsgridBagConstraints=newGridBagConstraints();//创建网格组布局管理器对象

gridBagConstraints.anchor=GridBagConstraints.WEST;//设置为靠左侧显示

gridBagConstraints.gridy=1;//设置行索引为1

gridBagConstraints.gridx=2;//设置列索引为2

panel.add(usernameComboBox,gridBagConstraints);//将组件按指定的布局管理器添加到面板中

//创建并设置密码框

passwordField=newJPasswordField();//创建密码框组件对象

passwordField.setColumns(20);//设置密码框可显示的字符数

passwordField.setText("");//设置密码框默认显示6个空格

passwordField.addFocusListener(newPasswordFieldFocusListener());//为密码框添加焦点监听器

finalGridBagConstraintsgridBagConstraints_1=newGridBagConstraints();//创建网格组布局管理器对象

gridBagConstraints_1.insets=newInsets(5,0,0,0);//设置组件外部上方的填充量为5像素

gridBagConstraints_1.anchor=GridBagConstraints.WEST;//设置为靠左侧显示

gridBagConstraints_1.gridy=2;//设置行索引为2

gridBagConstraints_1.gridx=2;//设置列索引为2

panel.add(passwordField,gridBagConstraints_1);//将组件按指定的布局管理器添加到面板中

//创建并设置一个用来添加三个按钮的面板

finalJPanelbuttonPanel=newJPanel();//创建一个用来添加按钮的面板

buttonPanel.setOpaque(false);//设置面板的背景为透明

buttonPanel.setLayout(newBoxLayout(buttonPanel,BoxLayout.X_AXIS));//设置面板采用水平箱布局

finalGridBagConstraintsgridBagConstraints_4=newGridBagConstraints();//创建网格组布局管理器对象

gridBagConstraints_4.insets=newInsets(10,0,0,0);//设置组件外部上方的填充量为10像素

gridBagConstraints_4.gridwidth=2;//设置其占两列

gridBagConstraints_4.gridy=3;//设置行索引为3

gridBagConstraints_4.gridx=1;//设置列索引为1

panel.add(buttonPanel,gridBagConstraints_4);//将组件按指定的布局管理器添加到面板中

//创建并设置一个登录按钮,并将其添加到用来添加按钮的面板中

finalJButtonlandButton=newJButton();//创建登录按钮组件对象

landButton.setMargin(newInsets(0,0,0,0));//设置按钮边框和标签之间的间隔

landButton.setContentAreaFilled(false);//设置不绘制按钮的内容区域

landButton.setBorderPainted(false);//设置不绘制按钮的边框

URLlandUrl=this.getClass().getResource("land_submit.png");//获得默认情况下登录按钮显示图片的URL

landButton.setIcon(newImageIcon(landUrl));//设置默认情况下登录按钮显示的图片

URLlandOverUrl=this.getClass().getResource(

"land_submit_over.png");//获得当鼠标经过登录按钮时显示图片的URL

landButton.setRolloverIcon(newImageIcon("land_submit_over.png"));//设置当鼠标经过登录按钮时显示的图片

URLlandPressedUrl=this.getClass().getResource(

"land_submit_pressed.png");//获得当登录按钮被按下时显示图片的URL

landButton.setPressedIcon(newImageIcon("land_submit_pressed.png"));//设置当登录按钮被按下时显示的图片

landButton.addActionListener(newLandButtonActionListener());//为登录按钮添加事件监听器

buttonPanel.add(landButton);//将登录按钮添加到用来添加按钮的面板中

finalJButtonresetButton=newJButton();

resetButton.setMargin(newInsets(0,0,0,0));

resetButton.setContentAreaFilled(false);

resetButton.setBorderPainted(false);

URLresetUrl=this.getClass().getResource("land_reset.png");

resetButton.setIcon(newImageIcon(resetUrl));

URLresetOverUrl=this.getClass().getResource(

"land_reset_over.png");

resetButton.setRolloverIcon(newImageIcon("land_reset_over.png"));

URLresetPressedUrl=this.getClass().getResource(

"land_reset_pressed.png");

resetButton.setPressedIcon(newImageIcon(resetPressedUrl));

resetButton.addActionListener(newResetButtonActionListener());

buttonPanel.add(resetButton);

finalJButtonexitButton=newJButton();

exitButton.setMargin(newInsets(0,0,0,0));

exitButton.setContentAreaFilled(false);

exitButton.setBorderPainted(false);

URLexitUrl=this.getClass().getResource("land_exit.png");

exitButton.setIcon(newImageIcon(exitUrl));

URLexitOverUrl=this.getClass()

.getResource("land_exit_over.png");

exitButton.setRolloverIcon(newImageIcon(exitOverUrl));

URLexitPressedUrl=this.getClass().getResource(

"land_exit_pressed.png");

exitButton.setPressedIcon(newImageIcon(exitPressedUrl));

exitButton.addActionListener(newExitButtonActionListener());

buttonPanel.add(exitButton);

//

//初始化用户名下拉菜单

VectoruserNameV=Dao.getInstance().sUserNameOfNotFreeze();

if(userNameV.size()==0){

usernameComboBox.addItem("TSoft");

}else{

for(inti=0;i

usernameComboBox.addItem(userNameV.get(i));

}

}

}

classUsernameComboBoxActionListenerimplementsActionListener{

publicvoidactionPerformed(ActionEvente){

StringuserName=(String)usernameComboBox.getSelectedItem();

if(userName.equals("TSoft"))

passwordField.setText("111");

}

}

classPasswordFieldFocusListenerimplementsFocusListener{

publicvoidfocusGained(FocusEvente){

passwordField.setText("");

}

publicvoidfocusLost(FocusEvente){

char[]passwords=passwordField.getPassword();

Stringpassword=turnCharsToString(passwords);

if(password.length()==0){

passwordField.setText("");

}

}

}

classExitButtonActionListenerimplementsActionListener{

publicvoidactionPerformed(ActionEventarg0){

System.exit(0);

}

}

classResetButtonActionListenerimplementsActionListener{

publicvoidactionPerformed(ActionEventarg0){

usernameComboBox.setSelectedIndex(0);

passwordField.setText("");

}

}

classLandButtonActionListenerimplementsActionListener{

publicvoidactionPerformed(ActionEvente){

Stringusername=usernameComboBox.getSelectedItem().toString();//获得登录用户的名称

if(username.equals("请选择")){//查看是否选择了登录用户

JOptionPane.showMessageDialog(null,"请选择登录用户!

","友情提示",

JOptionPane.INFORMATION_MESSAGE);//弹出提示

resetUsernameAndPassword();//恢复登录用户和登录密码

}

char[]passwords=passwordField.getPassword();//获得登录用户的密码

StringinputPassword=turnCharsToString(passwords);//将密码从char型数组转换成字符串

if(username.equals("JAVA")){//查看是否为默认用户登录

if(inputPassword.equals("123456")){//查看密码是否为默认密码

land(null);//登录成功

Stringinfos[]={"请立刻单击“用户管理”按钮添加用户!

",

"添加用户后需要重新登录,本系统才能正常使用!

"};//组织提示信息

JOptionPane.showMessageDialog(null,infos,"友情提示",

JOptionPane.INFORMATION_MESSAGE);//弹出提示

}else{//密码错误

JOptionPane.showMessageDialog(null,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1