JAVA酒店管理系统

article/2025/8/19 13:51:11

 

目录

E-R图 

数据库搭建

功能模块

代码部分


E-R图 

 数据库搭建

功能模块

1.首先要通过 JAVA 代码连接数据库,通过 jdbc 插件
2.设计主菜单、子菜单,里面内容是管理酒店的各种操作,我会设置相应的功能模块完成操作。
3.要使这个系统能够持续运行且可以选择相应的功能模块,需要设计一个主控制函数,这个函数通过一个 while 循环持续运行,操作者输入 1、2、3。。。来选择相应的功能实现。
难点:如果操作者需要从子菜单返回到主菜单,需要编写一个能使操作者输入数字就能返回的功能,我们可以设置一个 flag 变量,每次循环时刷新为 1
while( true)
{
flag = 1;
子菜单在 flag=1 的时候才能运行,在 switch 语句里面,如果操作者输入 4,令 flag=0,
while(flag == 1)
{
        menu3();//客房管理菜单
        System. out .println("\t\t请输入选项:");
        x = scan.nextInt();
        switch(x)
{
        case 1:b.increase_room(); break;//增加客房
        case 2:b.decrease_room(); break;//减少客房
        case 3:flag = 0; break;//返回
        case 4:b.change_roomprice(); break;//修改房价
        case 5:b.change_roomtype(); break;//修改房型
}
}
那么这个子菜单循环就结束了,就可以直接返回到主菜单的大循环里。
4.顾客登记模块,在这个模块里,我们要输入顾客的姓名、身份证号、电话、性别、订单号、房间号,然后把这些数据通过 sql 的 insert value 语句插入到数据库中,然后还需要生成订单,会继续输入入住天数、房间类型、订房数量,然后插入数据库中。
难点:入住时间设置为当前操作的时间
String sql3 = "select CONVERT(varchar, getdate(), 120 ) 当前时间";
rs=st.executeQuery(sql3);
while(rs.next())
{
time = rs.getString("当前时间");
}
通过 sql 语句获得当前时间,然后使 time 变量等于当前时间插入订单表的入住时间中。
5.团体登记的功能,团体登记需要输入团体名、团体号、团体电话、团体人数、
订单号然后插入到团体登记表中,然后通过输入的团体人数决定登记顾客的人数,然后循环顾客登记的模块,将团体中的成员录入顾客登记表中,最后调用生成订单模块生成订单。
难点:
String sql2 = "update 房间信息 set 是否入住 = '是' where 房间号 = '"+roomnum1+"'";
顾客登记后意味着房间已入住,所以房间信息表中是否入住这一属性也要相应的更改,通过这条 sql 语句即可实现
6.设计客房管理,客房管理有多项内容,我们创建了一个子菜单,里面有查询可用房间模块,增减客房、更改房价、更改房型。
7.可用房间模块通过 sql 语句查询是否入住属性为“否”的所有房间信息
rs=st.executeQuery("select * from 房间信息 where 是否入住 = '否' ");
while (rs.next())
{
System. out .println("房间号: "+rs.getString("房间号") + " 房间类型: " +
rs.getString("房间类型")
+ " 房间价格: " + rs.getString("房间价格"));
}
通过 while 循环 rs.next()来遍历表中所有内容打印出来。
8.增加客房模块,首先要输入增加数量,然后把增加的操作放到 for 循环里,循环增加数量次,输入增加的房型,房价,新的房间号然后插入房间信息表中。
9.减少客房模块,只需要输入需删除的房间号,然后用 sql delete 语句删除即可。
10.更改房价模块,输入要更改的房型,然后输入修改后的房价,然后用 sql update 语句更新房间即可。
11.更改房间类型模块,输入要更改的房间号,然后输入修改后的房型,然后用 sql update 语句更新即可。
12.设置登录模块
int login(String id,String psw)
实现管理员登录的操作,只有管理员才能进入客房管理和设置模块,登录模块要用到操作员信息表找到操作员 ID 和密码,与输入的 ID 和密码进行比较,看是否相等,相等则可进入相应界面。
13.设计设置,设置也有子菜单,包括修改密码,添删用户,实现比较简单,通过 sql 语句的增删改即可。
14.退房功能,分为顾客退房和团体退房
顾客退房:顾客只需输入身份证号即可完成退房,然后通过查询语句找到身份证号所对应的房间号,取得房间号,再把对应房间号的是否入住改为“否”,然后通过等值连接订单和顾客登记表,通过身份证号找到订单总金额,打印输出。
团体退房:与顾客退房相似,区别在于需输入团体号和退房数量,根据退房数量循环改是否入住属性,然后查询语句得到总金额打印输出。
15.查询界面设计
有查询所有顾客、所有团体、所有订单、根据姓氏查询顾客、根据身份证号查询顾客、根据团体号查询顾客、根据顾客电话查询顾客的房间类型,这些所有功能模块都只需相应的 sql 语句,查询到结果,打印输出。

代码部分

import java.sql.*;
import java.util.Scanner;
import java.util.Vector;
public class databaseConnect {private String driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver";private String dbURL="jdbc:sqlserver://localhost:1433;DatabaseName=宾馆客房管理系统";private  String userName="sa";private String userPwd="qzt1220796416";private  Connection ct=null;private ResultSet rs=null;private Statement st;static int number = 0;public void mainmenu()//主菜单{System.out.println("\n\n");System.out.println("\t\t* * * * * * 酒店管理系统 * * * * * *\n");System.out.println("\t\t*           1.:顾客登记                  *\n");System.out.println("\t\t*           2.:团体登记                  *\n");System.out.println("\t\t*           3.:客房管理                  *\n");System.out.println("\t\t*           4.:设置                      *\n");System.out.println("\t\t*           5.:查询                      *\n");System.out.println("\t\t*           6.:退房                      *\n");System.out.println("\t\t* * * * * * * * * * * * * * * * *  * * *\n\n");}public void menu5()//查询{System.out.println("\n\n");System.out.println("\t\t* * * * * * 酒店管理系统 * * * * * *\n");System.out.println("\t\t*           1.:所有顾客                  *\n");System.out.println("\t\t*           2.:所有团体                  *\n");System.out.println("\t\t*           3.:所有订单                  *\n");System.out.println("\t\t*           4.:返回                      *\n");System.out.println("\t\t*           5.:根据姓氏查询顾客          *\n");System.out.println("\t\t*           6.:根据身份证号查询顾客      *\n");System.out.println("\t\t*           7.:根据团体号查询团体信息    *\n");System.out.println("\t\t*     8.:根据顾客电话查询顾客的房间类型  *\n");System.out.println("\t\t*           9.:可用房间                  *\n");System.out.println("\t\t* * * * * * * * * * * * * * * * *  * * *\n\n");}public void menu6()//退房{System.out.println("\n\n");System.out.println("\t\t* * * * * * 酒店管理系统 * * * * * *\n");System.out.println("\t\t*           1.:顾客退房                  *\n");System.out.println("\t\t*           2.:团体退房                  *\n");System.out.println("\t\t*           3.:返回                      *\n");System.out.println("\t\t* * * * * * * * * * * * * * * * *  * * *\n\n");}public void menu3()//客房管理{System.out.println("\n\n");System.out.println("\t\t* * * * * * 酒店管理系统 * * * * * *\n");System.out.println("\t\t*           1.:增加客房                  *\n");System.out.println("\t\t*           2.:减少客房                  *\n");System.out.println("\t\t*           3.:返回                      *\n");System.out.println("\t\t*           4.:更改房价                  *\n");System.out.println("\t\t*           5.:更改房间类型              *\n");System.out.println("\t\t* * * * * * * * * * * * * * * * *  * * *\n\n");}public void menu4()//设置{System.out.println("\n\n");System.out.println("\t\t* * * * * * 酒店管理系统 * * * * * *\n");System.out.println("\t\t*           1.:修改密码                  *\n");System.out.println("\t\t*           2.:添加用户                  *\n");System.out.println("\t\t*           3.:删除用户                  *\n");System.out.println("\t\t*           4.:返回                      *\n");System.out.println("\t\t* * * * * * * * * * * * * * * * *  * * *\n\n");}public void search_roomtype() throws Exception//根据顾客电话查询房间类型{Scanner scan=new Scanner(System.in);System.out.println("请输入顾客的手机号");String num = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "select 房间类型 from 顾客登记,订单 where 顾客登记.订单号=订单.订单号 and 顾客电话 = '"+num+"'";rs = st.executeQuery(sql);while (rs.next()){System.out.println("房间类型:"+rs.getString("房间类型") );}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void search_group() throws Exception//根据团体号查询团体信息{Scanner scan=new Scanner(System.in);System.out.println("请输入您想查询团体的团体号:");String num = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "select * from 团体登记 where 团体号 = '"+num+"'";rs = st.executeQuery(sql);while (rs.next()){System.out.println("团体名:"+rs.getString("团体名") + "\n团体号:" + rs.getString("团体号")+ "\n团体电话:" + rs.getString("团体电话")+ "\n团体人数:" + rs.getString("团体人数")+ "\n订单号:" + rs.getString("订单号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void search_customer2() throws Exception//根据姓氏查询顾客 {Scanner scan=new Scanner(System.in);System.out.println("请输入您想查询顾客的姓");String name1 = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "select * from 顾客登记 where 顾客姓名 like '"+name1+"%'";rs = st.executeQuery(sql);while (rs.next()){System.out.println("顾客姓名:"+rs.getString("顾客姓名") + "\n顾客身份证号:" + rs.getString("顾客身份证号")+ "\n顾客电话:" + rs.getString("顾客电话")+ "\n顾客性别:" + rs.getString("顾客性别")+ "\n订单号:" + rs.getString("订单号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void search_customer1() throws Exception//根据身份证号查询顾客 {Scanner scan=new Scanner(System.in);System.out.println("请输入您想查询顾客的身份证号");String ID = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "select * from 顾客登记 where 顾客身份证号 = '"+ID+"'";rs = st.executeQuery(sql);while (rs.next()){System.out.println("顾客姓名:"+rs.getString("顾客姓名") + "\n顾客身份证号:" + rs.getString("顾客身份证号")+ "\n顾客电话:" + rs.getString("顾客电话")+ "\n顾客性别:" + rs.getString("顾客性别")+ "\n订单号:" + rs.getString("订单号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void change_roomprice() throws Exception//更改房价{Scanner scan=new Scanner(System.in);System.out.println("请输入您想更改的房型");String roomtype = scan.next();System.out.println("请输入修改后的房价");int price = scan.nextInt();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "update 房间信息 set 房间价格 = "+price+" where 房间类型 = '"+roomtype+"'";st.executeUpdate(sql);System.out.println("修改成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void change_roomtype() throws Exception//更改房间类型{Scanner scan=new Scanner(System.in);System.out.println("请输入您想更改的房间号");String roomnum = scan.next();System.out.println("请输入您想更改的房型");String roomtype = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "update 房间信息 set 房间类型 = '"+roomtype+"' where 房间号 = '"+roomnum+"'";st.executeUpdate(sql);System.out.println("修改成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void show_group() throws Exception//所有团体{Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select * from 团体登记");while (rs.next()){System.out.println("团体名: "+rs.getString("团体名") + " 团体号: " + rs.getString("团体号")+ " 团体电话: " + rs.getString("团体电话")+ " 团体人数: " + rs.getInt("团体人数")+ " 订单号: " + rs.getString("订单号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void show_customer() throws Exception//所有顾客{Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select * from 顾客登记");while (rs.next()){System.out.println("顾客姓名: "+rs.getString("顾客姓名") + " 顾客身份证号: " + rs.getString("顾客身份证号")+ "   顾客电话: " + rs.getString("顾客电话")+ "    顾客性别: " + rs.getString("顾客性别")+ " 订单号: " + rs.getString("订单号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void show_order() throws Exception//所有订单{Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select * from 订单");while (rs.next()){System.out.println("订单号: "+rs.getString("订单号") + " 入住天数: " + rs.getInt("入住天数")+ " 房间类型: " + rs.getString("房间类型")+ " 订房数量: " + rs.getInt("订房数量")+ " 总金额: " + rs.getInt("总金额")+ " 入住时间: " + rs.getString("入住时间")+ " 房间号: " + rs.getString("房间号"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void group_exit() throws Exception//团体退房{Scanner scan=new Scanner(System.in);System.out.println("请输入团体号");String ID = scan.next();System.out.println("请输入需要退的房间数量");int num = scan.nextInt();for(int i=0;i<num;i++){System.out.println("请输入房间号");String number = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "update 房间信息 set 是否入住 = '否' where 房间号 = '"+number+"'";st.executeUpdate(sql);}String sql2 = "select 总金额 from 订单,团体登记 where 订单.订单号 = 团体登记.订单号 and 团体号 = '"+ID+"'";rs=st.executeQuery(sql2);while (rs.next()){System.out.println("顾客需支付金额为: "+rs.getString("总金额"));}System.out.println("离店操作成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void customer_exit() throws Exception//顾客退房{Scanner scan=new Scanner(System.in);System.out.println("请输入顾客身份证号");String ID = scan.next();String number=null;Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select 房间号 from 顾客登记 where 顾客身份证号 = '"+ID+"'");while (rs.next()){number = rs.getString("房间号");}String sql = "update 房间信息 set 是否入住 = '否' where 房间号 = '"+number+"'";String sql2 = "select 总金额 from 订单,顾客登记 where 订单.订单号 = 顾客登记.订单号 and 顾客身份证号 = '"+ID+"'";st.executeUpdate(sql);rs=st.executeQuery(sql2);while (rs.next()){System.out.println("顾客需支付金额为: "+rs.getString("总金额"));}System.out.println("离店操作成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void change_psw() throws Exception//修改密码{Scanner scan=new Scanner(System.in);System.out.println("请输入操作员ID");String ID = scan.next();System.out.println("请输入新的密码");String number = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "update 操作员信息 set 密码 = '"+number+"' where 操作员ID = '"+ID+"'";st.executeUpdate(sql);System.out.println("修改密码成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void add_user() throws Exception//添加用户{Scanner scan=new Scanner(System.in);System.out.println("请输入新的操作员ID");String ID = scan.next();System.out.println("请输入密码");String number = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "insert into 操作员信息 values"+"('"+ID+"','"+number+"')";st.executeUpdate(sql);System.out.println("添加用户成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void delete_user() throws Exception//删除用户{Scanner scan=new Scanner(System.in);System.out.println("请输入需要删除的操作员ID");String ID = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "delete from 操作员信息 where 操作员ID = '"+ID+"'";st.executeUpdate(sql);System.out.println("删除成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void increase_room() throws Exception//增加客房{Scanner scan=new Scanner(System.in);System.out.println("请输入增加客房数量");int roomnum = scan.nextInt();for(int i = 0; i<roomnum; i++){System.out.println("请输入增加客房的房型");String roomtype = scan.next();System.out.println("请输入房间价格");int price = scan.nextInt();System.out.println("请输入新的房间号");String number = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "insert into 房间信息 values"+"('"+number+"','"+roomtype+"','否',"+price+")";st.executeUpdate(sql);System.out.println("添加成功");}if(st!=null)st.close();if(ct!=null)ct.close();}public void decrease_room() throws Exception//减少客房{Scanner scan=new Scanner(System.in);System.out.println("请输入需要删除的房间号");String number = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "delete from 房间信息 where 房间号 = '"+number+"'";st.executeUpdate(sql);System.out.println("删除成功");if(st!=null)st.close();if(ct!=null)ct.close();}public void creat_order(String order) throws Exception//生成订单{Vector<Object> data=new Vector<Object>();int total_price=0;Scanner scan=new Scanner(System.in);System.out.println("请输入入住天数");int days = scan.nextInt();System.out.println("请输入房间类型");String roomtype = scan.next();System.out.println("请输入订房数量");int roomnum = scan.nextInt();String time=null;System.out.println("请输入房间号");String roomnumber = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select 房间价格 from 房间信息 where 房间类型 = '"+roomtype+"'");while(rs.next()){total_price = days*roomnum *rs.getInt("房间价格");}String sql3 = "select CONVERT(varchar, getdate(), 120 ) 当前时间";rs=st.executeQuery(sql3);while(rs.next()){time = rs.getString("当前时间");}String sql = "insert into 订单 values"+"('"+order+"',"+days+",'"+roomtype+"',"+roomnum+","+total_price+",'"+time+"','"+roomnumber+"')";st.executeUpdate(sql);System.out.println("订单生成成功");}public void group_sign() throws Exception//团体登记{databaseConnect g = new databaseConnect();Scanner scan=new Scanner(System.in);System.out.println("请输入团体名");String name = scan.next();System.out.println("请输入团体号");String pID = scan.next();System.out.println("请输入团体电话");String phonenum = scan.next();System.out.println("请输入团体人数");int people = scan.nextInt();System.out.println("请输入订单号");String order = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "insert into 团体登记 values"+"('"+name+"','"+pID+"','"+phonenum+"',"+people+",'"+order+"')";st.executeUpdate(sql);for(int i = 0; i<people; i++){System.out.println("第"+(i+1)+"位客人");System.out.println("请输入您的姓名");String name1 = scan.next();System.out.println("请输入您的身份证号");String pID1 = scan.next();System.out.println("请输入您的电话");String phonenum1 = scan.next();System.out.println("请输入您的性别");String gender = scan.next();System.out.println("请输入订单号");String order1 = scan.next();System.out.println("请输入房间号");String roomnum1 = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql1 = "insert into 顾客登记 values"+"('"+name1+"','"+pID1+"','"+phonenum1+"','"+gender+"','"+order1+"','"+roomnum1+"')";st.executeUpdate(sql1);String sql2 = "update 房间信息 set 是否入住 = '是'  where 房间号 = '"+roomnum1+"'";st.executeUpdate(sql2);System.out.println("登记成功");}g.creat_order(order);//生成订单System.out.println("团体登记成功");ct.commit();if(st!=null)st.close();if(ct!=null)ct.close();}public void sign() throws Exception//顾客登记{databaseConnect f = new databaseConnect();Scanner scan=new Scanner(System.in);System.out.println("请输入您的姓名");String name = scan.next();System.out.println("请输入您的身份证号");String pID = scan.next();System.out.println("请输入您的电话");String phonenum = scan.next();System.out.println("请输入您的性别");String gender = scan.next();System.out.println("请输入订单号");String order = scan.next();System.out.println("请输入房间号");String roomnum = scan.next();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();String sql = "insert into 顾客登记 values"+"('"+name+"','"+pID+"','"+phonenum+"','"+gender+"','"+order+"','"+roomnum+"')";st.executeUpdate(sql);String sql1 = "update 房间信息 set 是否入住 = '是'  where 房间号 = '"+roomnum+"'";st.executeUpdate(sql1);Vector<Object> data=new Vector<Object>();int total_price=0;System.out.println("请输入入住天数");int days = scan.nextInt();System.out.println("请输入房间类型");String roomtype = scan.next();System.out.println("请输入订房数量");int roomnum1 = scan.nextInt();String time = null;Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select 房间价格 from 房间信息 where 房间类型 = '"+roomtype+"'");while(rs.next()){total_price = days*roomnum1 *rs.getInt("房间价格");}String sql3 = "select CONVERT(varchar, getdate(), 120 ) 当前时间";rs=st.executeQuery(sql3);while(rs.next()){time = rs.getString("当前时间");}String sql2 = "insert into 订单 values"+"('"+order+"',"+days+",'"+roomtype+"',"+roomnum1+","+total_price+",'"+time+"',"+roomnum+")";st.executeUpdate(sql2);System.out.println("订单生成成功");System.out.println("登记成功");ct.commit();if(st!=null)st.close();if(ct!=null)ct.close();}public int login(String id,String psw) throws Exception//登录系统{Vector<Object> data1=new Vector<Object>();Vector<Object> data2=new Vector<Object>();Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select * from 操作员信息");while(rs.next()){data1.add(rs.getString(1));data2.add(rs.getString(2));}for(int i = 0; i < data1.size(); i++){if(id.equals(data1.elementAt(i)) && psw.equals(data2.elementAt(i))){System.out.println("登录成功");if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();return 1;}}System.out.println("登录失败");if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();return 0;}public void available_rooms() throws Exception//可用房间{Class.forName(driverName);ct=DriverManager.getConnection(dbURL,userName,userPwd);st=ct.createStatement();rs=st.executeQuery("select * from 房间信息 where 是否入住 = '否' ");while (rs.next()){System.out.println("房间号: "+rs.getString("房间号") + " 房间类型: " + rs.getString("房间类型")+ "      房间价格: " + rs.getString("房间价格"));}if(rs!=null)rs.close();if(st!=null)st.close();if(ct!=null)ct.close();}public void maincontrol() throws Exception//主控制函数{databaseConnect b = new databaseConnect();int x1,x;int flag;Scanner scan=new Scanner(System.in);while(true){flag = 1;mainmenu();//首页菜单System.out.println("\t\t请输入选项:");x1 = scan.nextInt();if(x1==1)//顾客登记{b.sign();}else if(x1==2)//团体登记{  b.group_sign();}else if(x1==3)//客房管理{System.out.println("请输入您的ID:");String id = scan.next();System.out.println("请输入您的密码:");String psw = scan.next();if(b.login(id, psw) == 1){while(flag == 1){menu3();//客房管理菜单System.out.println("\t\t请输入选项:");x = scan.nextInt();switch(x){case 1:b.increase_room();break;//增加客房case 2:b.decrease_room();break;//减少客房case 3:flag = 0;break;//返回case 4:b.change_roomprice();break;//修改房价case 5:b.change_roomtype();break;//修改房型}}}}else if(x1==4)//设置{System.out.println("请输入您的ID:");String id = scan.next();System.out.println("请输入您的密码:");String psw = scan.next();if(b.login(id, psw) == 1){while(flag == 1){menu4();//设置菜单System.out.println("\t\t请输入选项:");x = scan.nextInt();switch(x){case 1:b.change_psw();break;//修改密码case 2:b.add_user();break;//添加用户case 3:b.delete_user();break;//删除用户case 4:flag = 0;break;//返回}}}}else if(x1==5)//查询{while(flag == 1){menu5();//查询菜单System.out.println("\t\t请输入选项:");x = scan.nextInt();switch(x){case 1:b.show_customer();break;//所有顾客case 2:b.show_group();break;//所有团体case 3:b.show_order();break;//所有订单case 4:flag = 0;break;//返回case 5:b.search_customer2();break;//根据姓氏查询顾客case 6:b.search_customer1();break;//根据身份证号查询顾客case 7:b.search_group();break;//根据团体号查询团体case 8:b.search_roomtype();break;//根据顾客电话查询房间类型case 9:b.available_rooms();break;//预定客房或登记入住}}}else if(x1==6)//退房{while(flag == 1){menu6();//退房菜单System.out.println("\t\t请输入选项:");x = scan.nextInt();switch(x){case 1:b.customer_exit();break;//顾客退房case 2:b.group_exit();break;//团体退房case 3:flag = 0;break;//返回}}}}}public static void main(String[] args) throws Exception{databaseConnect a = new databaseConnect();a.maincontrol();//进入主控制函数;}
}


http://chatgpt.dhexx.cn/article/powOdkrg.shtml

相关文章

酒店后台管理系统、客栈管理、入住会员、房间管理、房源、房型、订单、报表、酒店企业、短信模板、积分、打印、交接班、住宿、入住、锁房、收支流水、房间销售、消费项目、酒店管理、渠道销售、支付管理、连锁酒店

酒店后台管理系统、客栈管理、入住会员、房间管理、房源、房型、订单、报表、酒店企业、短信模板、积分、打印、交接班、住宿、入住、锁房、收支流水、房间销售、消费项目、酒店管理、渠道销售、支付管理、连锁酒店 Axure原型演示及下载地址&#xff1a;产品大牛 - 让产品工作…

中小型酒店管理系统

[摘要]计算机网络如果结合使用信息管理系统&#xff0c;能够提高管理员管理的效率&#xff0c;改善服务质量。优秀的中小型酒店管理系统能够更有效管理用户预订酒店业务规范&#xff0c;帮助管理者更加有效管理用户预订酒店&#xff0c;可以帮助提高克服人工管理带来的错误等不…

ASP.NET-酒店管理系统

绪论 1.1本系统的课题背景 中国改革开放以后&#xff0c;我国大力发展经济、教育、旅游等先进产业链&#xff0c;人们对于外出旅游和群体聚餐的需求越来越大。而且我国的良好的科学教育水平和人民文化素质的提高&#xff0c;为酒店管理系统提供了良好的机遇和前景。 采用现代…

酒店客房预订管理系统简单实现

酒店客房预订管理系统 纯java实现&#xff0c;通过IO流对本地文件进行读取操作 需求分析 入住客人信息管理 管理所有入住客人的基本信息&#xff0c;包括开房登记、退房结账、查询、客人延期续费、按姓名详细查询等客人预订信息管理 管理所有预订客户的基本信息&#xff0c;…

简易酒店管理系统

简易酒店管理系统 个人独立开发者&#xff0c;只包括前台营业管理&#xff0c;系统开发过程参考多个酒店系统的优点&#xff0c;结合自身对此行业的理解开发而成。成都地区可以上门安装及培训。我只卖源代码&#xff0c;不负责具体现场实施 开发技术选型&#xff1a;基于.net4.…

sql酒店管理系统

简单sql server酒店管理系统 <1> 负责工作流和功能分析&#xff0c;E/R图设计 <2> 负责关系模式设计&#xff0c;存储过程&#xff0c;触发器&#xff0c;视图设计的使用 数据库概念模型设计 数据库逻辑设计 关系模型 酒店&#xff08;酒店编号&#xff0c;酒店…

课程设计---宾馆客房管理系统

课程名称&#xff1a; 数据库原理及应用 项目名称&#xff1a;宾馆客房管理系统 eclipse、Tomcat、MySQL8、Navicat【项目内容】 1、主要数据表 客户住房信息登记表&#xff0c;客房信息统计表&#xff0c;账目统计表等。 2、功能模块 1&#xff09;接待人员可以完成为客人预…

酒店管理系统的设计与实现

Word下载链接如下&#xff1a; https://download.csdn.net/download/yw1990128/87096359 一 设计背景 1.1 课题现状 随着国家社会经济水平的提升&#xff0c;各酒店的发展速度越来越快&#xff0c;入住人员也越来越多。酒店房间的管理要求也愈来愈大&#xff0c;所以很多酒店正…

酒店管理系统

酒店后台管理系统 这是一个基于ssmjsp的maven后台管理系统项目&#xff0c;使用idea,Mysql来搭建项目&#xff0c;在完成项目后&#xff0c;我想通过一篇博客来记录我的学习过程已经对项目进行讲解&#xff0c;具体的代码会放在Github上 功能介绍&#xff1a; 1&#xff0c;能…

Hotel Manager 酒店管理系统

Hotel Manager 酒店管理系统 问题分析 菜单界面 操作员能够方便的选择所需要进行的操作 在main函数中对每次操作跳转到不同的函数中 执行完操作后返回到管理页面 不同房间的标准价格制定&#xff0c;收费方式的制定&#xff1a;/天 或 /小时 每个房间的收费方式要写2个 ro…

酒店管理系统的设计与实现/酒店客房管理系统/酒店预定系统

摘 要 随着科学技术的飞速发展&#xff0c;社会的方方面面、各行各业都在努力与现代的先进技术接轨&#xff0c;通过科技手段来提高自身的优势&#xff0c;酒店管理系统当然也不能排除在外。酒店管理系统是以实际运用为开发背景&#xff0c;运用软件工程开发方法&#xff0c;采…

酒店管理系统/酒店客房管理系统的设计与实现

摘 要 酒店管理系统采用B/S模式&#xff0c;促进了酒店管理的安全、高效、快捷的发展。传统的管理模式还处于手工处理阶段&#xff0c;管理效率极低&#xff0c;随着用户的不断增多&#xff0c;传统基于手工管理模式已经无法满足当前用户需求&#xff0c;随着信息化时代的到来…

酒店客房管理信息系统

目 录 摘 要 Abstracts 目 录 第1章 绪论 1.1课题背景 1.2研究意义 1.3研究内容 第2章 技术介绍 2.1相关技术 2.2java技术 2.3MySQL数据库 2.4 Tomcat介绍 2.5SSM框架 第3章 需求分析 3.1需求分析概述 3.2可行性分析 3.2.1经济可行性 3.2.2技术可行性 3.3…

酒店客房管理系统

技术&#xff1a;Java、JSP等 摘要&#xff1a;随着我国经济的不断发展&#xff0c;外出旅游或工作越来越多成为居民必不可少的一部分。所以酒店也在这样的条件下不断快速的发展。同时&#xff0c;随着酒店企业的蓬勃发展&#xff0c;酒店对酒店客房信息的管理的难度不断增大&a…

asp.net1053-酒店宾馆客房预订管理系统#毕业设计

项目编号:asp.net1053-酒店宾馆客房预订管理系统#毕业设计 运行环境&#xff1a;VSSQL 开发工具:VS2010及以上版本 数据库:SQL2008及以上版本 使用技术&#xff1a;HTMLJSHTML 开发语言&#xff1a;C#&#xff0c;框架&#xff1a;asp.net 传统的酒店管理模式基本上都是用传统的…

模型量化各类论文综述(摘要、方法总结)

模型量化各类论文综述&#xff08;摘要、方法总结&#xff09; 方法&#xff08;总结&#xff09;&#xff1a; Fixed-point Scalar Quantization Reference 1、韩松2、https://arxiv.org/pdf/2004.07320.pdf

毕业论文 | 文献综述应该怎么写

毕业论文 | 文献综述应该怎么写 01关于论文写作的顺序02 研究背景该写点啥03 文献综述包括啥子04 文献综述大纲05 文献综述引用小技巧06 Endnote文献管理工具 这篇文章想输出一下这份我在写文献综述时的总结。 依旧是提前说明&#xff0c;这篇文章只是我在毕业论文写作中总结到…

【论文笔记】中文词向量论文综述(一)

导读 最近在做中文词向量相关工作&#xff0c;其中看了一些中文词向量的相关论文&#xff0c;在这篇文章&#xff0c;将把近几年的中文词向量进展及其模型结构加以简述&#xff0c;大概要写3-4篇综述&#xff0c;每篇包含2-3篇论文。 一、Component-Enhanced Chinese Characte…

超分论文综述( DualCNN,Deep SR-ITM ,DSGAN)

论文来源&#xff1a; [1] Pan, J., Liu, S., Sun, D., Zhang, J., Liu, Y., Ren, J., ... & Yang, M. H. (2018). Learning dual convolutional neural networks for low-level vision. In Proceedings of the IEEE conference on computer vision and pattern recognit…

【论文笔记】知识图谱综述2021

KRL - Knowledge Representation Learning 在知识表示学习里&#xff0c;我们希望把实体和关系映射到低维空间上&#xff0c;这样便于我们提取实体与关系的特征表示。这时我们的思路可以是&#xff1a; which representation space to choose 本文描述了4种表示空间&#xff1…