Design and implementation of JAVA-based online flower shop sales system (attached: source code paper sql file)

Summary

With the rapid development of the times, our life is inseparable from the computer network, and the rapid development of e-commerce is changing people's way of life. With the continuous rise of various online shopping platforms, people have long been used to buying what they need without going out. However, there are still few online platforms for flower sales, so designing an online flower shop sales system is very promising.

The online flower shop sales system adopts the MVC model of JSP+Servlet+JavaBean to separate data objects, business logic and user interface. The system is divided into two roles: user and administrator. After registering and logging in, users can browse flowers, browse announcements, and purchase flowers. After logging in, administrators can manage and maintain the system.

The online flower shop sales system is easy to operate for users, and meets the needs of users to buy flowers anytime and anywhere. It not only saves time for users, but also improves the purchasing efficiency of users. For the flower shop owner, it not only improves sales efficiency but also reduces time and labor costs.

Key words sales system; JSP; MVC; online flower shop

Significance

There are many limitations in the traditional physical flower sales, and this system is dedicated to meeting the needs of users to choose and buy flowers online anytime and anywhere. For flower shop owners, it can improve work efficiency, systematize, standardize and automate online flower management, improve the efficiency of the entire flower purchase process, and raise the overall level to a new height. Compared with traditional flower shops, online flower shops have their incomparable advantages. First of all, the operating cost of an online flower shop is low, the number of employees is small, and it does not require a large operating space. Secondly, online flower shops have the characteristics of rapid dissemination of information, large capacity, wide range, and interaction. Not only that, the establishment of an online flower shop can better meet the needs of consumers. This network tool brings convenience to consumers, and at the same time promotes the purchase desire of users who browse this website, and improves sales efficiency.

The online flower shop system provides users with a complete set of online flower ordering process, enabling users to directly shop online without leaving home, which brings great convenience to consumers. With the development of human society, interpersonal communication has become more and more important. In this busy society, people seldom have time to meet and exchange feelings. Sending a bouquet of flowers to friends on special days is a good way to connect feelings, so it is welcomed by consumers. At the same time, merchants no longer need to passively wait for customers in the store, and can easily sell their products while sitting at home and earn profits. The computer's storage and fast query functions greatly improve the efficiency of online flower shop management, and also improve the accuracy of querying and purchasing flowers. The convenient and fast operation can not only reduce the loopholes in the past, but also reduce the errors caused by redundant work. More importantly, the operation of the system is very simple and it is easy to promote.

data flow diagram

Data Flow Diagram (DFD) is abbreviated as DFD. From the perspective of data transmission and processing, it graphically expresses the logical function of the system, the logical flow direction and logical transformation process of data in the system. It is the main expression tool for structured system analysis methods and used to represent A graphical approach to software models. The data flow diagram of the online flower shop sales system is shown in the figure

The boxes in the data flow diagram represent the origin or destination of data, and the origin and destination are entities outside the system. The ellipse represents the processing of transforming data, also known as processing, which performs some operation or transformation on the data stream. Arrows represent data flow, which is the direction in which data travels through the system. Double bars represent data storage files, which are used to temporarily store data. There are two entities in the online flower shop sales system, namely users and administrators. Users correspond to customers who buy flowers online, and administrators correspond to the owners of online flower shops. For users, the processing in this system includes browsing flowers, viewing categories, managing user information, managing shopping carts, generating and viewing orders, and viewing announcements. For administrators, there are flower management, classification management, user management, order management, Announcement management. The data storage in this system includes flower information, classification information, user information, shopping cart information, order information and announcement information. In actual implementation, these information should be stored in the corresponding tables, although flower information, classification information, user Information, order information, and announcement information are shared by users and administrators. However, due to different permissions, users only have the right to view flower information, classification information, and announcement information, and administrators have the authority to add, delete, and modify these information. It is reflected in the data flow diagram as a difference in processing.

In the system, users can browse flowers, view categories, manage user information, manage shopping carts, generate and view orders, and view announcements. The user data flow diagram in this system is shown in the figure

Figure 4-2 User data flow diagram

