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
99933a70
Commit
99933a70
authored
Feb 04, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
61e555bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
27 deletions
+36
-27
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
+36
-27
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
View file @
99933a70
...
@@ -56,6 +56,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -56,6 +56,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
@Autowired
@Autowired
private
ProductManager
productManager
;
private
ProductManager
productManager
;
@Autowired
@Autowired
private
CouponManager
couponManager
;
private
CouponManager
couponManager
;
...
@@ -453,7 +454,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -453,7 +454,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
List
<
CartGoods
>
giftGoods
=
null
;
List
<
CartGoods
>
giftGoods
=
null
;
AdditionBO
additionBO
=
null
;
AdditionBO
additionBO
=
null
;
ScoreReduceBO
scoreReduceBO
=
null
;
ScoreReduceBO
scoreReduceBO
=
null
;
if
(
distributeBO
.
getCalculationDiscountBO
()
=
=
null
||
CollectionUtils
.
isEmpty
(
distributeBO
.
getCartGoods
())){
if
(
distributeBO
.
getCalculationDiscountBO
()
!
=
null
||
CollectionUtils
.
isEmpty
(
distributeBO
.
getCartGoods
())){
/**
/**
* 用促销价格初始化购物车行记录成交价
* 用促销价格初始化购物车行记录成交价
*/
*/
...
@@ -466,13 +467,15 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -466,13 +467,15 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
*/
*/
additionBO
=
this
.
additionResponse
(
distributeBO
.
getCalculationDiscountBO
().
getResult
(),
baseRequestDTO
);
additionBO
=
this
.
additionResponse
(
distributeBO
.
getCalculationDiscountBO
().
getResult
(),
baseRequestDTO
);
/**
* 积分抵扣
*/
scoreReduceBO
=
this
.
scoreReduce
(
distributeBO
.
getCalculationDiscountBO
().
getResult
(),
baseRequestDTO
,
shoppingGoodsAmountBO
,
additionBO
);
}
}
/**
/**
* 积分抵扣
*/
scoreReduceBO
=
this
.
scoreReduce
(
distributeBO
.
getCalculationDiscountBO
(),
baseRequestDTO
,
shoppingGoodsAmountBO
,
additionBO
);
/**
* 配送费
* 配送费
*/
*/
DeliveryBO
delivery
=
null
;
DeliveryBO
delivery
=
null
;
...
@@ -661,7 +664,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -661,7 +664,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
}
public
ScoreReduceBO
scoreReduce
(
CalculationDiscountBO
.
CalculationDiscountResult
discountResult
public
ScoreReduceBO
scoreReduce
(
CalculationDiscountBO
calculationDiscountBO
,
ListCartGoodsBO
baseRequestDTO
,
ShoppingGoodsAmountBO
shoppingGoodsAmountBO
,
AdditionBO
additionBO
)
{
,
ListCartGoodsBO
baseRequestDTO
,
ShoppingGoodsAmountBO
shoppingGoodsAmountBO
,
AdditionBO
additionBO
)
{
ScoreReduceBO
scoreReduce
=
new
ScoreReduceBO
();
ScoreReduceBO
scoreReduce
=
new
ScoreReduceBO
();
if
(
baseRequestDTO
==
null
||
baseRequestDTO
.
getUseCustomerScore
()
==
null
if
(
baseRequestDTO
==
null
||
baseRequestDTO
.
getUseCustomerScore
()
==
null
...
@@ -698,28 +701,34 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
...
@@ -698,28 +701,34 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
if
(
getValue
(
userScoreUseDetail
.
getOverlayOffers
())
==
0
)
{
if
(
getValue
(
userScoreUseDetail
.
getOverlayOffers
())
==
0
)
{
scoreReduce
.
setScoreReduceState
(
getValue
(
userScoreUseDetail
.
getScoreState
()));
scoreReduce
.
setScoreReduceState
(
getValue
(
userScoreUseDetail
.
getScoreState
()));
}
else
{
}
else
{
if
(
StringUtils
.
isNotBlank
(
baseRequestDTO
.
getCouponCode
())
||
(
discountResult
!=
null
&&
discountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
)
CalculationDiscountBO
.
CalculationDiscountResult
discountResult
=
null
;
||
(
discountResult
!=
null
&&
!
CollectionUtils
.
isEmpty
(
discountResult
.
getDiscounts
())))
{
if
(
calculationDiscountBO
!=
null
){
//是否有换购
discountResult
=
calculationDiscountBO
.
getResult
();
int
type81
=
0
;
}
for
(
CalculationDiscountBO
.
CalculationDiscountResult
.
Discount
discount
:
discountResult
.
getDiscounts
())
{
if
(
discountResult
!=
null
){
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
()))
{
if
(
StringUtils
.
isNotBlank
(
baseRequestDTO
.
getCouponCode
())
||
(
discountResult
.
getTotalDiscountAmount
().
intValue
()
>
0
)
type81
=
1
;
||
(!
CollectionUtils
.
isEmpty
(
discountResult
.
getDiscounts
())))
{
break
;
//是否有换购
int
type81
=
0
;
for
(
CalculationDiscountBO
.
CalculationDiscountResult
.
Discount
discount
:
discountResult
.
getDiscounts
())
{
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
()))
{
type81
=
1
;
break
;
}
}
//集点
long
discountCount
=
discountResult
.
getDiscounts
().
stream
().
filter
(
discount
->
!
ActivityTypeEnum
.
TYPE_221
.
getCode
().
equals
(
discount
.
getType
())).
count
();
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if
((
type81
==
0
&&
discountCount
>=
1
)
||
(
type81
==
1
&&
!
CollectionUtils
.
isEmpty
(
baseRequestDTO
.
getSendGoods
()))
||
(
type81
==
1
&&
discountCount
>
1
))
{
scoreReduce
.
setScoreReduceState
(
5
);
userScoreUseDetail
.
setScoreState
(
5
);
scoreReduce
.
setReduceAmount
(
0
);
}
}
}
//集点
long
discountCount
=
discountResult
.
getDiscounts
().
stream
().
filter
(
discount
->
!
ActivityTypeEnum
.
TYPE_221
.
getCode
().
equals
(
discount
.
getType
())).
count
();
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if
((
type81
==
0
&&
discountCount
>=
1
)
||
(
type81
==
1
&&
!
CollectionUtils
.
isEmpty
(
baseRequestDTO
.
getSendGoods
()))
||
(
type81
==
1
&&
discountCount
>
1
))
{
scoreReduce
.
setScoreReduceState
(
5
);
userScoreUseDetail
.
setScoreState
(
5
);
scoreReduce
.
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