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
1fcb6fce
Commit
1fcb6fce
authored
Oct 27, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
失效的券购物车列表直接移除
parent
79eafc43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+21
-21
shopping-cart-application-service/src/test/java/cn.freemud/service/CartTest.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
1fcb6fce
...
@@ -91,31 +91,31 @@ public class CalculationSharingDiscountService {
...
@@ -91,31 +91,31 @@ public class CalculationSharingDiscountService {
if
(
null
==
checkSpqInfo
)
{
if
(
null
==
checkSpqInfo
)
{
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
remove
(
i
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
null
,
null
,
this
.
shoppingCartBaseService
);
//跑业务异常 商品券不存
////跑业务异常 商品券不存
//if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
// throw new ServiceException(ResponseResult.SHOPPING_CART_HG_COUPON_NOT_EXIST);
//} else {
// throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_NOT_EXIST);
//}
}
else
{
validCouponMap
.
put
(
spqId
,
checkSpqInfo
);
cartGoods
.
setName
(
checkSpqInfo
.
getCouponName
());
cartGoods
.
setSpuName
(
checkSpqInfo
.
getCouponName
());
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
checkSpqInfo
.
getCouponCode
());
coupon
.
setActivityCode
(
checkSpqInfo
.
getActiveCode
());
log
.
info
(
"coupons={},coupon={}"
,
JSON
.
toJSONString
(
coupons
),
JSON
.
toJSONString
(
coupon
));
coupons
.
add
(
coupon
);
// 添加商品券代表的商品放入促销
String
goodsId
=
StringUtils
.
isNotBlank
(
checkSpqInfo
.
getSkuId
())
?
checkSpqInfo
.
getSkuId
()
:
checkSpqInfo
.
getSpuId
();
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
th
row
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_HG_COUPON_NOT_EXIST
);
th
is
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
checkSpqInfo
.
getPrice
(),
cartGoods
.
getSpuId
()
);
}
else
{
}
else
{
th
row
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_COUPON_NOT_EXIST
);
th
is
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
checkSpqInfo
.
getPrice
()
);
}
}
}
}
validCouponMap
.
put
(
spqId
,
checkSpqInfo
);
cartGoods
.
setName
(
checkSpqInfo
.
getCouponName
());
cartGoods
.
setSpuName
(
checkSpqInfo
.
getCouponName
());
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
checkSpqInfo
.
getCouponCode
());
coupon
.
setActivityCode
(
checkSpqInfo
.
getActiveCode
());
log
.
info
(
"coupons={},coupon={}"
,
JSON
.
toJSONString
(
coupons
),
JSON
.
toJSONString
(
coupon
));
coupons
.
add
(
coupon
);
// 添加商品券代表的商品放入促销
String
goodsId
=
StringUtils
.
isNotBlank
(
checkSpqInfo
.
getSkuId
())
?
checkSpqInfo
.
getSkuId
():
checkSpqInfo
.
getSpuId
();
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
this
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
checkSpqInfo
.
getPrice
(),
cartGoods
.
getSpuId
());
}
else
{
this
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
checkSpqInfo
.
getPrice
());
}
}
}
}
}
...
...
shopping-cart-application-service/src/test/java/cn.freemud/service/CartTest.java
View file @
1fcb6fce
...
@@ -140,7 +140,7 @@ public class CartTest {
...
@@ -140,7 +140,7 @@ public class CartTest {
/**
/**
* 加价购商品
* 加价购商品
*/
*/
additionSharingService
.
equally
(
getShoppingCartGoodsApportionRequestVo
.
getShoppingCartInfoRequestVo
(),
null
,
discountResult
,
getShoppingCartGoodsApportionRequestVo
.
getPremiumExchangeActivity
());
additionSharingService
.
equally
(
getShoppingCartGoodsApportionRequestVo
.
getShoppingCartInfoRequestVo
(),
null
,
discountResult
,
getShoppingCartGoodsApportionRequestVo
.
getPremiumExchangeActivity
()
,
null
);
}
}
@Test
@Test
...
...
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