Administrators can manage flowers, categories, users, orders, and announcements in the system. Administrators can add, modify, view, and delete flowers, categories, and announcements, view and delete users, and edit orders. to view and process. The administrator data flow diagram in this system is shown in the figure

System IPO Chart

The IPO diagram is the abbreviation of Input-Process-Output diagram (Input-Process-Output). The basic form is to draw three boxes, listing the relevant input data in the left box, listing the main processing in the middle box, and listing the resulting output data in the right box. The input data of the online flower shop sales system is mainly user information and flower information, the processing is mainly for users, flower classification, flower details, shopping cart and order, and the output data corresponds to the processing process. The IPO diagram of the system is shown in the figure

System function module design

The online flower shop sales system is divided into two modules: the front desk and the back desk. Although the two modules are independent of each other on the surface, they are closely connected in terms of access to the database. Each module accesses the same database. Only the table being accessed is different.

The front desk functional modules of the online flower shop sales system are divided into:

1. Flower display module

The flower display module is mainly to show the flowers of the online flower shop to users, and it is mainly divided into two sub-modules: flower search and flower classification. Users can directly query the flowers they want to know through the flower search, or find a certain type of flowers through the flower classification.

2. Announcement display module

The announcement display module is the announcement information related to the online flower shop system released by the administrator, which may include the use of the system or the latest preferential activities. After the user logs in to the system, he can view the bulletin information, so as to understand the system as quickly as possible.

3. Purchase flower module

The purchase of flowers module is mainly to complete the online shopping process of the user. The module of buying flowers is divided into two sub-modules: adding to the shopping cart and generating orders.

4. User management module

The user management module is divided into three sub-modules: user registration, user login, and user modification information.

The function module diagram of the front desk of the online flower shop sales system is shown in the figure

When a user purchases flowers, he must first register and then log in. After logging in to the system, the user can browse flowers, add the flowers to be purchased into the shopping cart, and generate an order for the flowers in the shopping cart.

Sequence diagram of users buying flowers

The entities of this online flower shop sales system include administrators, users, announcements, orders, categories, and flowers. The ER diagram of each entity will be designed separately below.

1. The user ER diagram is as shown in the figure

In this ER diagram, for the user entity, the user can browse announcements, so the user entity and the announcement entity are in the browsing relationship, and the user can buy flowers, so the user entity and the flower entity are in the shopping relationship, and the user can view categories, so the user entity And the classification entity is a viewing relationship, users can manage their own shopping carts, so the user entity and shopping cart entity are management relationships, users can view their own orders, so the user entity and order entity are viewing relationships, and users are managed in the system It is managed by administrators, so users and administrators are in a managed relationship.

The ER diagram of the administrator is shown in the figure

In this ER diagram, for the administrator entity, the administrator can manage system announcements, orders, categories, flowers, and registered users, so the relationship between it and other entities is a management relationship.

Design and Implementation of System Objects

The system includes a total of seven objects, namely users, administrators, announcements, flowers, categories, shopping carts and orders. The class diagram of the system is shown in the figure

In the implementation process, these seven objects are encapsulated into bean objects, and the contents of the encapsulated objects of administrators and users are the same, so they share one object, which is distinguished by the attribute role, 0 means user, and 1 means system administrator. The six objects correspond to Dingdan.java, Fenlei.java, Gonggao.java, Gouwuche.java, Product.java, User.java in the code. Taking User.java as an example, the key code is as follows:

public class User {

private int id;//primary key

private String username;//username

private String password;//password

private String xingming;//name

private int role;//User role 0 means user, 1 means system administrator

private String dianhua;//mobile phone

private String dizhi;//Receipt address

}

The design and realization of the homepage of the system

The homepage of the system has a simple and clear style. On the top bar, you can choose to register and log in. On the left side, there are flower search, flower classification, sales rankings and flower shop announcements. Users can browse related content according to their needs. The right side of the page is a list of flowers, and users can click the corresponding link to view details or add to the shopping cart. The design of the home page is shown in the figure

The design and realization of the front desk function of the system

Design and Implementation of User Registration Module

