Sie sind auf Seite 1von 66

Softech - Aptech

eProject Document
Shopping and Auction Online Website

eProject : Shopping and Auction Onine Website 2tShop

Member of group

Student694973 :

Tran Hoang Tuan (Leader)

Instructor

Student614415 :
Nguyen Canh Thu
Student616063 : Nguyen Khanh
Nguyen Anh Tuan

Batch

107 + 109

Semester

Shopping
and Auction Online Website
1

Softech - Aptech

CONTENTS
1.

Introduction......................................................................................................................3

2.

Problem Definition...........................................................................................................6
2.1

The Proposed System..................................................................................................6

2.2

Boundaries of the System............................................................................................6

2.3

Development Environment..........................................................................................7

3.

Analytic & design.............................................................................................................8


3.1

Usecase........................................................................................................................8

3.2.

Use case specification:...............................................................................................11

3.2.1.

For Employee:....................................................................................................11

3.2.2.

For Administrator:..............................................................................................13

3.2.3.

For Customer:.....................................................................................................18

3.2.4.

For Guest:...........................................................................................................21

3.3.

Activity Diagram.......................................................................................................22

3.4.

Class diagram............................................................................................................24

3.5.

Sequense diagram......................................................................................................25

3.6.

ERD diagram.............................................................................................................26

3.7.

System Architecture...................................................................................................27

4.

System Prototype............................................................................................................31

5.

Brand...............................................................................................................................33
5.1.

Logo...........................................................................................................................33

5.2.

Slogan........................................................................................................................33

5.3.

Color..........................................................................................................................33

5.4.

Response....................................................................................................................33

6.

Management and Project Planning..............................................................................34


6.1.

Project Plan................................................................................................................34

6.2.

Task Sheet:.................................................................................................................34

7.

Checklists........................................................................................................................35
7.1.

Check List of Validation:...........................................................................................35

7.2.

Submission Checklist:...............................................................................................36

8.

Screenshots......................................................................................................................37

9.

Code demo.......................................................................................................................44

10.

Epilogue........................................................................................................................59

Shopping
and Auction Online Website
2

Softech - Aptech
11.

References....................................................................................................................60

INDEX OF IMAGE

Image 3.1. Overall usecase............................................................................................8


Image 3.2. Admin usecase.............................................................................................9
Image 3.3. Employee usecase.....................................................................................10
Image 3.4. Customer usecase......................................................................................10
Image 3.5. Guest usecase............................................................................................11
Image 3.6. Login diagram...........................................................................................22
Image 3.7. Edit profile diagram...................................................................................22
Image 3.8. Add auction diagram.................................................................................23
Image 3.9. Admin manager diagram...........................................................................23
Image 3.10. Add cart diagram.....................................................................................24
Image 3.11. Class diagram..........................................................................................24
Image 3.12. Auction sequence diagram.......................................................................25
Image 3.13. Order sequence diagram..........................................................................25
Image 3.14. ERD Diagram..........................................................................................26
Image 3.15. System architecture.................................................................................27
Image 4.1. Login prototype.........................................................................................31
Image 4.2. Home page prototype................................................................................31
Image 4.3. Auction prototype......................................................................................32
Image 4.4. Admin page prototype...............................................................................32
Image 5.1. Logo..........................................................................................................33
Image 8.1. Add to cart.................................................................................................37
Image 8.2. Register.....................................................................................................38
Image 8.3. Login for customer....................................................................................39
Image 8.4. View Order................................................................................................39
Image 8.5. Product detail............................................................................................40
Image 8.6. Login for Admin........................................................................................41
Image 8.7. Admin panel..............................................................................................41
Image 8.8. Edit employee............................................................................................42
Image 8.9. Auction page..............................................................................................42
Shopping
and Auction Online Website
3

Softech - Aptech

Image 8.10. Auction detail..........................................................................................43


INDEX OF TABLE
Table 3.1. Employee update product...........................................................................11
Table 3.2. Employee search customer.........................................................................11
Table 3.3. Employee search order...............................................................................12
Table 3.4. Employee update order...............................................................................13
Table 3.5. Administrator remove order........................................................................13
Table 3.6. Administrator add employee.......................................................................14
Table 3.7. Administrator remove employee.................................................................14
Table 3.8. Administrator update employee..................................................................15
Table 3.9. Administrator search employee..................................................................15
Table 3.10. Administrator forgot password.................................................................16
Table 3.11. Administrator login...................................................................................16
Table 3.12. Administrator log out................................................................................17
Table 3.13. Administrator print report.........................................................................17
Table 3.14. Customer search product..........................................................................18
Table 3.15. Customer add order..................................................................................18
Table 3.16. Customer view order................................................................................19
Table 3.17. Customer view profile..............................................................................19
Table 3.18. Customer change password......................................................................20
Table 3.19. Guest register............................................................................................21
Table 3.20. Guest login...............................................................................................21
Table 5.1. Project plan.................................................................................................34
Table 5.2. Task sheet...................................................................................................34
Table 7.1. Check list of validation...............................................................................35
Table 7.2. Submission checklist..................................................................................36

Shopping
and Auction Online Website
4

Softech - Aptech

