Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
OSmall
/
linjiashop
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9f0df678
authored
Jan 02, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
实体类修改
1 parent
7fa826dd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
7 deletions
doc/database-open-platform.sql
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Cart.java
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Favorite.java
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Order.java
doc/database-open-platform.sql
View file @
9f0df67
...
@@ -11,7 +11,7 @@ CREATE TABLE `t_platform_customer`
...
@@ -11,7 +11,7 @@ CREATE TABLE `t_platform_customer`
`city`
INT
(
11
)
DEFAULT
NULL
COMMENT
'城市 sys_area的id'
,
`city`
INT
(
11
)
DEFAULT
NULL
COMMENT
'城市 sys_area的id'
,
`area`
INT
(
11
)
DEFAULT
NULL
COMMENT
'区 sys_area的id'
,
`area`
INT
(
11
)
DEFAULT
NULL
COMMENT
'区 sys_area的id'
,
`address`
VARCHAR
(
128
)
DEFAULT
NULL
COMMENT
'详细地址'
,
`address`
VARCHAR
(
128
)
DEFAULT
NULL
COMMENT
'详细地址'
,
`status`
TINYINT
(
2
)
DEFAULT
NULL
COMMENT
'账号状态 0 停用 1 正常 2 待审核 3 审核未通过'
,
`status`
TINYINT
(
2
)
DEFAULT
2
COMMENT
'账号状态 0 停用 1 正常 2 待审核 3 审核未通过'
,
`key_id`
INT
(
11
)
DEFAULT
NULL
COMMENT
'秘钥 t_platform_secretkey的id'
,
`key_id`
INT
(
11
)
DEFAULT
NULL
COMMENT
'秘钥 t_platform_secretkey的id'
,
`channel_number`
VARCHAR
(
32
)
DEFAULT
NULL
COMMENT
'渠道号'
,
`channel_number`
VARCHAR
(
32
)
DEFAULT
NULL
COMMENT
'渠道号'
,
`create_time`
DATETIME
DEFAULT
NULL
COMMENT
'创建d时间'
,
`create_time`
DATETIME
DEFAULT
NULL
COMMENT
'创建d时间'
,
...
...
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Cart.java
View file @
9f0df67
...
@@ -5,6 +5,8 @@ import javax.persistence.ConstraintMode;
...
@@ -5,6 +5,8 @@ import javax.persistence.ConstraintMode;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.FetchType
;
import
javax.persistence.ForeignKey
;
import
javax.persistence.ForeignKey
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Transient
;
import
javax.persistence.Transient
;
...
@@ -21,23 +23,37 @@ import org.hibernate.annotations.Table;
...
@@ -21,23 +23,37 @@ import org.hibernate.annotations.Table;
@Table
(
appliesTo
=
"t_shop_cart"
,
comment
=
"购物车"
)
@Table
(
appliesTo
=
"t_shop_cart"
,
comment
=
"购物车"
)
@Entity
(
name
=
"t_shop_cart"
)
@Entity
(
name
=
"t_shop_cart"
)
public
class
Cart
extends
ShopBaseEntity
{
public
class
Cart
extends
ShopBaseEntity
{
@Id
@GeneratedValue
private
Long
id
;
@Column
(
name
=
"id_user"
,
columnDefinition
=
"BIGINT COMMENT '用户id'"
)
@Column
(
name
=
"id_user"
,
columnDefinition
=
"BIGINT COMMENT '用户id'"
)
private
Long
idUser
;
private
Long
idUser
;
@JoinColumn
(
name
=
"id_user"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_user"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
private
ShopUser
user
;
//private ShopUser user;
private
PlatformUser
user
;
@Column
(
name
=
"id_goods"
,
columnDefinition
=
"BIGINT COMMENT '商品id'"
)
@Column
(
name
=
"id_goods"
,
columnDefinition
=
"BIGINT COMMENT '商品id'"
)
private
Long
idGoods
;
private
Long
idGoods
;
@JoinColumn
(
name
=
"id_goods"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_goods"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
private
Goods
goods
;
private
Goods
goods
;
@Column
(
name
=
"id_sku"
,
columnDefinition
=
"BIGINT COMMENT 'skuId'"
)
@Column
(
name
=
"id_sku"
,
columnDefinition
=
"BIGINT COMMENT 'skuId'"
)
private
Long
idSku
;
private
Long
idSku
;
@JoinColumn
(
name
=
"id_sku"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_sku"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
private
GoodsSku
sku
;
private
GoodsSku
sku
;
@Column
(
columnDefinition
=
"varchar(16) COMMENT '数量'"
)
@Column
(
columnDefinition
=
"varchar(16) COMMENT '数量'"
)
private
BigDecimal
count
;
private
BigDecimal
count
;
@Transient
@Transient
private
BigDecimal
price
;
private
BigDecimal
price
;
...
@@ -49,6 +65,7 @@ public class Cart extends ShopBaseEntity {
...
@@ -49,6 +65,7 @@ public class Cart extends ShopBaseEntity {
}
}
public
String
getTitle
()
{
public
String
getTitle
()
{
return
idSku
!=
null
?
getGoods
().
getName
()
+
" "
+
getSku
().
getCodeName
()
:
getGoods
().
getName
();
return
idSku
!=
null
?
getGoods
().
getName
()
+
" "
+
getSku
().
getCodeName
()
:
getGoods
()
.
getName
();
}
}
}
}
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Favorite.java
View file @
9f0df67
...
@@ -23,7 +23,8 @@ public class Favorite extends ShopBaseEntity {
...
@@ -23,7 +23,8 @@ public class Favorite extends ShopBaseEntity {
private
Long
idUser
;
private
Long
idUser
;
@JoinColumn
(
name
=
"id_user"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_user"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
private
ShopUser
user
;
//private ShopUser user;
private
PlatformUser
user
;
@Column
(
name
=
"id_goods"
,
columnDefinition
=
"BIGINT COMMENT '商品id'"
)
@Column
(
name
=
"id_goods"
,
columnDefinition
=
"BIGINT COMMENT '商品id'"
)
private
Long
idGoods
;
private
Long
idGoods
;
@JoinColumn
(
name
=
"id_goods"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_goods"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
...
...
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/Order.java
View file @
9f0df67
...
@@ -31,7 +31,8 @@ public class Order extends ShopBaseEntity {
...
@@ -31,7 +31,8 @@ public class Order extends ShopBaseEntity {
private
Long
idUser
;
private
Long
idUser
;
@JoinColumn
(
name
=
"id_user"
,
referencedColumnName
=
"id"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@JoinColumn
(
name
=
"id_user"
,
referencedColumnName
=
"id"
,
insertable
=
false
,
updatable
=
false
,
foreignKey
=
@ForeignKey
(
name
=
"none"
,
value
=
ConstraintMode
.
NO_CONSTRAINT
))
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
private
ShopUser
user
;
//private ShopUser user;
private
PlatformUser
user
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '订单号'"
)
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '订单号'"
)
private
String
orderSn
;
private
String
orderSn
;
/**
/**
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment