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
a1360bfa
Commit
a1360bfa
authored
Mar 08, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3ceb10e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+16
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
a1360bfa
...
@@ -79,6 +79,7 @@ public class CalculationSharingDiscountService {
...
@@ -79,6 +79,7 @@ public class CalculationSharingDiscountService {
HashMap
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
new
HashMap
<>(
16
);
HashMap
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
new
HashMap
<>(
16
);
List
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountGoods
>
calculationDiscountGoodsList
=
new
ArrayList
<>();
List
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountGoods
>
calculationDiscountGoodsList
=
new
ArrayList
<>();
int
cartSize
=
cartGoodsList
.
size
()
-
1
;
int
cartSize
=
cartGoodsList
.
size
()
-
1
;
HashMap
<
String
,
List
<
String
>>
spqIdToCartUuid
=
new
HashMap
<>(
16
);
for
(
int
i
=
cartSize
;
i
>=
0
;
i
--)
{
for
(
int
i
=
cartSize
;
i
>=
0
;
i
--)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
if
(!
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
//非商品券
if
(!
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
//非商品券
...
@@ -100,6 +101,15 @@ public class CalculationSharingDiscountService {
...
@@ -100,6 +101,15 @@ public class CalculationSharingDiscountService {
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
//跑业务异常 商品券不存
//跑业务异常 商品券不存
}
else
{
}
else
{
if
(
spqIdToCartUuid
.
containsKey
(
spqId
)){
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
spqId
);
uuidList
.
add
(
cartGoods
.
getCartGoodsUid
());
spqIdToCartUuid
.
put
(
spqId
,
uuidList
);
}
else
{
List
<
String
>
uuidList
=
new
ArrayList
<>();
uuidList
.
add
(
cartGoods
.
getCartGoodsUid
());
spqIdToCartUuid
.
put
(
spqId
,
uuidList
);
}
validCouponMap
.
put
(
spqId
,
checkSpqInfo
);
validCouponMap
.
put
(
spqId
,
checkSpqInfo
);
cartGoods
.
setName
(
checkSpqInfo
.
getCouponName
());
cartGoods
.
setName
(
checkSpqInfo
.
getCouponName
());
cartGoods
.
setSpuName
(
checkSpqInfo
.
getCouponName
());
cartGoods
.
setSpuName
(
checkSpqInfo
.
getCouponName
());
...
@@ -185,12 +195,16 @@ public class CalculationSharingDiscountService {
...
@@ -185,12 +195,16 @@ public class CalculationSharingDiscountService {
if
(
sharingDiscountResponseDto
!=
null
&&
StringUtils
.
equals
(
sharingDiscountResponseDto
.
getStatusCode
(),
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
))
{
if
(
sharingDiscountResponseDto
!=
null
&&
StringUtils
.
equals
(
sharingDiscountResponseDto
.
getStatusCode
(),
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
))
{
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
result
=
sharingDiscountResponseDto
.
getResult
();
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
result
=
sharingDiscountResponseDto
.
getResult
();
if
(
validCouponMap
!=
null
){
if
(
validCouponMap
!=
null
){
List
<
String
>
activityCodeList
=
result
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
activityCodeList
=
result
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
for
(
String
spqId
:
validCouponMap
.
keySet
())
{
for
(
String
spqId
:
validCouponMap
.
keySet
())
{
if
(!
activityCodeList
.
contains
(
spqId
)){
// 表示商品券不够启用金额
if
(!
activityCodeList
.
contains
(
spqId
)){
// 表示商品券不够启用金额
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
spqId
);
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
);
throw
new
BizServiceException
(
ResponseResult
.
COCO_COUPON_VALIDATOR_FAIL
,
sharingDiscountResponseDto
.
getMsg
());
}
}
}
}
}
}
}
...
...
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