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
fe718d33
Commit
fe718d33
authored
Jan 15, 2021
by
yu.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::fix bug about monthcard payCardFee
parent
8a02e2fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+19
-5
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
fe718d33
...
...
@@ -213,12 +213,9 @@ public class ShoppingCartMCoffeeServiceImpl {
// 购物车数据更新(保存商品原价)
List
<
CartGoods
>
newCartGoods
=
updateCartGoodsLegal
(
partnerId
,
storeId
,
orderType
,
tableNumber
,
menuType
,
userId
,
addCartGoods
,
shoppingCartGoodsResponseVo
,
oldCartGoodsList
);
//月享卡购卡费用
Long
payCardPrice
=
newCartGoods
.
stream
().
filter
(
goods
->
Objects
.
equals
(
1
,
goods
.
getIsMonthCard
())).
mapToLong
(
CartGoods:
:
getOriginalPrice
).
sum
();
// 促销活动等价格计算
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
receiveId
,
null
,
newCartGoods
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
payCardPrice
);
newCartGoods
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
// 返回购物车数据
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
newCartGoods
,
null
,
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
...
...
@@ -1579,19 +1576,36 @@ public class ShoppingCartMCoffeeServiceImpl {
allCartGoodsList
.
addAll
(
reduceGoods
);
}
//如果是餐具商品,则放到最后
if
(
CollectionUtils
.
isNotEmpty
(
allCartGoodsList
))
{
int
size
=
allCartGoodsList
.
size
();
Boolean
hasTableWareSku
=
false
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
//如果是餐具商品,则放到最后
if
(
allCartGoodsList
.
get
(
i
).
getSkuId
().
equals
(
mcCafeTablewareSkuId
))
{
CartGoods
cartGoods
=
allCartGoodsList
.
get
(
i
);
cartGoods
.
setIsTableware
(
true
);
hasTableWareSku
=
true
;
if
(
i
!=
size
-
1
)
{
allCartGoodsList
.
remove
(
i
);
allCartGoodsList
.
add
(
cartGoods
);
break
;
}
}
//如果有餐具,月享卡放倒数第二; 没有餐具,月享卡放最后
if
(
Objects
.
equals
(
1
,
allCartGoodsList
.
get
(
i
).
getIsMonthCard
()))
{
CartGoods
cartGoods
=
allCartGoodsList
.
get
(
i
);
if
(
hasTableWareSku
&&
i
!=
size
-
2
)
{
allCartGoodsList
.
remove
(
i
);
allCartGoodsList
.
add
(
cartGoods
);
break
;
}
else
{
if
(
i
!=
size
-
1
)
{
cartGoods
.
setIsMonthCard
(
1
);
cartGoodsList
.
add
(
cartGoods
);
break
;
}
}
}
}
}
...
...
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