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
c479dfa0
Commit
c479dfa0
authored
Jun 15, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量删券
parent
24f0139e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+17
-15
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/MCoffeeAddGoodsRequestVo.java
+4
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
View file @
c479dfa0
...
...
@@ -51,7 +51,7 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{
/**
* 根据券号清除当前购物车中月卡及商品信息
*/
private
String
redundancyB3S1CouponCode
;
private
List
<
String
>
redundancyB3S1CouponCode
;
/**
* 是否使用月享卡2.0
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
c479dfa0
...
...
@@ -442,15 +442,18 @@ public class ShoppingCartMCoffeeServiceImpl {
clearCouponCodeRequestVo
.
setIsUseMonthCard
(
requestVo
.
getIsUseMonthCard
());
baseResponse
=
clearCouponInfoByCode
(
clearCouponCodeRequestVo
);
}
if
(
String
Utils
.
isNotEmpty
(
requestVo
.
getRedundancyB3S1CouponCode
())){
if
(
Collection
Utils
.
isNotEmpty
(
requestVo
.
getRedundancyB3S1CouponCode
())){
MCoffeeAddGoodsRequestVo
clearCouponCodeRequestVo
=
new
MCoffeeAddGoodsRequestVo
();
clearCouponCodeRequestVo
.
setCouponCode
(
requestVo
.
getRedundancyB3S1CouponCode
());
clearCouponCodeRequestVo
.
setCouponCode
List
(
requestVo
.
getRedundancyB3S1CouponCode
());
clearCouponCodeRequestVo
.
setSessionId
(
requestVo
.
getSessionId
());
clearCouponCodeRequestVo
.
setPartnerId
(
requestVo
.
getPartnerId
());
clearCouponCodeRequestVo
.
setShopId
(
requestVo
.
getShopId
());
clearCouponCodeRequestVo
.
setOrderType
(
requestVo
.
getOrderType
());
clearCouponCodeRequestVo
.
setChannelType
(
requestVo
.
getChannelType
());
baseResponse
=
removeB3S1Coupon
(
clearCouponCodeRequestVo
);
if
(!
Objects
.
equals
(
ResponseResult
.
SUCCESS
.
getCode
(),
baseResponse
.
getCode
()))
{
return
baseResponse
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
requestVo
.
getQtyInfoList
()))
{
...
...
@@ -531,7 +534,7 @@ public class ShoppingCartMCoffeeServiceImpl {
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
}
if
(
StringUtils
.
isEmpty
(
addShoppingCartGoodsRequestVo
.
getCouponCode
())){
if
(
CollectionUtils
.
isEmpty
(
addShoppingCartGoodsRequestVo
.
getCouponCodeList
())){
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_UPDATE_ERROR
,
"买3赠1券号不能为空"
);
}
...
...
@@ -552,7 +555,6 @@ public class ShoppingCartMCoffeeServiceImpl {
Integer
orderType
=
addShoppingCartGoodsRequestVo
.
getOrderType
();
String
receiveId
=
addShoppingCartGoodsRequestVo
.
getReceiveId
();
Integer
operationType
=
addShoppingCartGoodsRequestVo
.
getOperationType
();
String
couponCode
=
addShoppingCartGoodsRequestVo
.
getCouponCode
();
// 查询购物车缓存
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
...
...
@@ -560,14 +562,13 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoodsList
=
new
ArrayList
<>();
}
cartGoodsList
=
clearB3S1CouponInfo
(
cartGoodsList
,
couponCode
);
cartGoodsList
=
clearB3S1CouponInfo
(
cartGoodsList
,
addShoppingCartGoodsRequestVo
.
getCouponCodeList
()
);
Optional
<
CartGoods
>
cartGoods9998
=
cartGoodsList
.
stream
().
filter
(
o
->
"9998"
.
equals
(
skuId
)
&&
o
.
getIsB3S1Coupon
()
==
1
).
findFirst
();
if
(
cartGoods9998
.
isPresent
())
{
cartGoods9998
.
get
().
getB3S1CouponGoodsInfo
().
getCardCodeSet
().
remove
(
couponCode
);
cartGoods9998
.
get
().
getB3S1CouponGoodsInfo
().
getCardCodeSet
().
remove
All
(
addShoppingCartGoodsRequestVo
.
getCouponCodeList
()
);
}
CartGoods
monthCardProduct
=
null
;
CartGoods
B3S1CouponProduct
=
null
;
// 如果购物车商品不为空, 则check购物车中所有商品
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
))
{
// check购物车中所有商品
...
...
@@ -577,19 +578,12 @@ public class ShoppingCartMCoffeeServiceImpl {
monthCardProduct
=
goods
;
continue
;
}
if
(
StringUtils
.
equals
(
goods
.
getSkuId
(),
"9998"
)){
B3S1CouponProduct
=
goods
;
continue
;
}
temList
.
add
(
goods
);
}
cartGoodsList
=
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
temList
,
sessionId
);
if
(
null
!=
monthCardProduct
)
{
cartGoodsList
.
add
(
monthCardProduct
);
}
if
(
null
!=
B3S1CouponProduct
)
{
cartGoodsList
.
add
(
B3S1CouponProduct
);
}
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
))
{
int
size
=
cartGoodsList
.
size
();
...
...
@@ -637,7 +631,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// 当couponCode不为空时,需参与价格计算
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
getCoupon
(
productCouponCode
,
null
,
cartGoodsList
,
freightCouponCode
,
null
);
// 促销活动的优惠金额计算
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
receiveId
,
couponCode
,
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
receiveId
,
addShoppingCartGoodsRequestVo
.
getCouponCode
()
,
cartGoodsList
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
tableNumber
,
this
.
shoppingCartBaseService
);
...
...
@@ -2624,4 +2618,12 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoodsList
.
removeIf
(
o
->
couponCode
.
equals
(
o
.
getCouponCode
()));
return
cartGoodsList
;
}
/**
* 清除购物车商品使用买3赠1券信息
* @param couponCodeList
*/
private
List
<
CartGoods
>
clearB3S1CouponInfo
(
List
<
CartGoods
>
cartGoodsList
,
List
<
String
>
couponCodeList
){
cartGoodsList
.
removeIf
(
o
->
couponCodeList
.
contains
(
o
.
getCouponCode
()));
return
cartGoodsList
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/MCoffeeAddGoodsRequestVo.java
View file @
c479dfa0
...
...
@@ -134,6 +134,10 @@ public class MCoffeeAddGoodsRequestVo {
* 优惠券号
*/
private
String
couponCode
;
/**
* 优惠券号
*/
private
List
<
String
>
couponCodeList
;
/**
* 套餐名称
...
...
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