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
29bd6766
Commit
29bd6766
authored
Mar 23, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加优惠券
parent
c87b9676
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
+5
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
+5
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
View file @
29bd6766
...
...
@@ -75,8 +75,11 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
else
{
//商品券->商品券ID换取商品
String
goodsId
=
StringUtils
.
isNotBlank
(
cartGoods
.
getSkuId
())
?
cartGoods
.
getSkuId
()
:
cartGoods
.
getSpuId
();
GetCalculationDiscountBO
.
CalculationDiscountCoupon
coupon
=
new
GetCalculationDiscountBO
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()));
coupon
.
setActivityCode
(
cartGoods
.
getActivityCode
());
String
couponCode
=
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
coupon
.
setCode
(
couponCode
);
if
(
discountResultBO
.
getValidCouponMap
()
!=
null
&&
discountResultBO
.
getValidCouponMap
().
get
(
couponCode
)
!=
null
){
coupon
.
setActivityCode
(
discountResultBO
.
getValidCouponMap
().
get
(
couponCode
).
getActiveCode
());
}
coupons
.
add
(
coupon
);
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
this
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
cartGoods
.
getCouponProductPrice
(),
cartGoods
.
getSpuId
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
View file @
29bd6766
...
...
@@ -84,8 +84,11 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
else
{
//商品券->商品券ID换取商品
String
goodsId
=
StringUtils
.
isNotBlank
(
cartGoods
.
getSkuId
())
?
cartGoods
.
getSkuId
()
:
cartGoods
.
getSpuId
();
GetCalculationDiscountBO
.
CalculationDiscountCoupon
coupon
=
new
GetCalculationDiscountBO
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()));
coupon
.
setActivityCode
(
cartGoods
.
getActivityCode
());
String
couponCode
=
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
coupon
.
setCode
(
couponCode
);
if
(
discountResultBO
.
getValidCouponMap
()
!=
null
&&
discountResultBO
.
getValidCouponMap
().
get
(
couponCode
)
!=
null
){
coupon
.
setActivityCode
(
discountResultBO
.
getValidCouponMap
().
get
(
couponCode
).
getActiveCode
());
}
coupons
.
add
(
coupon
);
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
this
.
setSpqDiscountGoods
(
calculationDiscountGoodsList
,
cartGoods
,
goodsId
,
cartGoods
.
getCouponProductPrice
(),
cartGoods
.
getSpuId
());
...
...
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