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
4e9a3b18
Commit
4e9a3b18
authored
Oct 21, 2020
by
huiyang.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 商品券入机修改
parent
7e77e840
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+20
-15
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
4e9a3b18
...
...
@@ -162,6 +162,10 @@ public class CouponDiscountCalculation {
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoods
:
shoppingCartGoodsDto
.
getProducts
())
{
//商品券商品
if
(
StringUtils
.
isNotEmpty
(
cartGoods
.
getCouponCode
()))
{
if
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
())
==
null
)
{
continue
;
}
List
<
ActivityDiscountsDto
>
productActivityDiscountsDtos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
discounts
))
{
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
couponDiscount
:
discounts
)
{
...
...
@@ -171,12 +175,24 @@ public class CouponDiscountCalculation {
activityDiscountsDto
.
setActivityName
(
couponDiscount
.
getActivityName
());
activityDiscountsDto
.
setActivityType
(
couponDiscount
.
getType
());
activityDiscountsDto
.
setDiscountAmount
(
0
-
couponDiscount
.
getDiscount
());
activityDiscountsDto
.
setExtendType
(
couponDiscount
.
getExtendType
());
if
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
())
==
null
)
{
activityDiscountsDto
.
setTenderId
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
}
Integer
extendType
=
couponDiscount
.
getExtendType
();
activityDiscountsDto
.
setExtendType
(
extendType
);
activityDiscountsDto
.
setTenderId
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
productActivityDiscountsDtos
.
add
(
activityDiscountsDto
);
if
(
extendType
!=
null
&&
extendType
==
4
)
{
//调用商品的接口获取商品键位
List
<
String
>
productIds
=
Arrays
.
asList
(
cartGoods
.
getSkuId
());
BaseResponse
<
Map
<
String
,
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
>>
baseResponse
=
itemService
.
getProducts
(
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
(),
productIds
,
false
,
shoppingCartInfoRequestVo
.
getMenuType
());
if
(
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
baseResponse
.
getCode
())
&&
baseResponse
.
getResult
()
!=
null
){
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
productBean
=
baseResponse
.
getResult
().
get
(
cartGoods
.
getSkuId
());
cartGoods
.
setCustomerCode
(
productBean
.
getCustomerCode
());
}
}
else
{
cartGoods
.
setCustomerCode
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
}
cartGoods
.
setTotalDiscountAmount
(-
activityDiscountsDto
.
getDiscountAmount
());
cartGoods
.
setSalePrice
(
0L
);
cartGoods
.
setActivityDiscountsDtos
(
productActivityDiscountsDtos
);
...
...
@@ -184,17 +200,6 @@ public class CouponDiscountCalculation {
}
}
if
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
())
==
null
)
{
continue
;
}
//调用商品的接口获取商品键位
List
<
String
>
productIds
=
Arrays
.
asList
(
cartGoods
.
getSkuId
());
BaseResponse
<
Map
<
String
,
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
>>
baseResponse
=
itemService
.
getProducts
(
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
(),
productIds
,
false
,
shoppingCartInfoRequestVo
.
getMenuType
());
if
(
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
baseResponse
.
getCode
())
&&
baseResponse
.
getResult
()
!=
null
){
GetMenuResponseDto
.
DataBean
.
RootNodeBean
.
ChildrenBeanFirst
.
ChildrenBeanSecond
.
ProductBean
productBean
=
baseResponse
.
getResult
().
get
(
cartGoods
.
getSkuId
());
cartGoods
.
setCustomerCode
(
productBean
.
getCustomerCode
());
}
}
}
...
...
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