1. Introduction
Nowadays, electronic communications, electronic media, digital
technology are becoming the trend of strong growth across all fields
and all countries in the world. It also means the development and
depends a lot of the services on the Internet. In a developed society,
at the time of all people work and communicate with a single click,
or information sharing, advertising can quickly and easily found on
the Internet, etc... And so far no body can deny the usability of the
Internet, of course, must also have launched new services to take
advantage of the power of the Internet to bring utilities to the
activities of people. Therein, we cant fail to mention the ECommerce that is an e-commerce form. About the meaning and
purpose, it is very diversity.
We are pleased to give a small aspect, simple and easily
understandable to be applied in trade transactions of goods and
products online. It is a model that allows customers may know about
the products and services that a company, or an individual or
organization offer online. And that customers can order, pay and
arrange a delivery or receive the support about services from
suppliers. All such transactions are conducted online and controlled
by a Web application. Towards that problem, we have to learn about
how to build a Web application that can support user can search for
the product, certain goods on the network. Can introduce a certain
product on the internet for the purpose of buying and selling
products, creating an auction on the Internet. Forms will be
completely

different

from

number

of

services

to

provide

information about purchasing and selling the product of the certain


store or company. The transaction problem is contact, provide
products, advertise products, buy and sell products ... of those who
use the service.
Shopping
and Auction Online Website
5

Softech - Aptech

The user can give a product, with the details for the product and
the price are set at a certain price. Other users can search product
information and pay the price for that product. This session is limited
to the time the transaction by transaction creating provisions. We
will refer to these detail in the following sections.
Now, on the network around on the world also has a lot of
website that provide the services "Auctions" online. We have also
researched the mode of operation and electronic commerce. Inside,
there are websites such as: www.chodientu.vn, www.ebay.vn. This is
a Web service that allows users are able to advertise their products,
creating an environment for the exchange of product information,
purchasing and selling of products between users, and especially to
create a trading platform game direct cost a certain product is
available on the website. The sign on the product trading platform
which can be done when you become a member of the system. Of
course, the system will have mechanisms that control members,
control the transaction process so that a fair and most closely. This is
one of the new fields, containing many gaps and many things to
handle and resolve. The actual model has been used is very limited
and so our analysis will be irrational. We look forward to the
comments by the teachers and sure the next time we will add more
to complete.
2. Problem Definition
2.1 The Proposed System
The need arises to build a Website that supports for users can
post their products or can search for a certain product are
listed on the exchange. And from there, users can participate
in the auction process on the Website.

Shopping
and Auction Online Website
6

Softech - Aptech

All

these

products

will

be

stored

in

database

and

administrator can view, approve products registered.


After the end of the auction, administrator must save the detail
information on the site and close the session.
Employees can post new products, view status of their old
products on the site. Similarly, administrator can also view the
status of all the products on auction site and can also change
the priorities of the auction. The different types of auction can
be created by the administrator.
2.2 Boundaries of the System
Create a website using Spring MVC, Hibernate and MySQL
Server.
Website has a web page that contains links or optional Home,
My Account, category management, product management, bid
management, and so on.
Login page allows users to log into the system.
Allows customers can order products with the promotion policy
in the best way.
Auction page for the user a list of products auction, auction
viewing, sorting, etc.
Administration allows the user to add, edit, delete information
about auction products.
My account allows users to change account information such
as full name, password, and so on.
2.3 Development Environment
Hardware and OS Requirements:
A minimum computer system that will help you access all the tools in the
courses is a Pentium 166 or better.
64 Megabytes of RAM or better.
Software Requirements:
Windows 2000 (or higher if possible).
Java Virtual Machine.
Eclipse.
Internet Explorer 8.0 or other
GlassFish server 3.x or later.
Shopping
and Auction Online Website
7

Softech - Aptech

Tomcat server 4.x or later.


MySQL server.

Shopping
and Auction Online Website
8

Softech - Aptech

3. Analytic & design


3.1 Usecase
Overall:

Shopping
and Auction Online Website
9

Softech - Aptech

Image 3.1. Overall usecase

Shopping
and Auction Online Website
10

Softech - Aptech

Admin:

Image 3.2. Admin usecase

Shopping
and Auction Online Website
11

Softech - Aptech

Employee:

Image 3.3. Employee usecase


Customer:

Image 3.4. Customer usecase


Shopping
and Auction Online Website
12

Softech - Aptech

Guest:

Image 3.5. Guest usecase


3.2. Use case specification:
3.2.1.

For Employee:
-

Use case update product:


Table 3.1. Employee update product

Use Case ID:

Null

Use Case Name:

Update Product

Actors:

Employee

Description:

Update the product in the system.

Normal Flows

1. Employee will open the Product table will show


all the details of the product.
2. Employee will then proceed to edit the details
of the product process.
3. Employee will then click update button to
update the system and make informed
successfully updated.

Preconditions:

1. Login.

Postconditions:

When Employee confirm successful update.

Special
Requirements:

Null

Use case Search Customer:


Table 3.2. Employee search customer

Shopping
and Auction Online Website
13

Softech - Aptech

Use Case ID: Null


Use Case Name: Search Customer
Actors: Employee
Description: Search for customers in the system
Normal Flows 1. Employee will find customers in the search
form.
2. If so, returns the customers looking for.
3. If the system does not find customers need to
find the customers displays the message that
does not exist.
Preconditions: 1. Login.
Postconditions: When closed Employee search form.
Special Null
Requirements:
-

Use case Search Order:


Table 3.3. Employee search order

Use Case ID: Null


Use Case Name: Search Order
Actors: Employee
Description: Search Order from system.
Normal Flows

1.
2.
3.
4.
5.
6.

Admin login to system.


