java酒店管理系统课程设计.pdf





《java酒店管理系统课程设计.pdf》由会员分享,可在线阅读,更多相关《java酒店管理系统课程设计.pdf(33页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、JAVA 酒店管理程序设计Java 语言程序设计课程设计题 目酒店管理系统学 院南湖学院专 业计算机科学与技术班 级计科 N112学 号201145209133学生姓名 吴威宗指导教师李永刚编写日期2014/6/26目录目录一、需求分析 4JAVA 酒店管理程序设计二、系统运行环境 5三、功能需求描述 5四、模块结构图 5五、数据库设计 551 数据库分析 552 数据库概念设计 653 数据库逻辑结构设计 6六、程序模块设计 7七、总结 35一、需求分析一、需求分析随着餐饮行业的迅速发展,现有的人工管理方式已经不能呢个满足管理者的需求,广大餐饮业经营者已经意识到使用计算机应用软件的重要性,决
2、定在餐饮企业的经营管理上引入计算机应用软件管理系统。酒店管理系统的大致功能:1开台点餐2菜品管理3自动结账4后台菜系菜品管理5日月年结账报表6用户设置根据需求分析,本系统采用的语言:(1)本系统采用 Java 语言,Java 是目前使用最为广泛的计算机语言之一。它具有简单,面向对象,稳定,与平台无关等特点。说他简单,并不是说这门语言很干瘪,而是一种清楚更容易理解的方式实现程序。面向对象是基于对象的变成更符合人的思维方式,使人们更容易编写程序。(2)本系统还采用SQL 语言,SQL Server具有许多显著优点:易用性、适合分布组织的可伸缩性、用于决策支持的数据仓库功能、与许多其他服务器软件紧密
3、关联的集成性、良好的性价比等.(3)本系统有效的利用 Java 和 SQL 的优点。JAVA 酒店管理程序设计二、系统运行环境二、系统运行环境操作系统为Windows 7、windows XP或windows 2003 使用的集成开发工具Eclipse 数据库采用 SQL Server2008,项目运行环境为 JDK 7。三、功能需求描述三、功能需求描述1开台签单工作区的功能:主要功能有开台、点菜、加菜、签单、查看开台信息和签单信息。2自动结账工作区的功能:一个功能是自动计算当前选中餐台的消费金额;另一个功能是在结账时自动计算找零金额.3结账报表工作区功能:日结帐报表,月结账报表,年结账报表。
4、4后天管理工作区功能:管理添加信息四、模块结构图四、模块结构图模块结构图模块结构图五、数据库设计五、数据库设计5 51 1 数据库分析数据库分析酒店管理系统的需求包括开台点菜功能、智能化获取菜JAVA 酒店管理程序设计品功能、自动结账功能、营业额报表功能等.在这些功能总主要涉及的数据表包括台号表、菜品表、消费单表;为了使系统更加的完善,还需要为菜品分类,即需要用到菜系表;为了实现菜品的日销售情况统计,还要建立一个消费项目表,用来记录消费单消费的菜品.5 52 2 数据库概念设计数据库概念设计数据库设计是系统设计过程中的重要组成部分,它是通过管理系统的整天需求而制定的,数据库设计的好坏直接影响到
5、系统的后期开发。5 53 3 数据库逻辑结构设计数据库逻辑结构设计台号表菜品表JAVA 酒店管理程序设计菜系表消费单表消费项目表管理员表六、程序模块设计六、程序模块设计功能模块整体设计:功能模块整体设计:JAVA 酒店管理程序设计用户功能界面:用户功能界面:JAVA 酒店管理程序设计代码:package com.mwq。frame;import java。awt。BorderLayout;import java.awt.Dimension;import java。awt.GridBagConstraints;import java。awt。GridBagLayout;import java。a
6、wt。Insets;import java.awt.event.ActionEvent;import java.awt。event.ActionListener;import java。awt。event.FocusEvent;import java。awt.event。FocusListener;import java。net。URL;import java。util.Vector;import javax。swing。BoxLayout;import javax。swing.ImageIcon;import javax.swing。JButton;import javax。swing。JC
7、omboBox;import javax.swing.JFrame;import javax.swing。JLabel;import javax。swing.JOptionPane;import javax.swing.JPanel;import javax。swing。JPasswordField;import com.mwq。dao.Dao;import com。mwq。mwing.MPanel;public class LandFrame extends JFrame JAVA 酒店管理程序设计private JPasswordField passwordField;/密码框privat
8、e JComboBox usernameComboBox;/用户名下拉菜单public static void main(String args)try LandFrame frame=new LandFrame();frame。setVisible(true);catch(Exception e)e.printStackTrace();public LandFrame()/首先设置窗口的相关信息super();/调用父类的构造方法setTitle(”小组:吴威宗 周志远);/设置窗口的标题setResizable(false);/设置窗口不可以改变大小setAlwaysOnTop(true)
9、;/设置窗口总在最前方setBounds(100,100,428,292);/设置窗口的大小setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);/设置当关闭窗口时执行的动作/下面将创建一个面板对象并添加到窗口的容器中final MPanel panel=new MPanel(this。getClass()。getResource(”land_background.jpg);/创建一个面板对象panel.setLayout(new GridBagLayout();/设置面板的布局管理器为网格组布局getContentPane()。add(panel,Bo
10、rderLayout。CENTER);/将面板添加到窗体中final JLabel topLabel=new JLabel();topLabel。setPreferredSize(new Dimension(0,126);final GridBagConstraints gridBagConstraints_5=new GridBagConstraints();gridBagConstraints_5.gridx=0;gridBagConstraints_5.gridy=0;panel.add(topLabel,gridBagConstraints_5);final JLabel leftLa
11、bel=new JLabel();leftLabel。setPreferredSize(new Dimension(140,0);final GridBagConstraints gridBagConstraints_3=new GridBagConstraints();gridBagConstraints_3.gridy=1;gridBagConstraints_3.gridx=0;panel.add(leftLabel,gridBagConstraints_3);JAVA 酒店管理程序设计final JLabel rightLabel=new JLabel();rightLabel。set
12、PreferredSize(new Dimension(55,0));final GridBagConstraints gridBagConstraints_2=new GridBagConstraints();gridBagConstraints_2。gridy=1;gridBagConstraints_2.gridx=1;panel。add(rightLabel,gridBagConstraints_2);/创建并设置用户名下拉菜单usernameComboBox=new JComboBox();/创建用户名下拉菜单组件对象usernameComboBox。setMaximumRowCou
13、nt(5);/设置下拉菜单最多可显示的选项数usernameComboBox.addItem(请选择);/为下拉菜单添加提示项usernameComboBox.addActionListener(new UsernameComboBoxActionListener();/为下拉菜单添加事件监听器final GridBagConstraints gridBagConstraints=new GridBagConstraints();/创建网格组布局管理器对象gridBagConstraints.anchor=GridBagConstraints.WEST;/设置为靠左侧显示gridBagCons
14、traints。gridy=1;/设置行索引为 1gridBagConstraints.gridx=2;/设置列索引为 2panel。add(usernameComboBox,gridBagConstraints);/将组件按指定的布局管理器添加到面板中/创建并设置密码框passwordField=new JPasswordField();/创建密码框组件对象passwordField.setColumns(20);/设置密码框可显示的字符数passwordField。setText(”);/设置密码框默认显示 6 个空格passwordField.addFocusListener(new P
15、asswordFieldFocusListener());/为密码框添加焦点监听器final GridBagConstraints gridBagConstraints_1=new GridBagConstraints();/创建网格组布局管理器对象gridBagConstraints_1.insets=new Insets(5,0,0,0);/设置组件外部上方的填充量为 5 像素gridBagConstraints_1.anchor=GridBagConstraints.WEST;/设置为靠左侧显示gridBagConstraints_1。gridy=2;/设置行索引为 2gridBagCo
16、nstraints_1.gridx=2;/设置列索引为 2panel。add(passwordField,gridBagConstraints_1);/将组件按指定的布局管理器添加到面板中/创建并设置一个用来添加三个按钮的面板final JPanel buttonPanel=new JPanel();/创建一个用来添加按钮的面板buttonPanel.setOpaque(false);/设置面板的背景为透明buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS));/设置面板采用水平箱布局JAVA 酒店管理程序设计fin
17、al GridBagConstraints gridBagConstraints_4=new GridBagConstraints();/创建网格组布局管理器对象gridBagConstraints_4。insets=new Insets(10,0,0,0);/设置组件外部上方的填充量为 10 像素gridBagConstraints_4.gridwidth=2;/设置其占两列gridBagConstraints_4。gridy=3;/设置行索引为 3gridBagConstraints_4。gridx=1;/设置列索引为 1panel。add(buttonPanel,gridBagConst
18、raints_4);/将组件按指定的布局管理器添加到面板中/创建并设置一个登录按钮,并将其添加到用来添加按钮的面板中final JButton landButton=new JButton();/创建登录按钮组件对象landButton。setMargin(new Insets(0,0,0,0));/设置按钮边框和标签之间的间隔landButton。setContentAreaFilled(false);/设置不绘制按钮的内容区域landButton。setBorderPainted(false);/设置不绘制按钮的边框URL landUrl=this。getClass().getResour
19、ce(”land_submit。png”);/获得默认情况下登录按钮显示图片的URLlandButton.setIcon(new ImageIcon(landUrl));/设置默认情况下登录按钮显示的图片URL landOverUrl=this.getClass()。getResource(”land_submit_over。png”);/获得当鼠标经过登录按钮时显示图片的 URLlandButton。setRolloverIcon(new ImageIcon(land_submit_over.png”));/设置当鼠标经过登录按钮时显示的图片URL landPressedUrl=this。g
20、etClass()。getResource(”land_submit_pressed.png”);/获得当登录按钮被按下时显示图片的URLlandButton。setPressedIcon(new ImageIcon(land_submit_pressed.png);/设置当登录按钮被按下时显示的图片landButton。addActionListener(new LandButtonActionListener();/为登录按钮添加事件监听器buttonPanel.add(landButton);/将登录按钮添加到用来添加按钮的面板中final JButton resetButton=new
21、 JButton();resetButton。setMargin(new Insets(0,0,0,0));resetButton。setContentAreaFilled(false);resetButton.setBorderPainted(false);URL resetUrl=this.getClass().getResource(land_reset。png”);resetButton。setIcon(new ImageIcon(resetUrl);URL resetOverUrl=this.getClass().getResource(land_reset_over。png);re
22、setButton.setRolloverIcon(new ImageIcon(land_reset_over.png);URL resetPressedUrl=this。getClass()。getResource(JAVA 酒店管理程序设计land_reset_pressed。png);resetButton.setPressedIcon(new ImageIcon(resetPressedUrl));resetButton。addActionListener(new ResetButtonActionListener();buttonPanel。add(resetButton);fina
23、l JButton exitButton=new JButton();exitButton。setMargin(new Insets(0,0,0,0);exitButton.setContentAreaFilled(false);exitButton。setBorderPainted(false);URL exitUrl=this.getClass().getResource(land_exit.png”)exitButton。setIcon(new ImageIcon(exitUrl);URL exitOverUrl=this。getClass().getResource(”land_exi
24、t_over.png);exitButton.setRolloverIcon(new ImageIcon(exitOverUrl));URL exitPressedUrl=this.getClass()。getResource(”land_exit_pressed.png”)exitButton.setPressedIcon(new ImageIcon(exitPressedUrl));exitButton.addActionListener(new ExitButtonActionListener();buttonPanel。add(exitButton);/初始化用户名下拉菜单Vector
25、 userNameV=Dao.getInstance().sUserNameOfNotFreeze();if(userNameV。size()=0)usernameComboBox.addItem(TSoft”);else for(int i=0;i userNameV。size();i+)usernameComboBox。addItem(userNameV。get(i);class UsernameComboBoxActionListener implements ActionListener public void actionPerformed(ActionEvent e)String
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 酒店 管理 系统 课程设计

限制150内