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
4731f5cc
Commit
4731f5cc
authored
Sep 22, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::add new field couponCode for getCartInfoByUser api
parent
6b658405
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletions
+48
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+47
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponProductVo.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
4731f5cc
...
...
@@ -326,6 +326,53 @@ public class CouponDiscountCalculation {
}
public
List
<
CouponAvailableReq
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
){
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
// List<String> couponList = new ArrayList<>();
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
List
<
CouponProductVo
>
productList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
cartGoods
.
forEach
(
cartGood
->
{
// if (StringUtils.isNotEmpty(cartGood.getCouponCode())) {
// couponList.add(cartGood.getCouponCode());
// res.setCouponCodes(couponList);
// }
if
(
CollectionUtils
.
isNotEmpty
(
cartGood
.
getProductComboList
()))
{
cartGood
.
getProductComboList
().
forEach
(
comboxGoods
->
{
CouponProductVo
couponProductVo
=
new
CouponProductVo
();
couponProductVo
.
setAmount
(
Integer
.
valueOf
(
comboxGoods
.
getAmount
().
toString
()));
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
productList
.
add
(
couponProductVo
);
});
}
if
(
CollectionUtils
.
isNotEmpty
(
cartGood
.
getProductGroupList
()))
{
cartGood
.
getProductGroupList
().
forEach
(
comboxGoods
->
{
CouponProductVo
couponProductVo
=
new
CouponProductVo
();
couponProductVo
.
setAmount
(
Integer
.
valueOf
(
comboxGoods
.
getAmount
().
toString
()));
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
productList
.
add
(
couponProductVo
);
});
}
});
res
.
setProductList
(
productList
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
productList
);
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
resList
.
add
(
res
);
}
return
resList
;
}
// public String getAppSecret(String partnerId) {
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponProductVo.java
View file @
4731f5cc
...
...
@@ -22,6 +22,6 @@ public class CouponProductVo {
private
String
productId
;
private
Integer
amount
;
private
Integer
quantity
;
private
String
couponCode
;
private
String
categoryCode
;
}
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