The design and implementation of java web hotel management system in software engineering [source code + paper]


foreword

Today, seniors share with you an excellent graduation design project:

Design and Implementation of Hotel Management System

Project acquisition:
https://gitee.com/sinonfin/L-javaWebSha

1. Project design

1. Modular design

On the basis of the above analysis of the system, the overall design of the system is now carried out, and the modules of the overall design function are shown in the figure:

insert image description here

Overall Design Specific Modules

According to the functional modules and demand analysis of the overall design, the data dictionary of each module of the hotel management system:

1. System administrator data: the included data items are user name and password.
2. Room type data: the data items included include id number and type name.
3. Room information data: The data items included include room number, room area, room introduction, room picture, and room type.
4. Room reservation data: the data items included include room reservation, reservation time, name and phone number of the reservation user, and number of days reserved.
5. Check-in consumption data: the included data items include check-in rooms, check-in time, customer name and contact information, reservation days and consumption amount.
6. Customer information data: the data items included include customer name, address, telephone number, and E-mail.
7. Featured food data: The data items included include name, description, picture, and price.
8. Table reservation data: the included data items include reservation time, reservation table number, and reservation person.
9. Catering consumption data: the data items included include consumption time, consumption amount, and consumer name.

database part design

Contemporary computer software systems have not only used computers to solve problems statically, but have used specific data and analyzed specific situations to dynamically solve practical problems. So data is especially crucial. And the data is completed by performing various operations in the database. Use the advantages and characteristics of the database management system to carry out effective management, reasonable analysis, and flexible use of data information. The huge advantages of the database make the database has become the main component of the computer system such as the current information system. Whether the database design is reasonable directly affects the quality of the overall system.

This system establishes an abstract conceptual data model mainly by selecting (1) centralized schema design method: according to the global data schema, external schemas are defined for each user group or application. Classify the logical structure described by user requirements, express the data model between entities in the form of a two-dimensional table, and establish an abstract conceptual data model [1]. (2) View integration method: based on individual parts, design partial patterns separately, and then integrate them into a whole pattern based on these views [1].

insert image description here

2. Realize the effect

interface login
insert image description here
insert image description here

insert image description here

insert image description here
insert image description here

2. Part of the source code

Some code examples:

login code

public String login(String userName,String userPw,int userType)
	{
    
    
String result="no";
		String sql="from TAdmin where userName=? and userPw=?";
		Object[] con={
    
    userName,userPw};
		List adminList=adminDAO.getHibernateTemplate().find(sql,con);
		if(adminList.size()==0)
		{
    
    
			 result="no";
		}
		else
		{
    
    
			 WebContext ctx = WebContextFactory.get(); 
			 HttpSession session=ctx.getSession(); 
			 TAdmin admin=(TAdmin)adminList.get(0);
			 session.setAttribute("userType", 0);
             session.setAttribute("admin", admin);
             result="yes";
		}
		return result;
	}
/**
添加系统管理员
/
public void adminAdd(HttpServletRequest req,HttpServletResponse res)
	{
		String userName=req.getParameter("userName");//获取填写用户名
		String userPw=req.getParameter("userPw");/获取密码
		String sql="insert into t_admin(userName,userPw) values(?,?)";//数据添加到数据库中
		Object[] params={userName,userPw};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("message", "操作成功");
		req.setAttribute("path", "admin?type=adminMana");
		
        String targetURL = "/common/success.jsp";
		dispatch(targetURL, req, res);
	}
	/**
系统管理员删除
/
	public void adminDel(HttpServletRequest req,HttpServletResponse res)
	{
		
		String sql="delete from t_admin where userId="+Integer.parseInt(req.getParameter("userId"));//在数据库中查找满足userId的数据
		Object[] params={};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		req.setAttribute("message", "操作成功");
		req.setAttribute("path", "admin?type=adminMana");
		
        String targetURL = "/common/success.jsp";
		dispatch(targetURL, req, res);
	}

Project source code

Project acquisition:
https://gitee.com/sinonfin/L-javaWebSha

Guess you like

Origin blog.csdn.net/mojikopi/article/details/131696880