Choose Order Management.
Enter keyword into Textbox Search.
Click Search button.
If has Order return Order Information.
Else return Not Found.

Preconditions: 1. Login.
Postconditions: When closed Employee search for form.
Special Null
Requirements:

Shopping
and Auction Online Website
14

Softech - Aptech

Use case Update Order:


Table 3.4. Employee update order

Use Case ID: Null


Use Case Name: Update Order
Actors: Employee
Description: Update order to Order , Order Detail table
Normal Flows

1. Admin login to system.


2. Choose Order Management, search Order
need delete by ID, Name.
3. Click View
4. Enter information need update
5. Click Save button.

Preconditions: 1. Login.
Postconditions: Update success order to system.
Special Null
Requirements:
3.2.2.
-

For Administrator:
Use case Remove Order:
Table 3.5. Administrator remove order

Use Case ID: Null


Use Case Name: Remove Order
Actors: Admin
Description: Remove order from system.
Normal Flows

1. Admin login to system.


2. Choose Order Management, search Order
need delete by ID, Name.
3. Click View
4. Review information
5. Click Remove button.

Preconditions: 1. Login.
Postconditions: When remove success Order from system.
Special Null
Requirements:
-

Use case Add Employee:

Shopping
and Auction Online Website
15

Softech - Aptech

Table 3.6. Administrator add employee


Use Case ID: Null
Use Case Name: Add Employee
Actors: Administrator
Description: Add new Employee to system.
Normal Flows

1.
2.
3.
4.
5.
6.

Admin login to system.


Choose Employee Management.
Choose function Add New Employee.
Enter Employee information to form.
Click Add New button
Reset form.

Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-

Use case Remove Employee:


Table 3.7. Administrator remove employee

Use Case ID: Null


Use Case Name: Remove Employee
Actors: Administrator
Description: Remove Employee from system.
Normal Flows

1.
2.
3.
4.

Admin login to system.


Choose Employee Management.
Search Employee by ID, Name...
Click View button for review Employee
information.
5. Click Remove button for delete Employee
from system.
6. Reset form.

Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-

Use case Update Employee:

Shopping
and Auction Online Website
16

Softech - Aptech

Table 3.8. Administrator update employee


Use Case ID: Null
Use Case Name: Update Employee
Actors: Administrator
Description: Update Employee from system.
Normal Flows

1.
2.
3.
4.

Admin login to system.


Choose Employee Management.
Search Employee by ID, Name...
Click View button for review Employee
information.
5. Enter Employee information need update
into form.
6. Click Save button.
7. Back form view.

Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-

Use case Search Employee:


Table 3.9. Administrator search employee

Use Case ID: Null


Use Case Name: Search Employee
Actors: Administrator
Description: Search Employee from system.
Normal Flows

1.
2.
3.
4.
5.

Admin login to system.


Choose Employee Management.
Enter keyword into TextBox.
Click Search button.
Return result Employee information.

Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-

Use case Forgot Password:

Shopping
and Auction Online Website
17

Softech - Aptech

Table 3.10. Administrator forgot password


Use Case ID: Null
Use Case Name: Forgot Password.
Actors: Administrator
Description: Retrive Password for Admin on case has lose or
forgot.
Normal Flows

1. Admin click Forgot Password? Hyperlink.


2. Enter individual information for verify.
3. System show form , request enter new
password.
4. Admin enter new password and click Reset
Password button.
5. System update new password into
Employee table.
6. Return back inform reset password success.

Preconditions: 1. Information verify correct.


Postconditions: When Admin login into system.
Special Null
Requirements:
-

Use case Log in:


Table 3.11. Administrator login

Use Case ID: Null


Use Case Name: Log in System.
Actors: Administrator
Description: Admin login into system with Username (Email)
and Password.
Normal Flows

1. Admin request login.


2. System show form login and request enter
User Name and Password.
3. Admin enter information and click Log In
button.
4. System will verify Username and Password.
5. If correct login success. System show form
main for Admin.

Shopping
and Auction Online Website
18

Softech - Aptech

6. If incorrect inform Error.


Preconditions: 1. Information verify correct.
Postconditions: When Admin Login success into system.
Special Null
Requirements:
-

Use case Log out:


Table 3.12. Administrator log out

Use Case ID: Null


Use Case Name: Log out.
Actors: Administrator
Description: Admin exit from system.
Normal Flows

1. Admin will click Logout button on Menu Bar.


2. System will remove admins session working
on Program.
3. Return back form Login.

Preconditions: 1. Admin are on the system.


Postconditions: When Admin exit right from system.
Special Null
Requirements:
-

Use case Print Report:


Table 3.13. Administrator print report

Use Case ID: Null


Use Case Name: Print Report.
Actors: Administrator
Description: Print report about status sales.
Normal Flows

1.
2.
3.
4.

Admin login into system.


Enter condition for view report.
Choose start date and end date for report.
Click View Report button.

Shopping
and Auction Online Website
19

Softech - Aptech

5. System show report information for Admin.


6. Admin click Print button.
7. System change status report to Print,
choose Print Tools (pdf, .).
Preconditions: 1. Login into system.
Postconditions: Print report success. Admin leave this form.
Special Null
Requirements:
3.2.3.
-

For Customer:
Use case search product:
Table 3.14. Customer search product

Use Case ID:

Null

Use Case Name:

Search Product

Actors:

Customer

Description:

Search product in the system

Normal Flows:

1. Customer will enter the product name into the


