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
60cb0f5a
Commit
60cb0f5a
authored
Jan 08, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分抵扣,优惠信息为空判断
parent
259e0553
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
+23
-21
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CustomerScoreService.java
View file @
60cb0f5a
...
...
@@ -74,18 +74,18 @@ public class CustomerScoreService implements IPromotionService {
if
(
getValue
(
userScoreUseDetail
.
getResult
().
getOverlayOffers
())
==
0
)
{
customerScoreVo
.
setScoreReduceState
(
getValue
(
userScoreUseDetail
.
getResult
().
getScoreState
()));
}
else
{
if
(
StringUtils
.
isNotBlank
(
shoppingCartInfoRequestVo
.
getCouponCode
())
||
(
calculationDiscountResult
!=
null
&&
calculationDiscountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
)
||
(
calculationDiscountResult
!=
null
&&
!
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getDiscounts
())))
{
//是否有换购
int
type81
=
0
;
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
discount
:
calculationDiscountResult
.
getDiscounts
())
{
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
()))
{
type81
=
1
;
break
;
if
(
StringUtils
.
isNotBlank
(
shoppingCartInfoRequestVo
.
getCouponCode
())
||
(
calculationDiscountResult
!=
null
&&
calculationDiscountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
))
{
if
(
calculationDiscountResult
!=
null
&&
!
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getDiscounts
())){
//是否有换购
int
type81
=
0
;
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
discount
:
calculationDiscountResult
.
getDiscounts
())
{
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
()))
{
type81
=
1
;
break
;
}
}
}
//集点
long
discountCount
=
calculationDiscountResult
.
getDiscounts
().
stream
().
filter
(
discount
->
!
ActivityTypeEnum
.
TYPE_221
.
getCode
().
equals
(
discount
.
getType
())).
count
();
//集点
long
discountCount
=
calculationDiscountResult
.
getDiscounts
().
stream
().
filter
(
discount
->
!
ActivityTypeEnum
.
TYPE_221
.
getCode
().
equals
(
discount
.
getType
())).
count
();
/*
int discountCount = calculationDiscountResult.getDiscounts().size();
int type211 = 0;
...
...
@@ -97,17 +97,19 @@ public class CustomerScoreService implements IPromotionService {
}
discountCount = discountCount - type211;
*/
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if
((
type81
==
0
&&
discountCount
>=
1
)
||
(
type81
==
1
&&
!
CollectionUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getSendGoods
()))
||
(
type81
==
1
&&
discountCount
>
1
))
{
customerScoreVo
.
setScoreReduceState
(
5
);
userScoreUseDetail
.
getResult
().
setScoreState
(
5
);
discountAmount
=
0
;
customerScoreVo
.
setReduceAmount
(
0
);
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if
((
type81
==
0
&&
discountCount
>=
1
)
||
(
type81
==
1
&&
!
CollectionUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getSendGoods
()))
||
(
type81
==
1
&&
discountCount
>
1
))
{
customerScoreVo
.
setScoreReduceState
(
5
);
userScoreUseDetail
.
getResult
().
setScoreState
(
5
);
discountAmount
=
0
;
customerScoreVo
.
setReduceAmount
(
0
);
}
}
}
}
...
...
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