Académique Documents
Professionnel Documents
Culture Documents
eProject Document
Shopping and Auction Online Website
Member of group
Student694973 :
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
2.2
2.3
Development Environment..........................................................................................7
3.
Usecase........................................................................................................................8
3.2.
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.
Project Plan................................................................................................................34
6.2.
Task Sheet:.................................................................................................................34
7.
Checklists........................................................................................................................35
7.1.
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
Softech - Aptech
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
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
Softech - Aptech
Shopping
and Auction Online Website
8
Softech - Aptech
Shopping
and Auction Online Website
9
Softech - Aptech
Shopping
and Auction Online Website
10
Softech - Aptech
Admin:
Shopping
and Auction Online Website
11
Softech - Aptech
Employee:
Softech - Aptech
Guest:
For Employee:
-
Null
Update Product
Actors:
Employee
Description:
Normal Flows
Preconditions:
1. Login.
Postconditions:
Special
Requirements:
Null
Shopping
and Auction Online Website
13
Softech - Aptech
1.
2.
3.
4.
5.
6.
Preconditions: 1. Login.
Postconditions: When closed Employee search for form.
Special Null
Requirements:
Shopping
and Auction Online Website
14
Softech - Aptech
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
Preconditions: 1. Login.
Postconditions: When remove success Order from system.
Special Null
Requirements:
-
Shopping
and Auction Online Website
15
Softech - Aptech
1.
2.
3.
4.
5.
6.
Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-
1.
2.
3.
4.
Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-
Shopping
and Auction Online Website
16
Softech - Aptech
1.
2.
3.
4.
Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-
1.
2.
3.
4.
5.
Preconditions: 1. Login.
Postconditions: When Admin leave this form.
Special Null
Requirements:
-
Shopping
and Auction Online Website
17
Softech - Aptech
Shopping
and Auction Online Website
18
Softech - Aptech
1.
2.
3.
4.
Shopping
and Auction Online Website
19
Softech - Aptech
For Customer:
Use case search product:
Table 3.14. Customer search product
Null
Search Product
Actors:
Customer
Description:
Normal Flows:
Preconditions:
Null
Postconditions:
Special
Requirements:
Null
Softech - Aptech
Preconditions: 1. Login.
Postconditions: When closed Customer view for form.
Special Null
Requirements:
-
Shopping
and Auction Online Website
21
Softech - Aptech
1.
2.
3.
4.
Shopping
and Auction Online Website
22
Softech - Aptech
3.2.4.
-
For Guest:
Use case Register:
Table 3.19. Guest register
1.
2.
3.
4.
Preconditions: Null
Postconditions: Null
Special Null
Requirements:
-
1.
2.
3.
4.
Preconditions: Null
Postconditions: Logout
Special Null
Requirements:
Shopping
and Auction Online Website
23
Softech - Aptech
3.3.
Activity Diagram
Login:
Shopping
and Auction Online Website
24
Softech - Aptech
Shopping
and Auction Online Website
25
Softech - Aptech
Add cart:
Class diagram
Shopping
and Auction Online Website
26
Softech - Aptech
Shopping
and Auction Online Website
27
Softech - Aptech
3.5.
Sequense diagram
Softech - Aptech
Shopping
and Auction Online Website
29
Softech - Aptech
Softech - Aptech
default
handler
is
based
on
Softech - Aptech
non-intrusiveness,
and
flexibility. Define
any
parameter
annotations
Shopping
and Auction Online Website
32
(such
as
@RequestParam,
Softech - Aptech
configuration,
to
sophisticated,
purpose-built
model
transfer.
Model
transfer
with
Shopping
and Auction Online Website
33
Softech - Aptech
library
descriptor,
see
the
appendix
rather
Spring
MVC
of
theWebApplicationContext container(s)
uses.
These
bean
scopes
are
that
described
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
ORM (Hibernate
in
short)
is
an object-relational
a framework for
an object-oriented domain
mapping
It
provides
model
to
problems
by
replacing
Shopping
and Auction Online Website
35
Softech - Aptech
Shopping
and Auction Online Website
36
Softech - Aptech
4. System Prototype
Login:
Shopping
and Auction Online Website
37
Softech - Aptech
Shopping
and Auction Online Website
38
Softech - Aptech
5. Brand
5.1. Logo
Shopping
and Auction Online Website
39
Softech - Aptech
Process
Implementers
Time
22/02/2016 04/04/2016
22/02/2016 04/04/2016
- Nguyen Khanh
22/02/2016 04/04/2016
Task
Status
Problem Definition
Complete
Nguyen Khanh
Nguyen Canh Thu
2
Database Definition
Complete
Nguyen Khanh
Nguyen Canh Thu
4
Design Interface
Complete
Nguyen Khanh
Nguyen Canh Thu
5
Template
Complete
Nguyen Khanh
Nguyen Canh Thu
6
Complete
Nguyen Khanh
7
Testing Code
19/04/2016 24/04/2016
Shopping
and Auction Online Website
40
Complete
Softech - Aptech
Nguyen Khanh
Nguyen Canh Thu
8
Complete
Nguyen Khanh
Nguyen Canh Thu
9
Ducument
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
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
Shopping
and Auction Online Website
43
Softech - Aptech
Shopping
and Auction Online Website
44
Softech - Aptech
Shopping
and Auction Online Website
45
Softech - Aptech
Shopping
and Auction Online Website
46
Softech - Aptech
Shopping
and Auction Online Website
47
Softech - Aptech
11.
Shopping
and Auction Online Website
48
Softech - Aptech
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
public Employee() {
}
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;
}
Softech - Aptech
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;
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
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