Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
f3807904
Commit
f3807904
authored
Jun 05, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分抵扣规则,新增是否与促销和优惠券同享
parent
c98028b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
+17
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
View file @
f3807904
...
@@ -14,7 +14,7 @@ import cn.freemud.service.thirdparty.CustomScoreClient;
...
@@ -14,7 +14,7 @@ import cn.freemud.service.thirdparty.CustomScoreClient;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
com.freemud.application.sdk.api.constant.FMStatusCode
;
import
com.freemud.application.sdk.api.constant.FMStatusCode
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
org.apache.commons.lang.
Object
Utils
;
import
org.apache.commons.lang.
String
Utils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -65,9 +65,21 @@ public class CustomerScoreService implements IPromotionService {
...
@@ -65,9 +65,21 @@ public class CustomerScoreService implements IPromotionService {
customerScoreVo
.
setCurrentScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()));
customerScoreVo
.
setCurrentScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()));
customerScoreVo
.
setReduceAmount
(
getValue
(
userScoreUseDetail
.
getResult
().
getReduceAmount
()));
customerScoreVo
.
setReduceAmount
(
getValue
(
userScoreUseDetail
.
getResult
().
getReduceAmount
()));
customerScoreVo
.
setReducePriceLimit
(
getValue
(
userScoreUseDetail
.
getResult
().
getReducePriceLimit
()));
customerScoreVo
.
setReducePriceLimit
(
getValue
(
userScoreUseDetail
.
getResult
().
getReducePriceLimit
()));
customerScoreVo
.
setScoreReduceState
(
userScoreUseDetail
.
getResult
().
getScoreState
());
// 是否可优惠同享{0所有订单均可抵扣,1仅限原价订单才可抵扣(享受了促销活动、或使用了优惠券,不能进行积分抵扣
if
(
userScoreUseDetail
.
getResult
().
getOverlayOffers
()
==
0
)
{
customerScoreVo
.
setScoreReduceState
(
userScoreUseDetail
.
getResult
().
getScoreState
());
}
else
{
if
(
StringUtils
.
isNotBlank
(
shoppingCartInfoRequestVo
.
getCouponCode
())
||
calculationDiscountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
)
{
//积分抵扣开关禁用
customerScoreVo
.
setScoreReduceState
(
3
);
discountAmount
=
0
;
}
}
customerScoreVo
.
setUseScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()));
customerScoreVo
.
setUseScore
(
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()));
String
msg
=
""
;
String
msg
=
""
;
// 积分抵扣状态 1积分可用 2积分不足 3 积分抵扣开关禁用 4、订单金额不满足开启积分抵现要求
switch
(
userScoreUseDetail
.
getResult
().
getScoreState
())
{
switch
(
userScoreUseDetail
.
getResult
().
getScoreState
())
{
case
1
:
case
1
:
msg
=
String
.
format
(
"共%s积分,可用%s积分抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReduceAmount
())
/
100
);
msg
=
String
.
format
(
"共%s积分,可用%s积分抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
getValue
(
userScoreUseDetail
.
getResult
().
getUseScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReduceAmount
())
/
100
);
...
@@ -76,6 +88,9 @@ public class CustomerScoreService implements IPromotionService {
...
@@ -76,6 +88,9 @@ public class CustomerScoreService implements IPromotionService {
String
[]
split
=
userScoreUseDetail
.
getResult
().
getScoreReduceRate
().
split
(
":"
);
String
[]
split
=
userScoreUseDetail
.
getResult
().
getScoreReduceRate
().
split
(
":"
);
msg
=
String
.
format
(
"共%s积分,每%s积分可抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
split
[
0
],
split
[
1
]);
msg
=
String
.
format
(
"共%s积分,每%s积分可抵¥%s"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
split
[
0
],
split
[
1
]);
break
;
break
;
case
3
:
msg
=
"已享受优惠,无法再参与积分抵扣"
;
break
;
case
4
:
case
4
:
msg
=
String
.
format
(
"共%s积分,订单满¥%s可开启积分抵现"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReducePriceLimit
())
/
100
);
msg
=
String
.
format
(
"共%s积分,订单满¥%s可开启积分抵现"
,
getValue
(
userScoreUseDetail
.
getResult
().
getCurrentScore
()),
((
double
)
userScoreUseDetail
.
getResult
().
getReducePriceLimit
())
/
100
);
break
;
break
;
...
...
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