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
949b1936
Commit
949b1936
authored
Apr 02, 2021
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::修复月享卡互斥bug,新增isUseMonthCard字段
parent
a1c91d5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
5 deletions
+52
-5
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
+12
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
+8
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ClearCouponCodeRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/MonthCardVo.java
+6
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+19
-5
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartGoods.java
View file @
949b1936
...
@@ -87,6 +87,12 @@ public class CartGoods {
...
@@ -87,6 +87,12 @@ public class CartGoods {
*/
*/
private
int
isMonthCardGoods
;
private
int
isMonthCardGoods
;
/**
/**
* 是否使用月享卡2.0
* 1 是
* 0 否
*/
private
int
isUseMonthCard
;
/**
* 是否是太阳蛋商品
* 是否是太阳蛋商品
*/
*/
private
int
isSunnyCoupon
;
private
int
isSunnyCoupon
;
...
@@ -286,6 +292,12 @@ public class CartGoods {
...
@@ -286,6 +292,12 @@ public class CartGoods {
* 月享卡类型:1.月享卡(单商品购买);2.月享卡(多商品购买);3.普通月卡
* 月享卡类型:1.月享卡(单商品购买);2.月享卡(多商品购买);3.普通月卡
*/
*/
private
Integer
type
;
private
Integer
type
;
/**
* 是否使用月享卡2.0
* 1 是
* 0 否
*/
private
int
isUseMonthCard
;
}
}
@Data
@Data
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/BatchOperateCartGoodsRequestVo.java
View file @
949b1936
...
@@ -48,4 +48,11 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{
...
@@ -48,4 +48,11 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{
*/
*/
private
String
redundancyCouponCode
;
private
String
redundancyCouponCode
;
/**
* 是否使用月享卡2.0
* 1 是
* 0 否
*/
private
int
isUseMonthCard
;
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ClearCouponCodeRequestVo.java
View file @
949b1936
...
@@ -8,4 +8,11 @@ import javax.validation.constraints.NotEmpty;
...
@@ -8,4 +8,11 @@ import javax.validation.constraints.NotEmpty;
public
class
ClearCouponCodeRequestVo
extends
BaseRequestVo
{
public
class
ClearCouponCodeRequestVo
extends
BaseRequestVo
{
@NotEmpty
(
message
=
"券号不可为空"
)
@NotEmpty
(
message
=
"券号不可为空"
)
private
String
redundancyCouponCode
;
private
String
redundancyCouponCode
;
/**
* 是否使用月享卡2.0
* 1 是
* 0 否
*/
private
int
isUseMonthCard
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/MonthCardVo.java
View file @
949b1936
...
@@ -29,4 +29,10 @@ public class MonthCardVo {
...
@@ -29,4 +29,10 @@ public class MonthCardVo {
* 月享卡类型:1.月享卡(单商品购买);2.月享卡(多商品购买);3.普通月卡
* 月享卡类型:1.月享卡(单商品购买);2.月享卡(多商品购买);3.普通月卡
*/
*/
private
Integer
type
;
private
Integer
type
;
/**
* 是否使用月享卡2.0
* 1 是
* 0 否
*/
private
int
isUseMonthCard
=
1
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
949b1936
...
@@ -35,6 +35,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -35,6 +35,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.ordercenter.enums.ProductTypeEnum
;
import
com.freemud.application.sdk.api.ordercenter.enums.ProductTypeEnum
;
...
@@ -314,9 +315,9 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -314,9 +315,9 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
//月享卡加购时,将券号传给促销
//月享卡加购时,将券号传给促销
if
(
null
!=
cartGoods
if
(
null
!=
cartGoods
&&
null
!=
cartGoods
.
getMonthCardInfo
()
&&
null
!=
cartGoods
.
getMonthCardInfo
(
)
&&
StringUtils
.
isNotEmpty
(
cartGoods
.
getMonthCardInfo
().
getCardCode
()
)
&&
StringUtils
.
isNotEmpty
(
cartGoods
.
getMonthCardInfo
().
getCardCode
()
)){
&&
1
==
cartGoods
.
getMonthCardInfo
().
getIsUseMonthCard
(
)){
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getMonthCardInfo
().
getCardCode
());
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getMonthCardInfo
().
getCardCode
());
coupons
.
add
(
calculationDiscountCoupon
);
coupons
.
add
(
calculationDiscountCoupon
);
...
@@ -404,6 +405,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -404,6 +405,7 @@ public class ShoppingCartMCoffeeServiceImpl {
clearCouponCodeRequestVo
.
setShopId
(
requestVo
.
getShopId
());
clearCouponCodeRequestVo
.
setShopId
(
requestVo
.
getShopId
());
clearCouponCodeRequestVo
.
setOrderType
(
requestVo
.
getOrderType
());
clearCouponCodeRequestVo
.
setOrderType
(
requestVo
.
getOrderType
());
clearCouponCodeRequestVo
.
setChannelType
(
requestVo
.
getChannelType
());
clearCouponCodeRequestVo
.
setChannelType
(
requestVo
.
getChannelType
());
clearCouponCodeRequestVo
.
setIsUseMonthCard
(
requestVo
.
getIsUseMonthCard
());
baseResponse
=
clearCouponInfoByCode
(
clearCouponCodeRequestVo
);
baseResponse
=
clearCouponInfoByCode
(
clearCouponCodeRequestVo
);
}
}
...
@@ -478,6 +480,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -478,6 +480,7 @@ public class ShoppingCartMCoffeeServiceImpl {
* @return
* @return
*/
*/
public
BaseResponse
clearCouponInfoByCode
(
ClearCouponCodeRequestVo
requestVo
){
public
BaseResponse
clearCouponInfoByCode
(
ClearCouponCodeRequestVo
requestVo
){
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
=
new
ShoppingCartGoodsResponseVo
();
if
(
StringUtils
.
isEmpty
(
requestVo
.
getShopId
()))
{
if
(
StringUtils
.
isEmpty
(
requestVo
.
getShopId
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
}
}
...
@@ -493,11 +496,20 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -493,11 +496,20 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
StringUtils
.
equals
(
cartGoods
.
getCouponCode
(),
requestVo
.
getRedundancyCouponCode
())){
if
(
StringUtils
.
equals
(
cartGoods
.
getCouponCode
(),
requestVo
.
getRedundancyCouponCode
())){
cartGoods
.
setCouponCode
(
""
);
cartGoods
.
setCouponCode
(
""
);
}
}
/**
* 是否继续使用月享卡优惠
*/
if
(
null
!=
cartGoods
.
getMonthCardInfo
()){
cartGoods
.
getMonthCardInfo
().
setIsUseMonthCard
(
requestVo
.
getIsUseMonthCard
());
ApiLog
.
info
(
"【清除券信息】是否使用月享卡优惠:{},月享卡实体:{}"
,
requestVo
.
getIsUseMonthCard
(),
JSONObject
.
toJSONString
(
cartGoods
));
}
}
}
cartGoodsList
=
cartGoodsList
.
stream
().
filter
(
cartGoods
->
!
StringUtils
.
equals
(
"9999"
,
cartGoods
.
getSkuId
())).
collect
(
Collectors
.
toList
());
cartGoodsList
=
cartGoodsList
.
stream
().
filter
(
cartGoods
->
!
StringUtils
.
equals
(
"9999"
,
cartGoods
.
getSkuId
())).
collect
(
Collectors
.
toList
());
//重新保存购物车
//重新保存购物车
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
return
ResponseUtil
.
success
();
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
ShoppingCartConstant
.
QUERY_INFO
,
null
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
/**
/**
...
@@ -1894,7 +1906,9 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1894,7 +1906,9 @@ public class ShoppingCartMCoffeeServiceImpl {
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getCouponCode
());
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getCouponCode
());
coupons
.
add
(
calculationDiscountCoupon
);
coupons
.
add
(
calculationDiscountCoupon
);
}
}
if
(
null
!=
cartGoods
.
getMonthCardInfo
()
&&
StringUtils
.
isNotEmpty
(
cartGoods
.
getMonthCardInfo
().
getCardCode
()))
{
if
(
null
!=
cartGoods
.
getMonthCardInfo
()
&&
StringUtils
.
isNotEmpty
(
cartGoods
.
getMonthCardInfo
().
getCardCode
())
&&
1
==
cartGoods
.
getMonthCardInfo
().
getIsUseMonthCard
())
{
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getMonthCardInfo
().
getCardCode
());
calculationDiscountCoupon
.
setCode
(
cartGoods
.
getMonthCardInfo
().
getCardCode
());
coupons
.
add
(
calculationDiscountCoupon
);
coupons
.
add
(
calculationDiscountCoupon
);
...
...
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