Design idea of supermarket bill management system

Source: Internet
Author: User
A Design Requirements

Figure 1
Precautions:
1. Login interface should have user name and password is NOT NULL authentication, login error message prompts;
2. According to user rights, the left menu tree shows different content (ordinary users and administrators of the points), ordinary users can only modify their own account information, can not modify other user information;
3. Administrators cannot add and modify billing information, but can delete billing information;
4. Billing, suppliers and user modules have a combination of query function (fuzzy query);
5. Billing, suppliers, users and modify the password page should have the Format verification function (JS implementation);
6. Key operation should have prompt function (delete, modify, increase);
7. When browsing information table information, each function box can not be modified (lock dead);
Two Design Material Analysis
1. Front-End pages and styles have been provided:

Figure 2
respectively: Login page (login.html), the System Main page (admin_index.html: This page uses HTML frame technology, respectively by the page head (admin_top.html), page to the left (admin_left.html), the page to the right ( Actually add Admin_right page, material temporarily use admin_bill_list.html replace), Bill List page (admin_bill_list.html), Bill add page (modify.html), Vendor List page (provideradmin.html), Vendor add page (provideradd.html), user list page (useradmin.html), User add page (useradd.html).
2. Database Code Analysis:
--Create a Vendor table
CREATE TABLE Provider (--Vendor management: Provider
ProviderID Number PRIMARY Key,--
ProviderName varchar2 (,--) name of supplier
Providerdesc varchar2,--Suppliers Description
Contact VARCHAR2,--Contacts
Phone VARCHAR2,--Telephone
Address VARCHAR2 (50)--Addresses
);
--Create a user table
CREATE TABLE users (--User management: Users
UserID Number PRIMARY Key,--
UserName varchar2,--User name
UserPassword varchar2,--username password
Gender VARCHAR2 (2),--gender
Age number,--ages
Phone VARCHAR2,--Telephone
Address Varchar2 (,--)
Auth number--Permissions
);
--Create bill tables
CREATE TABLE Bill (--Billing Management: Modify
billID number primary key,--Billing No.:
Goodname varchar2,--Product Name
Goodnumber Number,--Items
Goodunit varchar2 (a),--commodity unit
Paymoney Number,--Transaction amount
Paystatus number,--Whether payment (0: No; 1: YES)
ProviderID number references provider (ProviderID),--supplier numbers foreign key
UserSID number references users (UserID),--user numbers foreign key
Gooddescription varchar2,--Product Description
Billdate Date--Billing time
);
--Create a sequence of three tables
Create sequence Sep_provider
Start with 0
MinValue 0;
Create sequence Sep_users
Start with 0
MinValue 0;
Create sequence Sep_bill
Start with 0
MinValue 0;
Create an entity class for the problem based on the actual database.
Three Design ideas
1. System framework structure of the project: MVC architecture
Models (model):
Implementation of data manipulation and business processing, its corresponding component is JavaBean, the model can provide and process data, its code can be called by other components, can achieve the purpose of code reuse.
Corresponds to the Entity,util,dao and service package in this project.
Views (view):
Displays the interface that the information interacts with the user, its corresponding component is a JSP page or an HTML file, the view generally does not handle the user's request, it only displays the data and receives the user's action.
Controller (Control):
Its function is to receive requests, call the model to implement the business, call the view to display data, and finally complete the operation.
Corresponds to the servlet in this project.
2. Writing Ideas
For this type of project, the idea of writing is clear:
(1) First, according to the database and system requirements, as far as possible to complete the model involved in the code package into, specific as follows:
Refer to the properties of the form in the database write entity classes, the property names as much as possible consistent with database table properties. This project is Bill.java,providers.java,users.java;
Because design to database operation, so need Basedao.java;
In order to realize the business operation of the system, it needs DAO class and service class, DAO class is specific to Billdao,providersdao,userdao interface implementation class, service class completes all DAO class encapsulation, call for controller.
Note: Write to complete, you should first verify that each business function is correct, to prevent the later system function debugging trouble.

Figure 3
(2) JSP page transformation
For the needs of system functions, the following JSP pages are generally required to achieve interface functions:
Login page:
login.jsp--according to Login.html
The main writing function JS login verification, login failure information display.
Login successful Main interface:
admin_index.jsp--according to Admin_index.html
The frameset element consists of admin_top.jsp (admin_top.html), admin_left.jsp (admin_left.html), and admin_right.jsp (new, welcome picture).
Note: Admin_left.jsp will be based on the user's permissions to do the corresponding display judgment.
Product Billing Action page:
bill_list.jsp--according to Admin_bill_list.html, the main implementation of the product Information list display.
bill_add.jsp--according to Modify.html, the main implementation of the product information added function (input validation by JS completion).
bill_update.jsp--New page, mainly displays the specific information of a single item (Input text box can not be edited), provide modify, delete function.
bill_doupdate.jsp--new page, the main completion of the Product modification information function (text box can be edited).
Vendor Action page:
provider_list.jsp--according to Provideradmin.html, the main implementation of the Supplier Information list display.
provider_add.jsp--according to Provideradd.html, the main implementation of the Supplier Information add function (input validation by JS completion).
provider_update.jsp--creates a new page that displays the vendor information that needs to be modified (the text box cannot be edited).
provider_doupdate.jsp--New page, complete the Change of product information (text box can be modified).
User Action page:
user_list.jap--displays a list of user information according to useradmin.html.
user_add.jsp--in accordance with the useradd.html, to achieve user-added functionality.
user_update.jsp--new page to implement a single user information display (text box can not be edited).
user_doupdate.jsp--new page to edit individual user information.
password_update.jsp--new page, modify user password function.
common.jsp--to realize the function of the page normal login judgment.
Note: The data submissions for the above pages point to the Servlet class, as follows:

Figure 4
Data operations point to the servlet file, and carry the OP parameter, the OP parameter is responsible for guiding the corresponding specific operation.
(3) Servlet writing
The servlet consists of a list of items, a vendor and a user-independent servlet, or a combination of servlet, and for complex systems, it is recommended that you write a servlet for cell module functionality.
Through different OP logo bit information, the servlet chooses different logic operation, realizes the corresponding additions and deletions through the Serviceimpl object, and completes the function on the page.

Combinatorial query Knowledge points:
SQL statement: SELECT * from provider where providername like '% query Information 1% ' and providerdesc like '% query Information 2% '; (query information can be empty)

Java Implementation method:

Figure 5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.