User registration needs to fill in the corresponding information, mainly including user name, password, confirmation password, name, delivery address and mobile phone number. The design of the user registration page is shown in the figure

This page corresponds to register.jsp in the code. This page has format requirements for each input data. The user name cannot be empty and must be numbers, letters or underscores. The password cannot be empty and must be at least 6 characters. Confirm the password To be consistent with the password, the name, delivery address and mobile phone number cannot be empty, and the mobile phone number must conform to the correct format. When the user registers, the page will first check the input data format, and if the input is wrong, there will be a corresponding prompt. In addition, when the user enters the data in the correct format and clicks the registration button, the system will compare it with the database. If the user name has been registered, the system will also pop up a corresponding prompt. Insert the data into the database, prompt that the registration is successful and jump to the home page. The specific implementation process is to logically process the registration in IndexServlet.java, and operate the database in UserDao.java.

Design and Implementation of User Login Module

The user needs to fill in the user name and password to log in. The design of the login page is as shown in the figure

Design and Realization of Announcement Browsing Module

Users can browse flower shop announcements on the homepage, and view detailed information of flower shop announcements by clicking on the title of flower shop announcements. The flower shop announcement page and the announcement details page are designed as shown in the figure

Design and implementation of flower list module

Users can browse flowers in the flower list on the home page of the system. The flower list includes flower names, pictures, category names, flower prices, and two operations of viewing details and adding to the shopping cart. After clicking View Details, the page will jump to the flower information details page. The flower list page and the flower information details page are shown in the figure

The flower list page corresponds to index.jsp in the code, and the flower information details page corresponds to product.jsp in the code. The specific implementation method is to use the productupdate method in IndexServlet.java for specific processing when the user clicks to view the details, and then pass the object to to the product.jsp page. When the user clicks Add to Cart on the flower list or flower information details page, if the user is already logged in, the system jumps to the My Shopping Cart page. Otherwise, the system prompts the user to log in first and redirects to the login page.

Design and Implementation of User Shopping Cart Module

My shopping cart page, including flower name, unit price, purchase time, subtotal. Users can modify the purchase quantity or delete items in the shopping cart, and can also click on the link to jump to the order page. My shopping cart page design as shown in the figure

Design and Implementation of User Order Module

My order page, including order number, consignee name, order status, production time, total price, and the operation to view order details. Users can also view and search their own orders. my order page

Design and Realization of User Information Management Module

Users can manage their own information on the personal information page, mainly to change the name, mobile phone number and delivery address, and can modify the password on the password modification page. The design of the user information page and the design of modifying the password are shown in the figure

The design and realization of the background function of the system

Design and implementation of system background page

After successful login, the administrator will enter the system background page, mainly including the main menu on the left and the welcome page in the middle. The main menu includes category management, flower management, announcement management, order management, and user management. System background page

Design and Realization of Classification Management Function

Through this function, administrators can view, modify, and delete existing categories, as well as add new categories. The classification management page of the system is shown in the figure

Design and Realization of Flower Management Function

Through this function, administrators can view, modify, delete existing flowers, and also add new flowers. The flower management page of the system is shown in the figure

Design and Realization of Bulletin Management Function

Through this function, administrators can view, modify, and delete existing announcements, and can also add new announcements. The announcement management page of the system is shown in the figure

Design and implementation of order management function

Administrators can view and process orders through this function. The order management page of the system is shown in the figure

Design and Realization of User Management Function

Administrators can view and delete users through this function. The user management page of the system is shown in the figure


Open source projects and data sharing: Free access to the source code courseware and other materials supporting the system: just need: like + follow +    click on the source code package for free

If there is a novice who wants to get started with Java and Python, but he doesn't know what to learn and how to learn? You can private message me and share the webpan information of Java and Python selflessly~~~

Share and encourage each other~~~

If you have any resources, you can share with each other, and if you have any questions, you can also discuss with each other~~~

Tsk~~~ You and me alone, then we can't learn from each other~~~ (dog head)

Guess you like

Origin blog.csdn.net/lxianshengde/article/details/125099639