search form.
2. Click search button.
3. Then the system will search for the product
name in the Product table.
4. If there is to return a product of the staff will
choose to see details.
5. If no notification will not find.
6. Same Customer can search by product code
and other attributes.

Preconditions:

Null

Postconditions:

When closed Customer search form.

Special
Requirements:

Null

Use case Add Order:


Table 3.15. Customer add order

Use Case ID: Null


Shopping
and Auction Online Website
20

Softech - Aptech

Use Case Name: Add Order


Actors: Customer
Description: Add orders into the system.
Normal Flows 1. Customer will enter the order details to add
order form.
2. Click the Add button to make the system add in
line.
3. The system notification form returns the add
successful order.
Preconditions: 1. Login.
Postconditions: When Customer exit the add the Order form.
Special Null
Requirements:
-

Use case View Order:


Table 3.16. Customer view order

Use Case ID: Null


Use Case Name: View Order
Actors: Customer
Description: View Order from system.
Normal Flows

7. Customer login to system.


8. Choose Order Management.
9. Click view button.
10.
If has Order return Order Information.
11.
Else return Not Found.

Preconditions: 1. Login.
Postconditions: When closed Customer view for form.
Special Null
Requirements:
-

Use case View Profile:


Table 3.17. Customer view profile

Shopping
and Auction Online Website
21

Softech - Aptech

Use Case ID: Null


Use Case Name: View Profile
Actors: Customer
Description: Customer view Profile detail
Normal Flows 4. Customer login into system.
5. Click choose Profile.
6. System show profile information respective.
Preconditions: 1. Login into system.
Postconditions: Customer leave this form.
Special Null
Requirements:
-

Use case Change Password:


Table 3.18. Customer change password

Use Case ID: Null


Use Case Name: Change Password
Actors: Customer
Description: Customer can change password for admins
account and user account
Normal Flows

1.
2.
3.
4.

Customer login into system.


Click choose Profile.
System show profile information respective.
Customer click choose Change password
link.
5. System show form request enter new
password and old password.
6. Customer click Change button for update
new password to system.

Preconditions: 1. Login into system.


Postconditions: Customer leave this form.
Special Null
Requirements:

Shopping
and Auction Online Website
22

Softech - Aptech

3.2.4.
-

For Guest:
Use case Register:
Table 3.19. Guest register

Use Case ID: Null


Use Case Name: Register
Actors: Guest
Description: Do not have an account, forgot password
Normal Flows

1.
2.
3.
4.

Guest click on the register, Hyperlink.


Enter register information
Click button register
System return successful.

Preconditions: Null
Postconditions: Null
Special Null
Requirements:
-

Use case Login:


Table 3.20. Guest login

Use Case ID: Null


Use Case Name: Login
Actors: Guest
Description: Registered accounts
Normal Flows

1.
2.
3.
4.

Guest click on the login, Hyperlink.


Enter information login
Click button login
System return login successful.

Preconditions: Null
Postconditions: Logout
Special Null
Requirements:

Shopping
and Auction Online Website
23

Softech - Aptech

3.3.
Activity Diagram
Login:

Image 3.6. Login diagram


Edit profile:

Shopping
and Auction Online Website
24

Softech - Aptech

Image 3.7. Edit profile diagram


Add Auction:

Image 3.8. Add auction diagram


Admin Manager:

Shopping
and Auction Online Website
25

Softech - Aptech

Image 3.9. Admin manager diagram

Add cart:

Image 3.10. Add cart diagram


3.4.

Class diagram

Shopping
and Auction Online Website
26

Softech - Aptech

Image 3.11. Class diagram

Shopping
and Auction Online Website
27

Softech - Aptech

3.5.

Sequense diagram

Image 3.12. Auction sequence diagram

Image 3.13. Order sequence diagram


Shopping
and Auction Online Website
28

Softech - Aptech

Shopping
and Auction Online Website
29

Softech - Aptech

3.6. ERD diagram

Image 3.14. ERD Diagram


Shopping
and Auction Online Website
30

Softech - Aptech

3.7. System Architecture

Image 3.15. System architecture


Spring MVC:
The Spring Web model-view-controller (MVC) framework is
designed around a DispatcherServlet that dispatches requests to
handlers, with configurable handler mappings, view resolution,
locale and theme resolution as well as support for uploading files.
The

default

handler

is

based

on

the @Controller and @RequestMappingannotations, offering a wide


range of flexible handling methods. With the introduction of Spring
3.0, the @Controller mechanism also allows you to create RESTful
Web sites and applications, through the @PathVariable annotation
and other features.
In Spring Web MVC you can use any object as a command or
form-backing object; you do not need to implement a frameworkspecific interface or base class. Spring's data binding is highly
flexible: for example, it treats type mismatches as validation errors
that can be evaluated by the application, not as system errors. Thus
you need not duplicate your business objects' properties as simple,
untyped strings in your form objects simply to handle invalid
Shopping
and Auction Online Website
31

Softech - Aptech

submissions, or to convert the Strings properly. Instead, it is often


