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
d6650e2f
Commit
d6650e2f
authored
Nov 05, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validCouponMap 获取信息取商品对象CouponCode字段,
商品券统一取商品对象CouponCode字段
parent
986a7e29
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
19 deletions
+21
-19
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/service/DistributeAdapter.java
+3
-3
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/DistributeServiceImpl.java
+3
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponPromotionService.java
+3
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ProductServiceImpl.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
+3
-3
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
View file @
d6650e2f
...
@@ -366,7 +366,7 @@ public interface ShoppingCartBaseService {
...
@@ -366,7 +366,7 @@ public interface ShoppingCartBaseService {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
for
(
CartGoods
cartGoods
:
cartGoodsByProduct
)
{
for
(
CartGoods
cartGoods
:
cartGoodsByProduct
)
{
DetailVO
detail
=
detailsMap
.
get
(
cartGoods
.
get
SpuId
());
DetailVO
detail
=
detailsMap
.
get
(
cartGoods
.
get
CouponCode
());
String
activeCode
=
detail
!=
null
?
detail
.
getActiveCode
()
:
""
;
String
activeCode
=
detail
!=
null
?
detail
.
getActiveCode
()
:
""
;
if
(
couponOrderWayMap
==
null
||
couponOrderWayMap
.
isEmpty
()
||
!
couponOrderWayMap
.
get
(
activeCode
))
{
if
(
couponOrderWayMap
==
null
||
couponOrderWayMap
.
isEmpty
()
||
!
couponOrderWayMap
.
get
(
activeCode
))
{
orderWayFlag
=
true
;
orderWayFlag
=
true
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/service/DistributeAdapter.java
View file @
d6650e2f
...
@@ -109,15 +109,15 @@ public class DistributeAdapter {
...
@@ -109,15 +109,15 @@ public class DistributeAdapter {
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getSpqIdToCartUuidMap
();
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getSpqIdToCartUuidMap
();
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
discountResult
!=
null
){
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
discountResult
!=
null
){
List
<
String
>
activityCodeList
=
discountResult
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
activityCodeList
=
discountResult
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
for
(
String
spqId
:
validCouponMap
.
keySet
())
{
for
(
String
couponCode
:
validCouponMap
.
keySet
())
{
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
couponCode
);
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
assortmentSdkService
.
setShoppingCart
(
bo
.
getPartnerId
(),
bo
.
getShopId
(),
bo
.
getUserId
(),
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
null
);
assortmentSdkService
.
setShoppingCart
(
bo
.
getPartnerId
(),
bo
.
getShopId
(),
bo
.
getUserId
(),
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
null
);
cartGoodsList
=
newCartList
;
cartGoodsList
=
newCartList
;
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
couponCode
);
commonSetMessageBO
.
setChanged
(
true
);
commonSetMessageBO
.
setChanged
(
true
);
commonSetMessageBO
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
commonSetMessageBO
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
View file @
d6650e2f
...
@@ -234,7 +234,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -234,7 +234,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
String
couponCode
=
CommonUtils
.
getCouponCode
(
baseRequestBO
.
getCouponCode
(),
spuId
);
String
couponCode
=
CommonUtils
.
getCouponCode
(
baseRequestBO
.
getCouponCode
(),
spuId
);
cartGoods
.
setAddCartTime
(
System
.
currentTimeMillis
());
cartGoods
.
setAddCartTime
(
System
.
currentTimeMillis
());
cartGoods
.
setSpuId
(
couponCode
);
//
cartGoods.setSpuId(couponCode);
cartGoods
.
setSkuId
(
StringUtils
.
isEmpty
(
spqBO
.
getSkuId
())
?
spqBO
.
getSpuId
()
:
spqBO
.
getSkuId
());
cartGoods
.
setSkuId
(
StringUtils
.
isEmpty
(
spqBO
.
getSkuId
())
?
spqBO
.
getSpuId
()
:
spqBO
.
getSkuId
());
cartGoods
.
setOriginalPrice
(
0L
);
cartGoods
.
setOriginalPrice
(
0L
);
cartGoods
.
setOriginalAmount
(
0L
);
cartGoods
.
setOriginalAmount
(
0L
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
View file @
d6650e2f
...
@@ -445,11 +445,11 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
...
@@ -445,11 +445,11 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
for
(
CartGoods
product
:
cartGoodsList
)
{
for
(
CartGoods
product
:
cartGoodsList
)
{
//循环购物车商品券
//循环购物车商品券
if
(
CommonUtils
.
isProductCoupon
(
product
.
getCouponCode
(),
product
.
getCartGoodsUid
()))
{
if
(
CommonUtils
.
isProductCoupon
(
product
.
getCouponCode
(),
product
.
getCartGoodsUid
()))
{
String
spqId
=
product
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()
);
String
couponCode
=
product
.
getCouponCode
(
);
// 计算优惠信息时,已将券校验过,放在map中
// 计算优惠信息时,已将券校验过,放在map中
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getValidCouponMap
();
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getValidCouponMap
();
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
))
{
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
))
{
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
couponCode
);
if
(
checkSpqInfoResponseDto
!=
null
)
{
if
(
checkSpqInfoResponseDto
!=
null
)
{
product
.
setOriginalPrice
(
checkSpqInfoResponseDto
.
getPrice
());
product
.
setOriginalPrice
(
checkSpqInfoResponseDto
.
getPrice
());
product
.
setSpuId
(
checkSpqInfoResponseDto
.
getSpuId
());
product
.
setSpuId
(
checkSpqInfoResponseDto
.
getSpuId
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/DistributeServiceImpl.java
View file @
d6650e2f
...
@@ -52,8 +52,9 @@ public class DistributeServiceImpl implements DistributeService {
...
@@ -52,8 +52,9 @@ public class DistributeServiceImpl implements DistributeService {
originalAmount
=
0L
;
amount
=
0L
;
packageAmount
=
0L
;
originalAmount
=
0L
;
amount
=
0L
;
packageAmount
=
0L
;
if
(
CommonUtils
.
isProductCoupon
(
cartGoods
.
getCouponCode
(),
cartGoods
.
getCartGoodsUid
())){
if
(
CommonUtils
.
isProductCoupon
(
cartGoods
.
getCouponCode
(),
cartGoods
.
getCartGoodsUid
())){
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
.
getValidCouponMap
();
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
.
getValidCouponMap
();
if
(
validCouponMap
!=
null
&&
validCouponMap
.
get
(
cartGoods
.
getSpuId
())
!=
null
){
if
(
validCouponMap
!=
null
&&
validCouponMap
.
get
(
cartGoods
.
getCouponCode
())
!=
null
){
cartGoods
.
setSpuId
(
validCouponMap
.
get
(
cartGoods
.
getSpuId
()).
getSpuId
());
//商品spuId
cartGoods
.
setSpuId
(
validCouponMap
.
get
(
cartGoods
.
getCouponCode
()).
getSpuId
());
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
View file @
d6650e2f
...
@@ -164,11 +164,11 @@ public class PlatformApportionService extends AbstractApportionService {
...
@@ -164,11 +164,11 @@ public class PlatformApportionService extends AbstractApportionService {
//循环购物车商品券
//循环购物车商品券
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
if
(
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
if
(
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
String
spqId
=
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()
);
String
couponCode
=
cartGoods
.
getCouponCode
(
);
// 计算优惠信息时,已将券校验过,放在map中
// 计算优惠信息时,已将券校验过,放在map中
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getValidCouponMap
();
Map
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
discountResult
==
null
?
new
HashMap
<>()
:
discountResult
.
getValidCouponMap
();
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
))
{
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
))
{
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
couponCode
);
if
(
checkSpqInfoResponseDto
!=
null
)
{
if
(
checkSpqInfoResponseDto
!=
null
)
{
cartGoods
.
setOriginalPrice
(
checkSpqInfoResponseDto
.
getPrice
());
cartGoods
.
setOriginalPrice
(
checkSpqInfoResponseDto
.
getPrice
());
cartGoods
.
setSpuId
(
checkSpqInfoResponseDto
.
getSpuId
());
cartGoods
.
setSpuId
(
checkSpqInfoResponseDto
.
getSpuId
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
View file @
d6650e2f
...
@@ -194,7 +194,7 @@ public interface ShoppingCartNewService {
...
@@ -194,7 +194,7 @@ public interface ShoppingCartNewService {
cartGoods
.
setGoodsType
(
GoodsTypeEnum
.
COUPON_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
GoodsTypeEnum
.
COUPON_GOODS
.
getGoodsType
());
// 商品券Id
// 商品券Id
String
spqId
=
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
String
spqId
=
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
cartGoods
.
setSpuId
(
spqId
);
//
cartGoods.setSpuId(spqId);
cartGoods
.
setSkuId
(
spuId2
);
cartGoods
.
setSkuId
(
spuId2
);
cartGoods
.
setOriginalPrice
(
0L
);
cartGoods
.
setOriginalPrice
(
0L
);
cartGoods
.
setOriginalAmount
(
0L
);
cartGoods
.
setOriginalAmount
(
0L
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponPromotionService.java
View file @
d6650e2f
...
@@ -126,15 +126,15 @@ public class CouponPromotionService implements IPromotionService {
...
@@ -126,15 +126,15 @@ public class CouponPromotionService implements IPromotionService {
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
calculationDiscountResult
==
null
?
new
HashMap
<>()
:
calculationDiscountResult
.
getSpqIdToCartUuid
();
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
calculationDiscountResult
==
null
?
new
HashMap
<>()
:
calculationDiscountResult
.
getSpqIdToCartUuid
();
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
calculationDiscountResult
!=
null
){
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
calculationDiscountResult
!=
null
){
List
<
String
>
activityCodeList
=
calculationDiscountResult
.
getCouponDiscounts
().
stream
().
map
(
p
->
p
.
getCouponCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
activityCodeList
=
calculationDiscountResult
.
getCouponDiscounts
().
stream
().
map
(
p
->
p
.
getCouponCode
()).
collect
(
Collectors
.
toList
());
for
(
String
spqId
:
validCouponMap
.
keySet
())
{
for
(
String
couponCode
:
validCouponMap
.
keySet
())
{
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
couponCode
);
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
assortmentSdkService
.
setShoppingCart
(
activityQueryDto
.
getPartnerId
(),
activityQueryDto
.
getStoreId
(),
userLoginInfoDto
.
getMemberId
(),
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
activityQueryDto
.
getBizType
());
assortmentSdkService
.
setShoppingCart
(
activityQueryDto
.
getPartnerId
(),
activityQueryDto
.
getStoreId
(),
userLoginInfoDto
.
getMemberId
(),
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
activityQueryDto
.
getBizType
());
cartGoodsList
=
newCartList
;
cartGoodsList
=
newCartList
;
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
couponCode
);
shoppingCartGoodsResponseVo
.
setChanged
(
true
);
shoppingCartGoodsResponseVo
.
setChanged
(
true
);
shoppingCartGoodsResponseVo
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
shoppingCartGoodsResponseVo
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ProductServiceImpl.java
View file @
d6650e2f
...
@@ -262,6 +262,7 @@ public class ProductServiceImpl implements ProductService {
...
@@ -262,6 +262,7 @@ public class ProductServiceImpl implements ProductService {
*/
*/
private
boolean
checkProductOrderWay
(
List
<
CartGoods
>
cartGoodsList
,
Map
<
String
,
GetCouponDetailResponseDto
.
Details
>
detailsMap
,
Map
<
String
,
Boolean
>
couponOrderWayMap
)
{
private
boolean
checkProductOrderWay
(
List
<
CartGoods
>
cartGoodsList
,
Map
<
String
,
GetCouponDetailResponseDto
.
Details
>
detailsMap
,
Map
<
String
,
Boolean
>
couponOrderWayMap
)
{
boolean
orderWayFlag
=
false
;
boolean
orderWayFlag
=
false
;
// TODO: 21-11-5 判断券商品待删除
List
<
CartGoods
>
cartGoodsByProduct
=
cartGoodsList
.
stream
()
List
<
CartGoods
>
cartGoodsByProduct
=
cartGoodsList
.
stream
()
.
filter
(
cartGoods
->
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
.
filter
(
cartGoods
->
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -271,7 +272,7 @@ public class ProductServiceImpl implements ProductService {
...
@@ -271,7 +272,7 @@ public class ProductServiceImpl implements ProductService {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
for
(
CartGoods
cartGoods
:
cartGoodsByProduct
)
{
for
(
CartGoods
cartGoods
:
cartGoodsByProduct
)
{
GetCouponDetailResponseDto
.
Details
detail
=
detailsMap
.
get
(
cartGoods
.
get
SpuId
());
GetCouponDetailResponseDto
.
Details
detail
=
detailsMap
.
get
(
cartGoods
.
get
CouponCode
());
String
activeCode
=
detail
!=
null
?
detail
.
getActiveCode
()
:
""
;
String
activeCode
=
detail
!=
null
?
detail
.
getActiveCode
()
:
""
;
if
(
couponOrderWayMap
==
null
||
couponOrderWayMap
.
isEmpty
()
||
!
couponOrderWayMap
.
get
(
activeCode
))
{
if
(
couponOrderWayMap
==
null
||
couponOrderWayMap
.
isEmpty
()
||
!
couponOrderWayMap
.
get
(
activeCode
))
{
orderWayFlag
=
true
;
orderWayFlag
=
true
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
View file @
d6650e2f
...
@@ -115,15 +115,15 @@ public class CouponSharingService {
...
@@ -115,15 +115,15 @@ public class CouponSharingService {
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
calculationDiscountResult
==
null
?
new
HashMap
<>()
:
calculationDiscountResult
.
getSpqIdToCartUuid
();
Map
<
String
,
List
<
String
>>
spqIdToCartUuid
=
calculationDiscountResult
==
null
?
new
HashMap
<>()
:
calculationDiscountResult
.
getSpqIdToCartUuid
();
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
calculationDiscountResult
!=
null
){
if
(
MapUtils
.
isNotEmpty
(
validCouponMap
)
&&
MapUtils
.
isNotEmpty
(
spqIdToCartUuid
)
&&
calculationDiscountResult
!=
null
){
List
<
String
>
activityCodeList
=
calculationDiscountResult
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
List
<
String
>
activityCodeList
=
calculationDiscountResult
.
getDiscounts
().
stream
().
map
(
p
->
p
.
getActivityCode
()).
collect
(
Collectors
.
toList
());
for
(
String
spqId
:
validCouponMap
.
keySet
())
{
for
(
String
couponCode
:
validCouponMap
.
keySet
())
{
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
sqpInfo
=
validCouponMap
.
get
(
couponCode
);
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
if
(!
activityCodeList
.
contains
(
sqpInfo
.
getCouponCode
())){
// 表示商品券不够启用金额
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
List
<
String
>
uuidList
=
spqIdToCartUuid
.
get
(
sqpInfo
.
getCouponCode
());
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
if
(
CollectionUtils
.
isNotEmpty
(
uuidList
)){
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
List
<
CartGoods
>
newCartList
=
cartGoodsList
.
stream
().
filter
(
p
->
!
uuidList
.
contains
(
p
.
getCartGoodsUid
())).
collect
(
Collectors
.
toList
());
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
bizType
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
newCartList
,
null
,
null
,
this
.
shoppingCartBaseService
,
bizType
);
cartGoodsList
=
newCartList
;
cartGoodsList
=
newCartList
;
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
spqId
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
validCouponMap
.
get
(
couponCode
);
shoppingCartGoodsResponseVo
.
setChanged
(
true
);
shoppingCartGoodsResponseVo
.
setChanged
(
true
);
shoppingCartGoodsResponseVo
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
shoppingCartGoodsResponseVo
.
setToastMsg
(
"当前购物车金额低于【"
+
checkSpqInfoResponseDto
.
getCouponName
()
+
"】优惠券起用金额门槛,券已自动移除购物车"
);
}
}
...
...
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