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
19745710
Commit
19745710
authored
Mar 11, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4ba08330
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+11
-5
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
19745710
...
...
@@ -75,6 +75,7 @@ import com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest;
import
com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
javafx.util.Pair
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -336,9 +337,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
allCartGoodsList.get(allCartGoodsList.indexOf(cartGoods)).getQty() + cartGoods.getQty() : cartGoods.getQty();
*/
Integer
checkQty
=
this
.
checkSkuQty
(
allCartGoodsList
,
cartGoods
);
if
(
checkQty
>
1
&&
!
isMultiCoupon
){
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE
);
}
//购物车添加数量限制
Integer
productsCount
=
limitGoodsQty
(
allCartGoodsList
,
cartGoods
,
appId
);
//查询多个商品库存信息 TODO
...
...
@@ -351,7 +349,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
else
{
// 当商品是商品券,里面会判断如果购物车中已有商品券,会将cartGoods的CartGoodsUid设为null
this
.
addProductGoods
(
addShoppingCartGoodsRequestVo
,
cartGoods
,
spuId2
,
userId
,
shoppingCartGoodsResponseVo
,
spuId
,
allCartGoodsList
,
productBeanListSpuClass
,
couponProductDto
,
couponCode
);
spuId
,
allCartGoodsList
,
productBeanListSpuClass
,
couponProductDto
,
couponCode
,
isMultiCoupon
);
}
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
,
addShoppingCartGoodsRequestVo
.
getOrderType
());
...
...
@@ -1719,7 +1717,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
private
void
addProductGoods
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
CartGoods
cartGoods
,
String
spuId2
,
String
userId
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
String
spuId
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
,
String
couponCode
)
{
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
,
String
couponCode
,
Boolean
isMultiCoupon
)
{
// 设置商品类型为商品券
if
(
CouponTypeEnum
.
TYPE_4
.
getCode
().
equals
(
couponProductDto
.
getType
()))
{
...
...
@@ -1734,6 +1734,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 商品券Id
String
spqId
=
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
if
(
CollectionUtils
.
isNotEmpty
(
allCartGoodsList
)
&&
!
isMultiCoupon
){
CartGoods
sameCartGoods
=
allCartGoodsList
.
stream
().
filter
(
p
->
p
.
getSpuId
().
equals
(
spqId
)).
findFirst
().
orElse
(
null
);
if
(
sameCartGoods
.
getQty
()
>
0
){
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE
);
}
}
cartGoods
.
setSpuId
(
spqId
);
cartGoods
.
setSkuId
(
spuId2
);
cartGoods
.
setOriginalPrice
(
0L
);
...
...
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