preferable to bind directly to your business objects.
Spring's view resolution is extremely flexible. A Controller is
typically responsible for preparing a model Map with data and
selecting a view name but it can also write directly to the response
stream and complete the request. View name resolution is highly
configurable through file extension or Accept header content type
negotiation, through bean names, a properties file, or even a
customViewResolver implementation. The model (the M in MVC) is
a Map interface, which allows for the complete abstraction of the
view technology. You can integrate directly with template based
rendering technologies such as JSP, Velocity and Freemarker, or
directly generate XML, JSON, Atom, and many other types of
content. The model Map is simply transformed into an appropriate
format, such as JSP request attributes, a Velocity template model.
Spring's web module includes many unique web support
features:
Clear separation of roles. Each role controller, validator,
command object, form object, model object, DispatcherServlet,
handler mapping, view resolver, and so on can be fulfilled by
a specialized object.
Powerful and straightforward configuration of both framework
and application classes as JavaBeans. This configuration
capability includes easy referencing across contexts, such as
from web controllers to business objects and validators.
Adaptability,

non-intrusiveness,

and

flexibility. Define

any

controller method signature you need, possibly using one of


the

parameter

annotations

Shopping
and Auction Online Website
32

(such

as

@RequestParam,

Softech - Aptech

@RequestHeader, @PathVariable, and more) for a given


scenario.
Reusable business code, no need for duplication. Use existing
business objects as command or form objects instead of
mirroring them to extend a particular framework base class.
Customizable binding and validation. Type mismatches as
application-level validation errors that keep the offending
value, localized date and number binding, and so on instead of
String-only form objects with manual parsing and conversion to
business objects.
Customizable handler mapping and view resolution. Handler
mapping and view resolution strategies range from simple
URL-based

configuration,

to

sophisticated,

purpose-built

resolution strategies. Spring is more flexible than web MVC


frameworks that mandate a particular technique.
Flexible

model

transfer.

Model

transfer

with

name/value Map supports easy integration with any view


technology.
Customizable locale and theme resolution, support for JSPs
with or without Spring tag library, support for JSTL, support for
Velocity without the need for extra bridges, and so on.
A simple yet powerful JSP tag library known as the Spring tag
library that provides support for features such as data binding
and themes. The custom tags allow for maximum flexibility in
terms of markup code. For information on the tag library
descriptor, see the appendix entitled Appendix G, spring.tld.

Shopping
and Auction Online Website
33

Softech - Aptech

A JSP form tag library, introduced in Spring 2.0, that makes


writing forms in JSP pages much easier. For information on the
tag

library

descriptor,

see

the

appendix

entitled Appendix H, spring-form.tld.


Beans whose lifecycle is scoped to the current HTTP request or
HTTP Session. This is not a specific feature of Spring MVC itself,
but

rather

Spring

MVC

of

theWebApplicationContext container(s)

uses.

These

bean

scopes

are

that

described

in Section 5.5.4, Request, session, and global session scopes.


My SQL:
MySQL is the world's most popular open source database. With
its proven performance, reliability and ease-of-use, MySQL has
become the leading database choice for web-based applications,
used by high profile web properties including Facebook, Twitter,
YouTube, Yahoo! and many more.
Oracle drives MySQL innovation, delivering new capabilities to
power

next

generation

web,

cloud,

mobile

and

embedded

applications.
MySQL is a fast, easy-to-use RDBMS being used for many small
and big businesses. MySQL is developed, marketed, and supported
by MySQL AB, which is a Swedish company. MySQL is becoming so
popular because of many good reasons:
MySQL is released under an open-source license. So you have
nothing to pay to use it.
MySQL is a very powerful program in its own right. It handles a
large subset of the functionality of the most expensive and
powerful database packages.
Shopping
and Auction Online Website
34

Softech - Aptech

MySQL uses a standard form of the well-known SQL data


language.
MySQL works on many operating systems and with many
languages including PHP, PERL, C, C++, JAVA, etc.
MySQL works very quickly and works well even with large data
sets.
MySQL is very friendly to PHP, the most appreciated language
for web development.
MySQL supports large databases, up to 50 million rows or
more in a table. The default file size limit for a table is 4GB,
but you can increase this (if your operating system can handle
it) to a theoretical limit of 8 million terabytes (TB).
MySQL is customizable. The open-source GPL license allows
programmers to modify the MySQL software to fit their own
specific environments.
Hibernate:
Hibernate

ORM (Hibernate

in

short)

is

an object-relational

mapping framework for

the Java language.

a framework for

an object-oriented domain

mapping

It

provides
model

to

a relational database. Hibernate solves object-relational impedance


mismatch

problems

by

replacing

direct, persistent database

accesses with high-level object handling functions.


Hibernate's primary feature is mapping from Java classes
to database tables; and mapping from Java data types to SQL data
types. Hibernate also provides data query and retrieval facilities. It

Shopping
and Auction Online Website
35

Softech - Aptech

generates SQL calls and relieves the developer from manual


handling and object conversion of the result set.

Shopping
and Auction Online Website
36

Softech - Aptech

4. System Prototype
Login:

Image 4.1. Login prototype


Home page:

Shopping
and Auction Online Website
37

Softech - Aptech

Image 4.2. Home page prototype


Auction:

Image 4.3. Auction prototype


Admin page:

Image 4.4. Admin page prototype

Shopping
and Auction Online Website
38

Softech - Aptech

5. Brand
5.1. Logo

Image 5.1. Logo


5.2.
Slogan
Brings new style to you
5.3.
Color
Color code: - white (255,255,255)
- red (255,0,0)
- yellow (255,255,0)
5.4.
Response
Towards a society with new styles, we take your brand is "The Time". It makes
sense that an era of old and new blend, giving people new styles but never outdated.
The term "The Time" with white and incredibly simple font represents the simple but
high quality. Logo accompanied 2T hexagon with stylized letters inside. A classic
style but modern blend.
We do not want customers to become cramped when using the products that we
offer. We look forward to bringing our customers the new style, elegant and
charismatic than communicating with people.
Please use our products to feel the quality of service that we are offering.

