Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
d50393e9
Commit
d50393e9
authored
Nov 16, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f78738f8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
6 deletions
+47
-6
MallOrderPayServiceImpl.java
.../application/order/mall/impl/MallOrderPayServiceImpl.java
+1
-1
CustomerBalanceServiceImpl.java
...cation/user/customer/impl/CustomerBalanceServiceImpl.java
+16
-4
DiscountConfig.java
...ava/com/gogirl/domain/market/discount/DiscountConfig.java
+9
-0
CustomerBalance.java
...java/com/gogirl/domain/user/customer/CustomerBalance.java
+18
-0
ErrorCode.java
...com/gogirl/infrastructure/common/exception/ErrorCode.java
+2
-0
ConsumerCommand.java
src/main/java/com/gogirl/shared/user/ConsumerCommand.java
+1
-1
No files found.
src/main/java/com/gogirl/application/order/mall/impl/MallOrderPayServiceImpl.java
View file @
d50393e9
...
@@ -235,7 +235,7 @@ public class MallOrderPayServiceImpl implements MallOrderPayService {
...
@@ -235,7 +235,7 @@ public class MallOrderPayServiceImpl implements MallOrderPayService {
.
orderId
(
mallOrder
.
getId
())
.
orderId
(
mallOrder
.
getId
())
.
orderStatus
(
mallOrder
.
getStatus
())
.
orderStatus
(
mallOrder
.
getStatus
())
.
brandId
(
mallOrder
.
getBrandId
())
.
brandId
(
mallOrder
.
getBrandId
())
.
type
(
3
)
//商城订单
.
type
(
7
)
//商城订单
.
build
();
.
build
();
customerBalanceService
.
consumer
(
consumerCmd
);
customerBalanceService
.
consumer
(
consumerCmd
);
...
...
src/main/java/com/gogirl/application/user/customer/impl/CustomerBalanceServiceImpl.java
View file @
d50393e9
...
@@ -26,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -26,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -76,6 +73,21 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
...
@@ -76,6 +73,21 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
if
(
customerBalance
.
getBalance
()
<
cmd
.
getAmount
())
{
if
(
customerBalance
.
getBalance
()
<
cmd
.
getAmount
())
{
throw
new
RRException
(
ErrorCode
.
CS_2002
);
throw
new
RRException
(
ErrorCode
.
CS_2002
);
}
}
//这笔记录来自于哪里:1:充值,2:首次充值,-1:订单扣款.3:充送 4-余额迁入5-余额迁出6-次卡扣款7-商城扣款
switch
(
cmd
.
getType
()){
case
-
1
:
if
(!
customerBalance
.
getServePayAtBalance
())
throw
new
RRException
(
ErrorCode
.
ER_2009
);
break
;
case
6
:
if
(!
customerBalance
.
getTimesCardPayAtBalance
())
throw
new
RRException
(
ErrorCode
.
ER_2009
);
break
;
case
7
:
if
(!
customerBalance
.
getProductPayAtBalance
())
throw
new
RRException
(
ErrorCode
.
ER_2009
);
break
;
}
//余额支付
//余额支付
CustomerBalanceRecord
record
=
CustomerBalanceRecord
CustomerBalanceRecord
record
=
CustomerBalanceRecord
...
...
src/main/java/com/gogirl/domain/market/discount/DiscountConfig.java
View file @
d50393e9
...
@@ -52,4 +52,13 @@ public class DiscountConfig implements Serializable {
...
@@ -52,4 +52,13 @@ public class DiscountConfig implements Serializable {
@ApiModelProperty
(
"商城产品是否按现价打折,DACP discount at current price"
)
@ApiModelProperty
(
"商城产品是否按现价打折,DACP discount at current price"
)
private
Boolean
productDacp
;
private
Boolean
productDacp
;
@ApiModelProperty
(
"服务是否可用余额支付"
)
private
Boolean
servePayAtBalance
;
@ApiModelProperty
(
"产品是否可用余额支付"
)
private
Boolean
productPayAtBalance
;
@ApiModelProperty
(
"次卡是否可用余额支付"
)
private
Boolean
timesCardPayAtBalance
;
}
}
src/main/java/com/gogirl/domain/user/customer/CustomerBalance.java
View file @
d50393e9
...
@@ -75,6 +75,15 @@ public class CustomerBalance implements Serializable {
...
@@ -75,6 +75,15 @@ public class CustomerBalance implements Serializable {
@ApiModelProperty
(
"商城产品是否按现价打折,DACP discount at current price"
)
@ApiModelProperty
(
"商城产品是否按现价打折,DACP discount at current price"
)
private
Boolean
productDacp
;
private
Boolean
productDacp
;
@ApiModelProperty
(
"服务是否可用余额支付"
)
private
Boolean
servePayAtBalance
;
@ApiModelProperty
(
"产品是否可用余额支付"
)
private
Boolean
productPayAtBalance
;
@ApiModelProperty
(
"次卡是否可用余额支付"
)
private
Boolean
timesCardPayAtBalance
;
public
CustomerBalance
(
Integer
customerId
,
public
CustomerBalance
(
Integer
customerId
,
Integer
balance
,
Integer
balance
,
Date
firstChargeTime
,
Date
firstChargeTime
,
...
@@ -95,6 +104,9 @@ public class CustomerBalance implements Serializable {
...
@@ -95,6 +104,9 @@ public class CustomerBalance implements Serializable {
this
.
totalBestow
=
totalBestow
;
this
.
totalBestow
=
totalBestow
;
this
.
level
=
level
;
this
.
level
=
level
;
this
.
setDiscount
(
discountRate
);
this
.
setDiscount
(
discountRate
);
this
.
servePayAtBalance
=
false
;
this
.
productPayAtBalance
=
false
;
this
.
timesCardPayAtBalance
=
false
;
}
}
public
CustomerBalance
()
{
public
CustomerBalance
()
{
...
@@ -110,6 +122,9 @@ public class CustomerBalance implements Serializable {
...
@@ -110,6 +122,9 @@ public class CustomerBalance implements Serializable {
this
.
currentDiscount
=
discountRate
.
multiply
(
new
BigDecimal
(
"10"
));
this
.
currentDiscount
=
discountRate
.
multiply
(
new
BigDecimal
(
"10"
));
this
.
serveDacp
=
config
.
getServeDacp
();
this
.
serveDacp
=
config
.
getServeDacp
();
this
.
productDacp
=
config
.
getProductDacp
();
this
.
productDacp
=
config
.
getProductDacp
();
this
.
servePayAtBalance
=
config
.
getServePayAtBalance
();
this
.
productPayAtBalance
=
config
.
getProductPayAtBalance
();
this
.
timesCardPayAtBalance
=
config
.
getTimesCardPayAtBalance
();
}
}
/**
/**
...
@@ -136,6 +151,9 @@ public class CustomerBalance implements Serializable {
...
@@ -136,6 +151,9 @@ public class CustomerBalance implements Serializable {
.
version
(
1
)
.
version
(
1
)
.
updateTime
(
new
Date
())
.
updateTime
(
new
Date
())
.
brandId
(
brandId
)
.
brandId
(
brandId
)
.
servePayAtBalance
(
false
)
.
productPayAtBalance
(
false
)
.
timesCardPayAtBalance
(
false
)
.
build
();
.
build
();
customerBalance
.
setDiscount
(
new
BigDecimal
(
"1"
));
customerBalance
.
setDiscount
(
new
BigDecimal
(
"1"
));
return
customerBalance
;
return
customerBalance
;
...
...
src/main/java/com/gogirl/infrastructure/common/exception/ErrorCode.java
View file @
d50393e9
...
@@ -23,6 +23,8 @@ public enum ErrorCode {
...
@@ -23,6 +23,8 @@ public enum ErrorCode {
ER_2007
(
2007
,
"代理余额不足"
),
ER_2007
(
2007
,
"代理余额不足"
),
ER_2008
(
2008
,
"代理商不明确"
),
ER_2008
(
2008
,
"代理商不明确"
),
ER_2009
(
2009
,
"不可使用余额支付"
)
;
;
private
Integer
code
;
private
Integer
code
;
...
...
src/main/java/com/gogirl/shared/user/ConsumerCommand.java
View file @
d50393e9
...
@@ -28,6 +28,6 @@ public class ConsumerCommand {
...
@@ -28,6 +28,6 @@ public class ConsumerCommand {
@ApiModelProperty
(
"品牌ID"
)
@ApiModelProperty
(
"品牌ID"
)
private
Integer
brandId
;
private
Integer
brandId
;
@ApiModelProperty
(
"这笔记录来自于哪里:1:充值,2:首次充值,-1:订单扣款.3:充送 4-余额迁入5-余额迁出6-次卡扣款"
)
@ApiModelProperty
(
"这笔记录来自于哪里:1:充值,2:首次充值,-1:订单扣款.3:充送 4-余额迁入5-余额迁出6-次卡扣款
7-商城扣款
"
)
private
Integer
type
=
-
1
;
private
Integer
type
=
-
1
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment