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
c15145f7
Commit
c15145f7
authored
Mar 25, 2021
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::new function about clear month-card information by couponCode
parent
95c0c85e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
2 deletions
+57
-2
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ClearCouponCodeRequestVo.java
+11
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+39
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
View file @
c15145f7
...
...
@@ -42,4 +42,10 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{
@NotEmpty
(
message
=
"商品信息不可为空"
)
private
List
<
BatchGoodsInfoVo
>
goodsInfos
;
/**
* 根据券号清除当前购物车中月卡及商品信息
*/
private
String
redundancyCouponCode
;
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ClearCouponCodeRequestVo.java
0 → 100644
View file @
c15145f7
package
cn
.
freemud
.
entities
.
vo
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
@Data
public
class
ClearCouponCodeRequestVo
extends
BaseRequestVo
{
@NotEmpty
(
message
=
"券号不可为空"
)
private
String
redundancyCouponCode
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
c15145f7
...
...
@@ -243,9 +243,9 @@ public class ShoppingCartMCoffeeServiceImpl {
// 促销活动的优惠金额计算
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
receiveId
,
couponCode
,
oldCartGoodsList
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
,
null
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
oldCartGoodsList
,
null
,
tableNumber
,
this
.
shoppingCartBaseService
);
newCartGoods
=
oldCartGoodsList
;
}
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
oldCartGoodsList
,
null
,
tableNumber
,
this
.
shoppingCartBaseService
);
newCartGoods
=
oldCartGoodsList
;
// 返回购物车数据
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
newCartGoods
,
null
,
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
}
...
...
@@ -383,6 +383,18 @@ public class ShoppingCartMCoffeeServiceImpl {
}
BaseResponse
baseResponse
;
//清除券信息
if
(
StringUtils
.
isNotEmpty
(
requestVo
.
getRedundancyCouponCode
())){
ClearCouponCodeRequestVo
clearCouponCodeRequestVo
=
new
ClearCouponCodeRequestVo
();
clearCouponCodeRequestVo
.
setRedundancyCouponCode
(
requestVo
.
getRedundancyCouponCode
());
clearCouponCodeRequestVo
.
setSessionId
(
requestVo
.
getSessionId
());
clearCouponCodeRequestVo
.
setPartnerId
(
requestVo
.
getPartnerId
());
clearCouponCodeRequestVo
.
setShopId
(
requestVo
.
getShopId
());
clearCouponCodeRequestVo
.
setOrderType
(
requestVo
.
getOrderType
());
clearCouponCodeRequestVo
.
setChannelType
(
requestVo
.
getChannelType
());
baseResponse
=
clearCouponInfoByCode
(
clearCouponCodeRequestVo
);
}
BatchUpdateGoodsQtyRequestVo
updateGoodsQtyRequestVo
=
new
BatchUpdateGoodsQtyRequestVo
();
updateGoodsQtyRequestVo
.
setAppId
(
requestVo
.
getAppId
());
updateGoodsQtyRequestVo
.
setChannelType
(
requestVo
.
getChannelType
());
...
...
@@ -445,6 +457,31 @@ public class ShoppingCartMCoffeeServiceImpl {
}
/**
* 根据券号清除券信息
* @param requestVo
* @return
*/
public
BaseResponse
clearCouponInfoByCode
(
ClearCouponCodeRequestVo
requestVo
){
if
(
StringUtils
.
isEmpty
(
requestVo
.
getShopId
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
}
String
sessionId
=
requestVo
.
getSessionId
();
// 获取用户信息
CustomerInfoVo
assortmentCustomerInfoVo
=
getCustomerInfoVo
(
sessionId
);
String
userId
=
assortmentCustomerInfoVo
.
getMemberId
();
String
partnerId
=
requestVo
.
getPartnerId
();
String
storeId
=
requestVo
.
getShopId
();
// 获取购物车商品
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
sessionId
,
""
,
shoppingCartBaseService
);
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
if
(
StringUtils
.
equals
(
cartGoods
.
getCouponCode
(),
requestVo
.
getRedundancyCouponCode
())){
cartGoods
.
setCouponCode
(
""
);
}
}
return
ResponseUtil
.
success
();
}
/**
* 更新商品数量
*/
public
BaseResponse
updateGoodsQty
(
UpdateShoppingCartGoodsQtyRequestVo
updateShoppingCartGoodsQtyRequestVo
)
{
...
...
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