Shopping
and Auction Online Website
39

Softech - Aptech

6. Management and Project Planning


6.1. Project Plan
Table 5.1. Project plan
No.

Process

Implementers

Time

Model, Spri & Database

- Tran Hoang Tuan

22/02/2016 04/04/2016

Model, Spri & Database

- Nguyen Canh Thu

22/02/2016 04/04/2016

Model, Spri & Database

- Nguyen Khanh

22/02/2016 04/04/2016

6.2. Task Sheet:


Table 5.2. Task sheet
Project Ref. No.:
No.

Task

Date of Preparation of Activity Plan :


Actual Start
Actual Days
Date

Team Member Names

Status

Nguyen Canh Thu


1

Problem Definition

22/02/2016 26/02/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
Nguyen Canh Thu
2

Database Definition

28/02/2015 05/03/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
Nguyen Canh Thu
4

Design Interface

06/03/2016 10/03/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
Nguyen Canh Thu
5

Template

11/03/2016 18/03/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
Nguyen Canh Thu
6

Model & Springs

18/03/2016 18/04/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
7

Testing Code

19/04/2016 24/04/2016

Nguyen Canh Thu


Tran Hoang Tuan

Shopping
and Auction Online Website
40

Complete

Softech - Aptech

Nguyen Khanh
Nguyen Canh Thu
8

Check Out Website

25/04/2016 27/04/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
Nguyen Canh Thu
9

Ducument

22/02/2016 03/05/2016 Tran Hoang Tuan

Complete

Nguyen Khanh
7. Checklists
7.1. Check List of Validation:
Table 7.1. Check list of validation
No.
1
2
3
4
5
6
7
8

Validation
Fields in forms should not be null
Paging in all info
Fields in forms should be input correct format
The site name for publishing is unique
All the program codes working
All pages have some either forward link or to the Home page
Export Report statistic
100 Request at orders time

Shopping
and Auction Online Website
41

Status
Active
Active
Active
Active
Active
Active
Not active
Active

Softech - Aptech

7.2. Submission Checklist:


Table 7.2. Submission checklist
No
Particular
.
1 Do all the web pages open?
2 Are all hyperlinks working?
3 Are the web page contents devoid

Yes

Na

x
x
x

of spelling mistakes?
Are the page colors are per

5
6

common guidelines?
Are all web components working?
Is the site browser compatible?

x
x

Shopping
and Auction Online Website
42

No

Comment

Softech - Aptech

8. Screenshots

Image 8.1. Add to cart

Shopping
and Auction Online Website
43

Softech - Aptech

Image 8.2. Register

Shopping
and Auction Online Website
44

Softech - Aptech

Image 8.3. Login for customer

Image 8.4. View Order

Shopping
and Auction Online Website
45

Softech - Aptech

Image 8.5. Product detail


9.

Shopping
and Auction Online Website
46

Softech - Aptech

Image 8.6. Login for Admin

Image 8.7. Admin panel


10.

Shopping
and Auction Online Website
47

Softech - Aptech

Image 8.8. Edit employee

Image 8.9. Auction page

11.

Shopping
and Auction Online Website
48

Softech - Aptech

Image 8.10. Auction detail

Shopping
and Auction Online Website
49

Softech - Aptech

9. Code demo
- Model:
package com.softech.batch107.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;

/**
* The persistent class for the employees database table.
*
*/
@Entity
@Table(name="employees")
@NamedQuery(name="Employee.findAll", query="SELECT e FROM Employee e")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int employeeID;

@Lob
private String address;
@Lob
private String dob;
@Lob
Shopping
and Auction Online Website
50

Softech - Aptech

private String email;


@Lob
private String fullName;
@Lob
private String image;
@Lob
private String password;
private String phone;
private String sex;
private byte status;

//bi-directional many-to-one association to Auction


@OneToMany(mappedBy="employee", fetch=FetchType.EAGER)
private List<Auction> auctions;

//bi-directional many-to-one association to Role


@ManyToOne
@JoinColumn(name="RoleID")
private Role role;

//bi-directional many-to-one association to Order


@OneToMany(mappedBy="employee", fetch=FetchType.EAGER)
private List<Order> orders;

public Employee() {
}

