1. 程式人生 > >基於ssm框架技術的線上拍賣系統的設計與實現

基於ssm框架技術的線上拍賣系統的設計與實現

**基於ssm框架技術的線上拍賣系統的設計與實現**

隨著當今社會的經濟與科技的高速發展,人們的物質與文化生活首當其衝的受到了極大的影響。同時隨著資訊科技的高速發展以及網際網路應用技術的普及,交易方式也發生了翻天覆地的變化。人們已經不滿足於傳統的交易方式,線上拍賣的網路購物儼然成為了當下商品交易的重要途徑[1]

。縱觀世界來看線上拍賣已經成為了主流的消費方式,人們對與線上拍賣系統本身的關注也在日益增加,但是就形勢來說,人們對於線上拍賣系統的需求還遠遠得不到滿足。

我國在1994年正式接入網際網路,經過16年的發展,截至今年3月底,網民人數達到4.04億,網際網路普濟率達到30.2%,超過世界平均水品[2]。短短几年間,人們在網際網路上的交易比重已經遠遠超過了傳統交易所佔的比重。網際網路交易愈加受人追捧的最主要的一點是,以拍賣的形式在網上銷售產品,因為其不受時間和空間限制,並且可以有效降低運營成本而具有極大吸引力[3]

也正是因為線上拍賣的重要性,因此研究如何構建一個穩健高效的線上拍賣系統對社會的進步具有非常重要的意義[4]

。作為電子商務組成部分的線上拍賣模式,由於其充分利用了Internet的特性而開創了一個巨大的市場[5]。據瞭解,在國內去做線上拍賣系統的人是非常多的,但為什麼國內的線上交易網站的數量還是達不到人們的需求呢?通過我們的調查發現,大多數的失敗者都失敗在隱私的洩露以及交易中出現的安全問題上[6]

在網路競拍系統的研究上國外的技術始終處於相對較高的層次,美國在如今不僅帶動了像Yahoo,Amazon這類著名網站,連索斯這樣的老牌拍賣行也開始投身網路拍賣[7].現在,各種拍賣行,拍賣代理系統如eBay,Amazon.com已相繼成立[8],還有像美國密歇根大學的AuctionBot系統等[9]。但是隨著市場的擴大,使用者的增多使得對伺服器的要求越來越高,弊端也會越來越明顯[10]

    綜上所述,研究如何去設計一款成熟、安全、高效對客戶負責的線上拍賣系統是非常有挑戰性和意義的 基於ssm框架技術的線上拍賣系統的設計與實現登入註冊介面

基於ssm框架技術的線上拍賣系統的設計與實現mysql資料庫版本原始碼:

超級管理員表建立語句如下:


create table t_admin(
	id int primary key auto_increment comment '主鍵',
	username varchar(100) comment '超級管理員賬號',
	password varchar(100) comment '超級管理員密碼'
) comment '超級管理員';
insert into t_admin(username,password) values('admin','123456');

地址表建立語句如下:


create table t_address(
	id int primary key auto_increment comment '主鍵',
	customerId int comment '使用者',
	address varchar(100) comment '詳細地址',
	phone varchar(100) comment '電話',
	lxr varchar(100) comment '聯絡人'
) comment '地址';

使用者表建立語句如下:


create table t_customer(
	id int primary key auto_increment comment '主鍵',
	username varchar(100) comment '賬號',
	password varchar(100) comment '密碼',
	customerName varchar(100) comment '姓名',
	phone varchar(100) comment '電話',
	age varchar(100) comment '年齡',
	sex varchar(100) comment '性別'
) comment '使用者';

付款表建立語句如下:


create table t_fk(
	id int primary key auto_increment comment '主鍵',
	customerId int comment '使用者',
	spId int comment '商品',
	je int comment '金額',
	status varchar(100) comment '狀態'
) comment '付款';

公告表建立語句如下:


create table t_gg(
	id int primary key auto_increment comment '主鍵',
	customerId int comment '使用者',
	spId int comment '商品',
	je int comment '金額',
	showDate datetime comment '顯示日期'
) comment '公告';

拍賣表建立語句如下:


create table t_pm(
	id int primary key auto_increment comment '主鍵',
	spId int comment '商品',
	customerId int comment '使用者',
	jg int comment '競拍價'
) comment '拍賣';

商品表建立語句如下:


create table t_sp(
	id int primary key auto_increment comment '主鍵',
	title varchar(100) comment '商品',
	pic varchar(100) comment '圖片',
	content varchar(100) comment '說明',
	fee int comment '起拍價',
	status varchar(100) comment '狀態',
	customerId int comment '使用者'
) comment '商品';

基於ssm框架技術的線上拍賣系統的設計與實現oracle資料庫版本原始碼:

超級管理員表建立語句如下:


create table t_admin(
	id integer,
	username varchar(100),
	password varchar(100)
);
insert into t_admin(id,username,password) values(1,'admin','123456');
--超級管理員欄位加註釋
comment on column t_admin.id is '主鍵';
comment on column t_admin.username is '超級管理員賬號';
comment on column t_admin.password is '超級管理員密碼';
--超級管理員表加註釋
comment on table t_admin is '超級管理員';

地址表建立語句如下:


create table t_address(
	id integer,
	customerId int,
	address varchar(100),
	phone varchar(100),
	lxr varchar(100)
);
--地址欄位加註釋
comment on column t_address.id is '主鍵';
comment on column t_address.customerId is '使用者';
comment on column t_address.address is '詳細地址';
comment on column t_address.phone is '電話';
comment on column t_address.lxr is '聯絡人';
--地址表加註釋
comment on table t_address is '地址';

使用者表建立語句如下:


create table t_customer(
	id integer,
	username varchar(100),
	password varchar(100),
	customerName varchar(100),
	phone varchar(100),
	age varchar(100),
	sex varchar(100)
);
--使用者欄位加註釋
comment on column t_customer.id is '主鍵';
comment on column t_customer.username is '賬號';
comment on column t_customer.password is '密碼';
comment on column t_customer.customerName is '姓名';
comment on column t_customer.phone is '電話';
comment on column t_customer.age is '年齡';
comment on column t_customer.sex is '性別';
--使用者表加註釋
comment on table t_customer is '使用者';

付款表建立語句如下:


create table t_fk(
	id integer,
	customerId int,
	spId int,
	je int,
	status varchar(100)
);
--付款欄位加註釋
comment on column t_fk.id is '主鍵';
comment on column t_fk.customerId is '使用者';
comment on column t_fk.spId is '商品';
comment on column t_fk.je is '金額';
comment on column t_fk.status is '狀態';
--付款表加註釋
comment on table t_fk is '付款';

公告表建立語句如下:


create table t_gg(
	id integer,
	customerId int,
	spId int,
	je int,
	showDate datetime
);
--公告欄位加註釋
comment on column t_gg.id is '主鍵';
comment on column t_gg.customerId is '使用者';
comment on column t_gg.spId is '商品';
comment on column t_gg.je is '金額';
comment on column t_gg.showDate is '顯示日期';
--公告表加註釋
comment on table t_gg is '公告';

拍賣表建立語句如下:


create table t_pm(
	id integer,
	spId int,
	customerId int,
	jg int
);
--拍賣欄位加註釋
comment on column t_pm.id is '主鍵';
comment on column t_pm.spId is '商品';
comment on column t_pm.customerId is '使用者';
comment on column t_pm.jg is '競拍價';
--拍賣表加註釋
comment on table t_pm is '拍賣';

商品表建立語句如下:


create table t_sp(
	id integer,
	title varchar(100),
	pic varchar(100),
	content varchar(100),
	fee int,
	status varchar(100),
	customerId int
);
--商品欄位加註釋
comment on column t_sp.id is '主鍵';
comment on column t_sp.title is '商品';
comment on column t_sp.pic is '圖片';
comment on column t_sp.content is '說明';
comment on column t_sp.fee is '起拍價';
comment on column t_sp.status is '狀態';
comment on column t_sp.customerId is '使用者';
--商品表加註釋
comment on table t_sp is '商品';

oracle特有,對應序列如下:


create sequence s_t_address;
create sequence s_t_customer;
create sequence s_t_fk;
create sequence s_t_gg;
create sequence s_t_pm;
create sequence s_t_sp;

基於ssm框架技術的線上拍賣系統的設計與實現sqlserver資料庫版本原始碼:

超級管理員表建立語句如下:


--超級管理員
create table t_admin(
	id int identity(1,1) primary key not null,--主鍵
	username varchar(100),--超級管理員賬號
	password varchar(100)--超級管理員密碼
);
insert into t_admin(username,password) values('admin','123456');

地址表建立語句如下:


--地址表註釋
create table t_address(
	id int identity(1,1) primary key not null,--主鍵
	customerId int,--使用者
	address varchar(100),--詳細地址
	phone varchar(100),--電話
	lxr varchar(100)--聯絡人
);

使用者表建立語句如下:


--使用者表註釋
create table t_customer(
	id int identity(1,1) primary key not null,--主鍵
	username varchar(100),--賬號
	password varchar(100),--密碼
	customerName varchar(100),--姓名
	phone varchar(100),--電話
	age varchar(100),--年齡
	sex varchar(100)--性別
);

付款表建立語句如下:


--付款表註釋
create table t_fk(
	id int identity(1,1) primary key not null,--主鍵
	customerId int,--使用者
	spId int,--商品
	je int,--金額
	status varchar(100)--狀態
);

公告表建立語句如下:


--公告表註釋
create table t_gg(
	id int identity(1,1) primary key not null,--主鍵
	customerId int,--使用者
	spId int,--商品
	je int,--金額
	showDate datetime--顯示日期
);

拍賣表建立語句如下:


--拍賣表註釋
create table t_pm(
	id int identity(1,1) primary key not null,--主鍵
	spId int,--商品
	customerId int,--使用者
	jg int--競拍價
);

商品表建立語句如下:


--商品表註釋
create table t_sp(
	id int identity(1,1) primary key not null,--主鍵
	title varchar(100),--商品
	pic varchar(100),--圖片
	content varchar(100),--說明
	fee int,--起拍價
	status varchar(100),--狀態
	customerId int--使用者
);

基於ssm框架技術的線上拍賣系統的設計與實現登入後主頁

基於ssm框架技術的線上拍賣系統的設計與實現spring springMVC hibernate框架物件(javaBean,pojo)設計:

地址javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//地址
@Table(name = "t_address")
public class Address {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//詳細地址
private String address;
//電話
private String phone;
//聯絡人
private String lxr;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getAddress() {return address;}
public void setAddress(String address) {this.address = address;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getLxr() {return lxr;}
public void setLxr(String lxr) {this.lxr = lxr;}
}

使用者javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//使用者
@Table(name = "t_customer")
public class Customer {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//賬號
private String username;
//密碼
private String password;
//姓名
private String customerName;
//電話
private String phone;
//年齡
private String age;
//性別
private String sex;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
}

付款javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//付款
@Table(name = "t_fk")
public class Fk {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//商品
private Integer spId;
//金額
private Integer je;
//狀態
private String status;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public String getStatus() {return status;}
public void setStatus(String status) {this.status = status;}
}

公告javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//公告
@Table(name = "t_gg")
public class Gg {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//商品
private Integer spId;
//金額
private Integer je;
//顯示日期
private Date showDate;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public Date getShowDate() {return showDate;}
public void setShowDate(Date showDate) {this.showDate = showDate;}
}

拍賣javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//拍賣
@Table(name = "t_pm")
public class Pm {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//商品
private Integer spId;
//使用者
private Integer customerId;
//競拍價
private Integer jg;
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getJg() {return jg;}
public void setJg(Integer jg) {this.jg = jg;}
}

商品javaBean建立語句如下:


package project.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
//商品
@Table(name = "t_sp")
public class Sp {
//主鍵
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//商品
private String title;
//圖片
private String pic;
//說明
private String content;
//起拍價
private Integer fee;
//狀態
private String status;
//使用者
private Integer customerId;
public String getTitle() {return title;}
public void setTitle(String title) {this.title = title;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
public String getContent() {return content;}
public void setContent(String content) {this.content = content;}
public Integer getFee() {return fee;}
public void setFee(Integer fee) {this.fee = fee;}
public String getStatus() {return status;}
public void setStatus(String status) {this.status = status;}
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
}

基於ssm框架技術的線上拍賣系統的設計與實現spring springMVC mybatis框架物件(javaBean,pojo)設計:

地址javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//地址
public class Address  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//詳細地址
private String address;
//電話
private String phone;
//聯絡人
private String lxr;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public String getAddress() {return address;}
public void setAddress(String address) {this.address = address;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getLxr() {return lxr;}
public void setLxr(String lxr) {this.lxr = lxr;}
}

使用者javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//使用者
public class Customer  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//賬號
private String username;
//密碼
private String password;
//姓名
private String customerName;
//電話
private String phone;
//年齡
private String age;
//性別
private String sex;
public String getUsername() {return username;}
public void setUsername(String username) {this.username = username;}
public String getPassword() {return password;}
public void setPassword(String password) {this.password = password;}
public String getCustomerName() {return customerName;}
public void setCustomerName(String customerName) {this.customerName = customerName;}
public String getPhone() {return phone;}
public void setPhone(String phone) {this.phone = phone;}
public String getAge() {return age;}
public void setAge(String age) {this.age = age;}
public String getSex() {return sex;}
public void setSex(String sex) {this.sex = sex;}
}

付款javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//付款
public class Fk  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//商品
private Integer spId;
//金額
private Integer je;
//狀態
private String status;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public String getStatus() {return status;}
public void setStatus(String status) {this.status = status;}
}

公告javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//公告
public class Gg  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//使用者
private Integer customerId;
//商品
private Integer spId;
//金額
private Integer je;
//顯示日期
private Date showDate;
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getJe() {return je;}
public void setJe(Integer je) {this.je = je;}
public Date getShowDate() {return showDate;}
public void setShowDate(Date showDate) {this.showDate = showDate;}
}

拍賣javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//拍賣
public class Pm  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//商品
private Integer spId;
//使用者
private Integer customerId;
//競拍價
private Integer jg;
public Integer getSpId() {return spId;}
public void setSpId(Integer spId) {this.spId = spId;}
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
public Integer getJg() {return jg;}
public void setJg(Integer jg) {this.jg = jg;}
}

商品javaBean建立語句如下:


package project.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
//商品
public class Sp  extends BaseBean{
//主鍵
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
//商品
private String title;
//圖片
private String pic;
//說明
private String content;
//起拍價
private Integer fee;
//狀態
private String status;
//使用者
private Integer customerId;
public String getTitle() {return title;}
public void setTitle(String title) {this.title = title;}
public String getPic() {return pic;}
public void setPic(String pic) {this.pic = pic;}
public String getContent() {return content;}
public void setContent(String content) {this.content = content;}
public Integer getFee() {return fee;}
public void setFee(Integer fee) {this.fee = fee;}
public String getStatus() {return status;}
public void setStatus(String status) {this.status = status;}
public Integer getCustomerId() {return customerId;}
public void setCustomerId(Integer customerId) {this.customerId = customerId;}
}