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
269298ae
Commit
269298ae
authored
Mar 30, 2021
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::fix bug about addGoods
parent
01ef9e72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+21
-2
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
View file @
269298ae
...
...
@@ -85,7 +85,7 @@ public class CartGoods {
/**
* 是否为种子券商品 1:是;0:否
*/
private
int
is
SeedCoupon
Goods
;
private
int
is
MonthCard
Goods
;
/**
* 是否是太阳蛋商品
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
269298ae
...
...
@@ -31,6 +31,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.service.thirdparty.ProductClient
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
...
...
@@ -506,6 +507,24 @@ public class ShoppingCartMCoffeeServiceImpl {
String
skuId
=
""
;
Integer
finalQty
=
qty
;
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
(
StringUtils
.
equals
(
cartGoods_
.
getSkuId
(),
"9999"
)
&&
StringUtils
.
equals
(
cartGoods_
.
getSpuId
(),
"9999"
)
&&
qty
==
0
){
clearMonthCouponInfo
(
cartGoodsList
,
cartGoods_
.
getCouponCode
());
...
...
@@ -531,7 +550,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
//商品券行商品数量不可增加
if
(
StringUtils
.
isNotEmpty
(
cartGoods
.
getCouponCode
())
&&
qty
>
1
&&
cartGoods
.
getIsMonthCardGoods
()
<
1
&&
cartGoods
.
getIsMonthCard
()
<
1
)
{
if
(
StringUtils
.
isNotEmpty
(
cartGoods
.
getCouponCode
())
&&
qty
>
1
&&
(
cartGoods
.
getIsMonthCardGoods
()
<
1
||
cartGoods
.
getIsMonthCard
()
<
1
)
)
{
throw
new
ServiceException
(
ResponseResult
.
NOT_SUPPORTED
);
}
...
...
@@ -2274,7 +2293,7 @@ public class ShoppingCartMCoffeeServiceImpl {
*/
private
void
seedCouponGoodsValidate
(
MCoffeeAddGoodsRequestVo
addShoppingCartGoodsRequestVo
,
List
<
CartGoods
>
oldCartGoodsList
){
//若加购种子券商品,则券号不可为空
if
(
StringUtils
.
isEmpty
(
addShoppingCartGoodsRequestVo
.
getCouponCode
()
)){
if
(
null
==
addShoppingCartGoodsRequestVo
.
getMonthCardInfo
(
)){
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_ADD_ERROR
);
}
for
(
CartGoods
cartGoods
:
oldCartGoodsList
)
{
...
...
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