public int getEmployeeID() {


return this.employeeID;
Shopping
and Auction Online Website
51

Softech - Aptech

}
public void setEmployeeID(int employeeID) {
this.employeeID = employeeID;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDob() {
return this.dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFullName() {
return this.fullName;
}

public void setFullName(String fullName) {


this.fullName = fullName;
}
Shopping
and Auction Online Website
52

Softech - Aptech

public String getImage() {


return this.image;
}
public void setImage(String image) {
this.image = image;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSex() {
return this.sex;
}
public void setSex(String sex) {
this.sex = sex;
}

public byte getStatus() {


return this.status;
}
public void setStatus(byte status) {
Shopping
and Auction Online Website
53

Softech - Aptech

this.status = status;
}
public List<Auction> getAuctions() {
return this.auctions;
}
public void setAuctions(List<Auction> auctions) {
this.auctions = auctions;
}
public Auction addAuction(Auction auction) {
getAuctions().add(auction);
auction.setEmployee(this);
return auction;
}
public Auction removeAuction(Auction auction) {
getAuctions().remove(auction);
auction.setEmployee(null);
return auction;
}
public Role getRole() {
return this.role;
}
public void setRole(Role role) {
this.role = role;
}
public List<Order> getOrders() {
return this.orders;
}
public void setOrders(List<Order> orders) {
this.orders = orders;
Shopping
and Auction Online Website
54

Softech - Aptech

}
public Order addOrder(Order order) {
getOrders().add(order);
order.setEmployee(this);
return order;
}
public Order removeOrder(Order order) {
getOrders().remove(order);
order.setEmployee(null);
return order;
}
}
-

DAO:

package com.softech.batch107.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import com.softech.batch107.model.Employee;

public interface EmployeeDAO extends JpaRepository<Employee, Integer>{


public Employee findByEmail(@Param("email") String email);

public Employee findByEmailAndPasswordAndStatus(@Param("email")


String email, @Param("password") String password, @Param("status") byte status);
}
-

Controller:

package com.softech.batch107.controller;

import java.util.List;
Shopping
and Auction Online Website
55

Softech - Aptech

import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.softech.batch107.dao.EmployeeDAO;
import com.softech.batch107.dao.RoleDAO;
import com.softech.batch107.model.Employee;
import com.softech.batch107.model.Role;

@Controller
public class EmployeeController {
@Autowired
EmployeeDAO employeeDAO;
@Autowired
RoleDAO roleDAO;
ModelAndView mv = new ModelAndView();
public List<Employee> listEmp;
public List<Role> listRole;

//GET ALL
@RequestMapping(value = "/employee", method = RequestMethod.GET)
public ModelAndView showAll(){
Shopping
and Auction Online Website
56

Softech - Aptech

try {
listEmp = employeeDAO.findAll();
mv.addObject("listEmp", listEmp);
mv.addObject("page", "employee.jsp");
} catch (Exception e) {
e.printStackTrace();
}
mv.setViewName("index");
return mv;
}

//SEARCH
@RequestMapping(value = "/employee", method = RequestMethod.POST)
public ModelAndView searchEmail(@RequestParam String txtSearch) {
if (txtSearch.equals("")) {
showAll();
} else {
mv.clear();
search(txtSearch);
}
mv.addObject("page", "employee.jsp");
mv.setViewName("index");
return mv;
}

//REMOVE
@RequestMapping(value = "/employee/remove", method =
RequestMethod.POST)
public ModelAndView removeEmployee(@RequestParam("emp") int
employeeID){
Shopping
and Auction Online Website
57

Softech - Aptech

Employee emp = employeeDAO.getOne(employeeID);


employeeDAO.delete(emp);
mv.setViewName("redirect:/employee");
return mv;
}

//SHOW EDIT PAGE


@RequestMapping(value = "/emp-edit/{emp}", method =
RequestMethod.GET)
public ModelAndView redirectToEmployeeEdit(Model model,
@PathVariable("emp") int employeeId) {
try {
Employee employee = employeeDAO.findOne(employeeId);
listRole = roleDAO.findAll();
mv.addObject("employee", employee);
mv.addObject("listRole",listRole);
mv.addObject("page", "employee-edit.jsp");
mv.setViewName("index");
} catch (Exception e) {
e.printStackTrace();
}
return mv;
}
//SHOW CREATE PAGE
@RequestMapping(value = "/emp-create", method =
RequestMethod.GET)
public ModelAndView redirectToCustomerCreate() {
try {
mv.addObject("page", "employee-create.jsp");
listRole = roleDAO.findAll();
Shopping
and Auction Online Website
58

Softech - Aptech

mv.addObject("listRole",listRole);
mv.setViewName("index");
} catch (Exception e) {
e.printStackTrace();
}
return mv;
}

//CREATE
@RequestMapping(value = "/emp-create/new", method =
RequestMethod.POST)
public ModelAndView createEmployee(@RequestParam String
fullName, @RequestParam String email, @RequestParam String password,
@RequestParam String dob,@RequestParam String sex,@RequestParam String
phone,@RequestParam String address, @RequestParam String
image,@RequestParam String roleID, @RequestParam String status, HttpSession
session, Model model) {
Employee employee = employeeDAO.findByEmail(email);
if (employee == null) {
Role role = new Role();
role.setRoleID(Integer.parseInt(roleID));
employee = new Employee();
employee.setFullName(fullName);
employee.setEmail(email);
employee.setPassword(password);
employee.setDob(dob);
employee.setSex(sex);
employee.setPhone(phone);
employee.setAddress(address);
employee.setImage(image);
employee.setRole(role);
Shopping
and Auction Online Website
59

Softech - Aptech

employee.setStatus(Byte.parseByte(status));
employeeDAO.save(employee);
showAll();
mv.setViewName("redirect:/employee");
} else {
mv.addObject("page","employee-create.jsp");
model.addAttribute("create", "Email da ton tai");
mv.setViewName("redirect:/emp-create");
}
return mv;
}
//EDIT
@RequestMapping(value = "/emp-edit/{employeeId}", method =
RequestMethod.POST)
public ModelAndView editEmloyee(Model model,
@PathVariable("employeeId") int employeeId,
@ModelAttribute("employee") Employee employee) {
try {
employeeDAO.save(employee);
model.addAttribute("employee", employee);
showAll();
} catch (Exception e) {
e.printStackTrace();
}
mv.setViewName("redirect:/employee");
return mv;
}

//SEARCH FUNCTION
public ModelAndView search(String email) {
Shopping
and Auction Online Website
60

Softech - Aptech

try {
Employee temp = employeeDAO.findByEmail(email);
if (temp != null) {
listEmp.clear();
listEmp.add(temp);
mv.addObject("listEmp", listEmp);
}
else{
mv.clear();
}
} catch (Exception e) {
e.printStackTrace();
}
return mv;
}
}
-

JSP:
<%@ page language="java" contentType="text/html;
charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c"%>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1">
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/cs
s/bootstrap.min.css">
<!-<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.
0/jquery.min.js"></script>
<script

Shopping
and Auction Online Website
61

Softech - Aptech

src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/
bootstrap.min.js"></script>
-->
</head>
<body>
<div class="container">
<form class="form-inline" role="form"
action="employee" method="post">
<div class="form-group">
<label class="sr-only"
for="email">Email:</label> <input
type="email" name="txtSearch"
class="form-control" id="email"
placeholder="Enter email"
style="height: 34px">
</div>
<button type="submit" class="btn btndefault">Search</button>
</form>
</div>
<form action="emp-create" method="GET">
<button type="submit"
value="Create New" class="btn btnprimary">Create</button>
</form>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Full Name</th>
<th>DOB</th>
<th>Sex</th>
<th>Email</th>
<th>Password</th>
<th>Phone</th>
<th>Address</th>
<th>Image</th>
<th>Role</th>
<th>Status</th>
<th>Edit</th>
<th>Delete</th>
</tr>
Shopping
and Auction Online Website
62

Softech - Aptech

</thead>
<tbody>
<c:forEach var="emp" items="${listEmp}">
<tr>
<td><c:out value="$
{emp.getEmployeeID()}"></c:out></td>
<td><c:out value="$
{emp.getFullName()}"></c:out></td>
<td><c:out value="$
{emp.getDob()}"></c:out></td>
<td>
<c:choose>
<%-- <c:out value="$
{cus.getSex() }"></c:out> --%>
<c:when test="$
{emp.getSex() == '1' }"><p>Male</p></c:when>
<c:when test="$
{emp.getSex() == '0' }"><p>Female</p></c:when>
</c:choose>
</td>
<td><c:out value="$
{emp.getEmail()}"></c:out></td>
<td><c:out value="$
{emp.getPassword()}"></c:out></td>
<td><c:out value="$
{emp.getPhone()}"></c:out></td>
<td><c:out value="$
{emp.getAddress()}"></c:out></td>
<td><c:out value="$
{emp.getImage()}"></c:out></td>
<td>
<c:out value="$
{emp.getRole().getRoleName()}"></c:out>
</td>
<td>
<c:choose>
<%-- <c:out value="$
{cus.getSex() }"></c:out> --%>
<c:when test="$
{emp.getStatus() == 1 }"><p style="color: red; fontweight: bold;">Off</p></c:when>
<c:when test="$
{emp.getStatus() == 0 }"><p style="color: green; fontweight: bold;">On</p></c:when>
</c:choose>
</td>
<td>
Shopping
and Auction Online Website
63

Softech - Aptech

<form action="emp-edit/$
{emp.getEmployeeID()}" method="GET">
<input id="emp"
name="emp" type="hidden"
value="$
{emp.getEmployeeID()}" />
<button type="submit"
value="edit"><span class="glyphicon glyphicon-pencil"
aria-hidden="true"></span></button>
</form>
</td>
<td><c:url var="deleteUrl"
value="/employee/remove" />
<form action="${deleteUrl}"
method="POST">
<input id="emp"
name="emp" type="hidden"
value="$
{emp.getEmployeeID()}" />
value="delete" class=""

<button type="submit"

onClick="return
confirm('Bn c chc chn mun xo nhn vin
ny?')"><span class="glyphicon glyphicon-trash" ariahidden="true"></span></button>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>
-

Shopping
and Auction Online Website
64

</form></td>

Softech - Aptech

10.
Epilogue
After this project, we have learned a lot of skills and valuable experience for
themselves. Moreover, we have been cultivating the soft skills such as problemsolving skills, teamwork skills, skills to work independently ... In particular, we have
to look for new research and applications the current number of new technologies
such as Spring MVC, Hibernate, MySQL in addition to the basic technology has been
learned. Hopefully, this knowledge will be applied we thoroughly for actual work later
in the business of information technology today.
In addition, we also learn the knowledge of the software production process, the
following steps to make sure that we will see the reality. We think it will help us to
have faster access to the job later when applied in practice.
With a project online sales system, we think it appropriate in the current period
when e-commerce is booming. When the quality of life of people increases, the
demand for the high caliber of our trade will be simplified, optimized through the
internet. And this project has helped us to have a better insight about the current state
of internet technology.
During his time as blueprints, certainly will not avoid the shortcomings, we look
forward to receiving your suggestions for teachers as well as teacher center guide our
projects. Thereby, we will continue to improve further when entering a new working
environment.
We would like to thank to Mr. Nguyen Anh Tuan has created all conditions for
the help and support of knowledge for us to be able to carry out this project. In the
recent past, will surely be flawed, he respectfully omitted.
And we also would like to thank to the training center of international
programmers Softech - Aptech has created all conditions for us complete projects in a
good way.
Again, we sincerely thank you.

Shopping
and Auction Online Website
65

Softech - Aptech

11.
References
- https://spring.io/
-

www.tutorialspoint.com

http://hibernate.org/

https://www.mysql.com/

Shopping
and Auction Online Website
66

Das könnte Ihnen auch gefallen