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
f5ba0150
Commit
f5ba0150
authored
Feb 02, 2021
by
yu.sun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.freemud.com:order-group-application/order-group
parents
53b007f4
0a13adba
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
58 additions
and
7 deletions
+58
-7
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/coupon/CouponAvailableReqVo.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/enums/CouponRedeemChannel.java
+40
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/CouponService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponPromotionService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+12
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
+1
-0
shopping-cart-application-service/src/test/java/cn.freemud/service/CouponServiceTest.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/coupon/CouponAvailableReqVo.java
View file @
f5ba0150
...
...
@@ -32,6 +32,7 @@ public class CouponAvailableReqVo {
//金额
private
Integer
totalAmount
;
private
String
appId
;
private
String
redeemChannel
;
//购物车商品列表
private
List
<
Product
>
productList
;
}
shopping-cart-application-service/src/main/java/cn/freemud/enums/CouponRedeemChannel.java
0 → 100644
View file @
f5ba0150
package
cn
.
freemud
.
enums
;
public
enum
CouponRedeemChannel
{
PICKUP
(
"saas"
,
"pickup"
),
DELIVERY
(
"saasdelivery"
,
"delivery"
);
String
type
;
String
channel
;
CouponRedeemChannel
(
String
type
,
String
channel
)
{
this
.
type
=
type
;
this
.
channel
=
channel
;
}
public
static
String
getChannelByType
(
String
type
)
{
String
channel
=
""
;
for
(
CouponRedeemChannel
value
:
CouponRedeemChannel
.
values
())
{
if
(
value
.
getType
().
equals
(
type
))
{
channel
=
value
.
getChannel
();
break
;
}
}
return
channel
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getChannel
()
{
return
channel
;
}
public
void
setChannel
(
String
channel
)
{
this
.
channel
=
channel
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/CouponService.java
View file @
f5ba0150
...
...
@@ -80,7 +80,7 @@ public interface CouponService {
* @param cartGoods
* @return
*/
ActivityClassifyCouponBean
availableCoupon
(
List
<
CartGoods
>
cartGoods
,
String
partnerId
,
String
userId
,
String
storeId
,
String
couponCode
,
boolean
hasGoodsCoupon
,
Integer
orderType
,
int
isNew
,
String
appId
);
ActivityClassifyCouponBean
availableCoupon
(
List
<
CartGoods
>
cartGoods
,
String
partnerId
,
String
userId
,
String
storeId
,
String
couponCode
,
boolean
hasGoodsCoupon
,
Integer
orderType
,
int
isNew
,
String
appId
,
String
MenuType
);
/**
* 获取卡券服务商户密钥
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponPromotionService.java
View file @
f5ba0150
...
...
@@ -59,7 +59,7 @@ public class CouponPromotionService implements IPromotionService {
hasGoodssCoupon
,
couponPromotionVO
.
getOrderType
(),
0
,
shoppingCartInfoRequestVo
.
getAppId
()
);
shoppingCartInfoRequestVo
.
getAppId
()
,
shoppingCartInfoRequestVo
.
getMenuType
()
);
if
(
Objects
.
equals
(
activityClassifyCouponBean
,
null
))
{
// 构建一个空得订单券信息
activityClassifyCouponBean
=
createEmptyActivityCouponBean
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
f5ba0150
...
...
@@ -62,6 +62,7 @@ import com.freemud.card.sdk.vo.coupon.CreateCouponVo;
import
com.freemud.card.sdk.vo.coupon.request.MemberAddCouponVo
;
import
com.freemud.card.sdk.vo.coupon.response.MemberBaseRespVo
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
...
...
@@ -420,7 +421,7 @@ public class CouponServiceImpl implements CouponService {
,
boolean
hasGoodsCoupon
,
Integer
orderType
,
int
isNew
,
String
appId
)
{
,
String
appId
,
String
menuType
)
{
GetMemberCouponListRequestDto
getMemberCouponListRequestDto
=
new
GetMemberCouponListRequestDto
(
partnerId
,
userId
);
getMemberCouponListRequestDto
.
setStatusFlags
(
Arrays
.
asList
(
CouponStatus
.
STATUS_0
.
getCode
()));
getMemberCouponListRequestDto
.
setPageNum
(
1
);
...
...
@@ -459,14 +460,14 @@ public class CouponServiceImpl implements CouponService {
}
}
});
List
<
CouponStateVo
>
couponStateList
=
buildAvailiableCoupons
(
cartGoods
,
partnerId
,
storeId
,
couponCodes
,
isNew
,
appId
);
List
<
CouponStateVo
>
couponStateList
=
buildAvailiableCoupons
(
cartGoods
,
partnerId
,
storeId
,
couponCodes
,
isNew
,
appId
,
menuType
);
if
(
CollectionUtils
.
isNotEmpty
(
couponStateList
))
{
return
returnSuccessAvailiableCoupons
(
couponCode
,
hasGoodsCoupon
,
availableCouponResponseVo
,
usableCoupons
,
disableCoupons
,
memberCouponMap
,
couponStateList
);
}
return
null
;
}
private
List
<
CouponStateVo
>
buildAvailiableCoupons
(
List
<
CartGoods
>
cartGoods
,
String
partnerId
,
String
storeId
,
List
<
String
>
couponCodes
,
int
isNew
,
String
appId
)
{
private
List
<
CouponStateVo
>
buildAvailiableCoupons
(
List
<
CartGoods
>
cartGoods
,
String
partnerId
,
String
storeId
,
List
<
String
>
couponCodes
,
int
isNew
,
String
appId
,
String
menuType
)
{
String
appSecret
=
getAppSecret
(
partnerId
);
// 最大15一提交
int
maxNum
=
15
;
...
...
@@ -484,6 +485,14 @@ public class CouponServiceImpl implements CouponService {
couponAvailableReqVo
.
setTotalAmount
(
Integer
.
valueOf
(
totalAmount
+
""
));
couponAvailableReqVo
.
setProductList
(
productList
);
couponAvailableReqVo
.
setChannelCodeList
(
commonService
.
getOrgCodes
(
partnerId
,
storeId
));
if
(
StringUtils
.
isNotBlank
(
menuType
))
{
String
code
=
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
();
String
channel
=
CouponRedeemChannel
.
getChannelByType
(
code
);
if
(
StringUtils
.
isNotBlank
(
channel
))
{
couponAvailableReqVo
.
setRedeemChannel
(
channel
);
}
}
// 构建计算SDK
List
<
CouponStateVo
>
couponStateList
=
Lists
.
newArrayList
();
for
(
int
j
=
0
;
j
<=
count
;
j
++)
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
f5ba0150
...
...
@@ -973,7 +973,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
List
<
CartGoods
>
cartGoodsList
=
orderItemList
.
stream
().
map
(
each
->
convert2ShopCartGoods
(
each
)).
collect
(
toList
());
ActivityClassifyCouponBean
activityClassifyCouponBean
=
couponService
.
availableCoupon
(
cartGoodsList
,
partnerId
,
memberId
,
request
.
getStoreId
(),
""
,
false
,
request
.
getOrderType
(),
0
,
""
);
,
memberId
,
request
.
getStoreId
(),
""
,
false
,
request
.
getOrderType
(),
0
,
""
,
""
);
if
(
activityClassifyCouponBean
!=
null
&&
CollectionUtils
.
isNotEmpty
(
activityClassifyCouponBean
.
getUsableCoupons
())){
List
<
GetMemberInfoResponseVo
.
Coupon
>
coupons
=
activityClassifyCouponBean
.
getUsableCoupons
().
stream
().
map
(
each
->
convert2MemberCoupon
(
each
)).
collect
(
toList
());
responseData
.
setCoupons
(
coupons
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/CouponSharingService.java
View file @
f5ba0150
...
...
@@ -59,6 +59,7 @@ public class CouponSharingService {
,
couponPromotionVO
.
getOrderType
()
,
1
,
shoppingCartInfoRequestVo
.
getAppId
()
,
shoppingCartInfoRequestVo
.
getMenuType
()
);
if
(
Objects
.
equals
(
activityClassifyCouponBean
,
null
))
{
// 构建一个空得订单券信息
...
...
shopping-cart-application-service/src/test/java/cn.freemud/service/CouponServiceTest.java
View file @
f5ba0150
...
...
@@ -133,7 +133,7 @@ public class CouponServiceTest {
List
<
CartGoods
>
cartGoods
=
Lists
.
newArrayList
();
CartGoods
cartGood
=
new
CartGoods
();
cartGoods
.
add
(
cartGood
);
ActivityClassifyCouponBean
activityClassifyCouponBean
=
couponService
.
availableCoupon
(
cartGoods
,
"1864"
,
"122424124"
,
"1011"
,
"88123124"
,
true
,
1
,
1
,
""
);
ActivityClassifyCouponBean
activityClassifyCouponBean
=
couponService
.
availableCoupon
(
cartGoods
,
"1864"
,
"122424124"
,
"1011"
,
"88123124"
,
true
,
1
,
1
,
""
,
""
);
assertTrue
(
activityClassifyCouponBean
.
getCouponNum
()
>=
1
);
}
...
...
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