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
46215986
Commit
46215986
authored
Mar 17, 2021
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::月享卡2.0清除券信息逻辑
parent
3251655e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
34 deletions
+16
-34
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+16
-34
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
46215986
...
@@ -473,25 +473,10 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -473,25 +473,10 @@ public class ShoppingCartMCoffeeServiceImpl {
String
skuId
=
""
;
String
skuId
=
""
;
Integer
finalQty
=
qty
;
Integer
finalQty
=
qty
;
for
(
CartGoods
cartGoods_
:
cartGoodsList
)
{
for
(
CartGoods
cartGoods_
:
cartGoodsList
)
{
//如果菜单购月卡数量大于10,则不作数量修改,直接算价并返回之前购物车信息
if
(
Objects
.
equals
(
1
,
cartGoods_
.
getIsMonthCard
())
&&
cartGoods_
.
getCartGoodsUid
().
equals
(
updateShoppingCartGoodsQtyRequestVo
.
getCartGoodsUid
())
&&
updateShoppingCartGoodsQtyRequestVo
.
getQty
()>
10
)
{
shoppingCartGoodsResponseVo
.
setChanged
(
true
);
shoppingCartGoodsResponseVo
.
setToastMsg
(
ResponseResult
.
SHOPPING_CART_QTY_LIMIT_ERR
.
getMessage
());
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
ResponseResult
.
SHOPPING_CART_QTY_LIMIT_ERR
.
getMessage
(),
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
String
freightCouponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
FREIGHT_COUPON
.
getCode
());
String
couponCode
=
assortmentSdkService
.
getShoppingCartCoupon
(
partnerId
,
storeId
,
userId
,
shoppingCartBaseService
,
SaveCouponType
.
COUPON
.
getCode
());
// 当couponCode不为空时,需参与价格计算
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
getCoupon
(
couponCode
,
null
,
cartGoodsList
,
freightCouponCode
,
null
);
// 促销活动的优惠金额计算
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
receiveId
,
couponCode
,
cartGoodsList
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
if
(
cartGoodsUid
.
equals
(
cartGoods_
.
getCartGoodsUid
()))
{
if
(
cartGoodsUid
.
equals
(
cartGoods_
.
getCartGoodsUid
()))
{
if
(
StringUtils
.
equals
(
cartGoods_
.
getSkuId
(),
"9999"
)
&&
StringUtils
.
equals
(
cartGoods_
.
getSpuId
(),
"9999"
)
&&
qty
==
0
){
clearMonthCouponInfo
(
cartGoodsList
,
cartGoods_
.
getCouponCode
());
}
cartGoods
=
cartGoods_
;
cartGoods
=
cartGoods_
;
cartGoods_
.
setQty
(
qty
);
cartGoods_
.
setQty
(
qty
);
skuId
=
cartGoods_
.
getSkuId
();
skuId
=
cartGoods_
.
getSkuId
();
...
@@ -2280,27 +2265,24 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -2280,27 +2265,24 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SEED_COUPON_VALID
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SEED_COUPON_VALID
);
}
}
// int seedCouponCount = 0;
// int seedCouponGoodsCount = 0;
for
(
CartGoods
cartGoods
:
oldCartGoodsList
)
{
for
(
CartGoods
cartGoods
:
oldCartGoodsList
)
{
//1.种子券商品券信息与月卡信息一致
//1.种子券商品券信息与月卡信息一致
if
(
null
!=
cartGoods
.
getMonthCardInfo
()
&&
!
addShoppingCartGoodsRequestVo
.
getCouponCode
().
equals
(
cartGoods
.
getMonthCardInfo
().
getCardCode
())){
if
(
null
!=
cartGoods
.
getMonthCardInfo
()
&&
!
addShoppingCartGoodsRequestVo
.
getCouponCode
().
equals
(
cartGoods
.
getMonthCardInfo
().
getCardCode
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_COUPON_NOT_EXIST
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_COUPON_NOT_EXIST
);
}
}
//@Date 2021-03-15 月享卡2.0需求不再校验月享卡商品购买次数限制
// if (cartGoods.getIsMonthCard()>0){
// seedCouponCount = seedCouponCount + cartGoods.getQty();
// }
// if (cartGoods.getIsSeedCouponGoods()>0 && cartGoods.getIsMonthCard()<1){
// seedCouponGoodsCount = seedCouponGoodsCount + cartGoods.getQty();
// }
}
}
}
//2.种子券商品数量不可大于种子券数量
/**
// if ((seedCouponGoodsCount+addShoppingCartGoodsRequestVo.getQty()) > seedCouponCount){
* 清除购物车商品使用月卡信息
// throw new ServiceException(ResponseResult.SHOPPING_CART_SEED_COUPON_VALID);
* @param cartGoods
// }
* @param couponCode
*/
private
void
clearMonthCouponInfo
(
List
<
CartGoods
>
cartGoods
,
String
couponCode
){
for
(
CartGoods
cartGood
:
cartGoods
)
{
if
(
StringUtils
.
equals
(
cartGood
.
getCouponCode
(),
couponCode
)){
cartGood
.
setCouponCode
(
""
);
}
}
}
}
}
}
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