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
3c80650d
Commit
3c80650d
authored
Oct 20, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20200915_麦咖啡p2v3活动入机增加TENDERID字段' into develop
parents
6f072c9c
0f46f80e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
26 deletions
+23
-26
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+23
-26
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
3c80650d
...
@@ -351,12 +351,8 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -351,12 +351,8 @@ public class ShoppingCartMCoffeeServiceImpl {
* 如果couponCode为空,则从缓存里尝试获取
* 如果couponCode为空,则从缓存里尝试获取
* 如果couponCode不为空,则设置到缓存里
* 如果couponCode不为空,则设置到缓存里
*/
*/
List
<
String
>
couponList
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
couponCode
))
{
if
(
StringUtils
.
isEmpty
(
couponCode
))
{
couponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
COUPON
.
getCode
());
couponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
COUPON
.
getCode
());
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
couponList
.
add
(
couponCode
);
}
}
else
{
}
else
{
if
(
"remove"
.
equals
(
couponCode
))
{
if
(
"remove"
.
equals
(
couponCode
))
{
couponCode
=
""
;
couponCode
=
""
;
...
@@ -366,9 +362,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -366,9 +362,6 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
StringUtils
.
isEmpty
(
freightCouponCode
))
{
if
(
StringUtils
.
isEmpty
(
freightCouponCode
))
{
freightCouponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
FREIGHT_COUPON
.
getCode
());
freightCouponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
FREIGHT_COUPON
.
getCode
());
if
(
StringUtils
.
isNotEmpty
(
freightCouponCode
))
{
couponList
.
add
(
freightCouponCode
);
}
}
else
{
}
else
{
if
(
"remove"
.
equals
(
freightCouponCode
))
{
if
(
"remove"
.
equals
(
freightCouponCode
))
{
freightCouponCode
=
""
;
freightCouponCode
=
""
;
...
@@ -376,24 +369,15 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -376,24 +369,15 @@ public class ShoppingCartMCoffeeServiceImpl {
assortmentSdkService
.
setShoppingCartCouponCode
(
partnerId
,
storeId
,
userId
,
freightCouponCode
,
shoppingCartBaseService
,
SaveCouponType
.
FREIGHT_COUPON
.
getCode
());
assortmentSdkService
.
setShoppingCartCouponCode
(
partnerId
,
storeId
,
userId
,
freightCouponCode
,
shoppingCartBaseService
,
SaveCouponType
.
FREIGHT_COUPON
.
getCode
());
}
}
//校验代金券和运费券是否可用
//放到参数里
if
(
CollectionUtils
.
isNotEmpty
(
couponList
))
{
if
(
StringUtils
.
isNotEmpty
(
couponCode
)
)
{
List
<
CouponState
>
couponStates
=
couponDiscountCalculation
.
buildAvailableCoupons
(
cartGoodsList
,
partnerId
,
storeId
,
couponList
);
shoppingCartInfoRequestVo
.
setCouponCode
(
couponCode
);
if
(
CollectionUtils
.
isNotEmpty
(
couponStates
))
{
shoppingCartGoodsResponseVo
.
setCouponCode
(
couponCode
);
Map
<
String
,
Integer
>
couponStateMap
=
couponStates
.
stream
().
collect
(
Collectors
.
toMap
(
CouponState:
:
getCouponCode
,
CouponState:
:
getState
,
(
k1
,
k2
)
->
k1
));
}
if
(
null
==
couponStateMap
.
get
(
couponCode
)
||
Objects
.
equals
(
couponStateMap
.
get
(
couponCode
),
CouponStateEnum
.
STATE_1
.
getCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
freightCouponCode
))
{
couponCode
=
""
;
shoppingCartInfoRequestVo
.
setFreightCouponCode
(
freightCouponCode
);
}
shoppingCartGoodsResponseVo
.
setFreightCouponCode
(
freightCouponCode
);
if
(
null
==
couponStateMap
.
get
(
freightCouponCode
)
||
Objects
.
equals
(
couponStateMap
.
get
(
freightCouponCode
),
CouponStateEnum
.
STATE_1
.
getCode
()))
{
freightCouponCode
=
""
;
}
}
else
{
couponCode
=
""
;
freightCouponCode
=
""
;
}
}
}
shoppingCartInfoRequestVo
.
setFreightCouponCode
(
freightCouponCode
);
String
code
=
""
;
String
code
=
""
;
Long
payCardPrice
=
null
;
Long
payCardPrice
=
null
;
...
@@ -415,8 +399,21 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -415,8 +399,21 @@ public class ShoppingCartMCoffeeServiceImpl {
//设置更新响应信息
//设置更新响应信息
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
ShoppingCartConstant
.
QUERY_INFO
,
shoppingCartInfoRequestVo
);
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
ShoppingCartConstant
.
QUERY_INFO
,
shoppingCartInfoRequestVo
);
shoppingCartGoodsResponseVo
.
setCouponCode
(
couponCode
);
//先出参里的券设置为空,然后如果可用,再放到出参里
shoppingCartGoodsResponseVo
.
setFreightCouponCode
(
freightCouponCode
);
shoppingCartGoodsResponseVo
.
setCouponCode
(
""
);
shoppingCartGoodsResponseVo
.
setFreightCouponCode
(
""
);
if
(
StringUtils
.
isNotEmpty
(
couponCode
)
||
StringUtils
.
isNotEmpty
(
freightCouponCode
))
{
String
finalCouponCode
=
couponCode
;
String
finalFreightCouponCode
=
freightCouponCode
;
shoppingCartGoodsResponseVo
.
getAvailableCoupon
().
getUsableCoupons
().
stream
().
forEach
(
o
->
{
if
(
o
.
getCouponCode
().
equals
(
finalCouponCode
))
{
shoppingCartGoodsResponseVo
.
setCouponCode
(
finalCouponCode
);
}
if
(
o
.
getCouponCode
().
equals
(
finalFreightCouponCode
))
{
shoppingCartGoodsResponseVo
.
setFreightCouponCode
(
finalFreightCouponCode
);
}
});
}
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
...
...
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