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
7fa1ef62
Commit
7fa1ef62
authored
Oct 31, 2020
by
yu.sun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-yu.sun-couponAvailable'
parents
76b74062
02426f4d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
12 deletions
+70
-12
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+8
-11
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
+60
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
7fa1ef62
...
@@ -464,7 +464,8 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -464,7 +464,8 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
String
>
couponCodes
=
new
ArrayList
<>();
List
<
String
>
couponCodes
=
new
ArrayList
<>();
couponCodes
.
add
(
deliveryFeeCoupon
);
couponCodes
.
add
(
deliveryFeeCoupon
);
couponCodes
.
add
(
moneyCoupon
);
couponCodes
.
add
(
moneyCoupon
);
List
<
CouponAvailableReq
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
List
<
CouponAvailableReqByCart
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
couponCodes
);
return
ResponseUtil
.
success
(
resList
);
return
ResponseUtil
.
success
(
resList
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
7fa1ef62
...
@@ -11,10 +11,7 @@ import cn.freemud.enums.*;
...
@@ -11,10 +11,7 @@ import cn.freemud.enums.*;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.CommonService
;
import
cn.freemud.service.CommonService
;
import
cn.freemud.service.impl.ItemServiceImpl
;
import
cn.freemud.service.impl.ItemServiceImpl
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq
;
import
cn.freemud.service.impl.mcoffee.entity.*
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp
;
import
cn.freemud.service.impl.mcoffee.entity.CouponProductVo
;
import
cn.freemud.service.impl.mcoffee.entity.CouponState
;
import
cn.freemud.service.thirdparty.CouponClient
;
import
cn.freemud.service.thirdparty.CouponClient
;
import
cn.freemud.service.thirdparty.CustomerExtendClient
;
import
cn.freemud.service.thirdparty.CustomerExtendClient
;
import
cn.freemud.utils.BarcodeUtil
;
import
cn.freemud.utils.BarcodeUtil
;
...
@@ -374,16 +371,16 @@ public class CouponDiscountCalculation {
...
@@ -374,16 +371,16 @@ public class CouponDiscountCalculation {
}
}
public
List
<
CouponAvailableReq
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
,
public
List
<
CouponAvailableReq
ByCart
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
,
List
<
String
>
couponCodes
){
List
<
String
>
couponCodes
){
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
List
<
CouponAvailableReq
ByCart
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
CouponAvailableReq
ByCart
res
=
new
CouponAvailableReqByCart
();
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setMerchantId
(
requestVo
.
getPartnerId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
res
.
setStoreId
(
requestVo
.
getStoreId
());
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
res
.
setCouponCodes
(
couponCodes
);
res
.
setCouponCodes
(
couponCodes
);
List
<
CouponProductVo
>
p
roductList
=
new
ArrayList
<>();
List
<
CouponProductVo
>
calculAmountP
roductList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
cartGoods
.
forEach
(
cartGood
->
{
cartGoods
.
forEach
(
cartGood
->
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
...
@@ -394,7 +391,7 @@ public class CouponDiscountCalculation {
...
@@ -394,7 +391,7 @@ public class CouponDiscountCalculation {
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
couponProductVo
.
setCategoryCode
(
null
);
p
roductList
.
add
(
couponProductVo
);
calculAmountP
roductList
.
add
(
couponProductVo
);
}
}
// if (CollectionUtils.isNotEmpty(cartGood.getProductComboList())) {
// if (CollectionUtils.isNotEmpty(cartGood.getProductComboList())) {
...
@@ -420,8 +417,8 @@ public class CouponDiscountCalculation {
...
@@ -420,8 +417,8 @@ public class CouponDiscountCalculation {
// });
// });
// }
// }
});
});
res
.
setProductList
(
productList
);
res
.
setProductList
(
cartGoods
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
p
roductList
);
Long
totalAmount
=
createProductRequest
(
cartGoods
,
calculAmountP
roductList
);
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
res
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
.
toString
()));
resList
.
add
(
res
);
resList
.
add
(
res
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CouponAvailableReqByCart.java
0 → 100644
View file @
7fa1ef62
package
cn
.
freemud
.
service
.
impl
.
mcoffee
.
entity
;
import
cn.freemud.entities.vo.CartGoods
;
import
lombok.Data
;
import
java.util.List
;
/**
* All rights Reserved, Designed By sunary.site
*
* @version v1.0
* @Title: IntelliJ IDEA
* @Package cn.freemud.service.impl.mcoffee.entity
* @Description: 请简单描述下这个类是做什么用的
* @author: yu.sun
* @date: 2020-10-26 13:59:32
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
*/
@Data
public
class
CouponAvailableReqByCart
{
/**
* 渠道id
*/
private
String
providerId
;
/**
* 商户号
*/
private
String
merchantId
;
private
String
city
;
private
String
storeId
;
/**
* 组织机构id列表(校验渠道限制)
*/
private
List
<
String
>
channelIdList
;
/**
* 组织机构code列表(校验渠道限制)
*/
private
List
<
String
>
channelCodeList
;
/**
* 券码列表
*/
private
List
<
String
>
couponCodes
;
private
Integer
totalAmount
;
/**
* 核销渠道 枚举: mocoffee_wx : 麦咖啡微信小程序 mocoffee_zfb : 麦咖啡支付宝小程序
*/
private
String
redeemChannel
;
/**
* 购物车商品列表
*/
private
List
<
CartGoods
>
productList
;
private
String
stationId
;
private
String
operatorId
;
}
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