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
02733c50
Commit
02733c50
authored
Sep 29, 2020
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接运费券
parent
602f31a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
+5
-0
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+4
-0
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
+13
-5
No files found.
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
View file @
02733c50
...
@@ -152,6 +152,11 @@ public class CreateOrderVo {
...
@@ -152,6 +152,11 @@ public class CreateOrderVo {
* 券码
* 券码
*/
*/
private
String
couponCode
;
private
String
couponCode
;
/**
* 运费券code
*/
private
String
freightCouponCode
;
/**
/**
* 版本号
* 版本号
*/
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
02733c50
...
@@ -54,6 +54,10 @@ public class ShoppingCartInfoRequestVo {
...
@@ -54,6 +54,10 @@ public class ShoppingCartInfoRequestVo {
*/
*/
private
String
couponCode
;
private
String
couponCode
;
/**
/**
* 运费券code
*/
private
String
freightCouponCode
;
/**
* 优惠券对应的活动号
* 优惠券对应的活动号
*/
*/
private
String
activityCode
;
private
String
activityCode
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
View file @
02733c50
...
@@ -480,7 +480,14 @@ public class CheckMCCafeOrder {
...
@@ -480,7 +480,14 @@ public class CheckMCCafeOrder {
.
buyMemberCard
(
null
)
.
buyMemberCard
(
null
)
.
menuType
(
createOrderVo
.
getMenuType
())
.
menuType
(
createOrderVo
.
getMenuType
())
.
build
();
.
build
();
List
<
MCCafeCouponVo
>
couponCodeList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
createOrderVo
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotBlank
(
createOrderVo
.
getCouponCode
()))
{
couponCodeList
.
add
(
new
MCCafeCouponVo
(
createOrderVo
.
getCouponCode
()));
}
if
(
StringUtils
.
isNotBlank
(
createOrderVo
.
getCouponCode
()))
{
couponCodeList
.
add
(
new
MCCafeCouponVo
(
createOrderVo
.
getFreightCouponCode
()));
}
if
(
CollectionUtils
.
isNotEmpty
(
couponCodeList
))
{
// 校验couponCode
// 校验couponCode
MCCafeCouponRequest
mcCafeCouponRequest
=
MCCafeCouponRequest
.
builder
()
MCCafeCouponRequest
mcCafeCouponRequest
=
MCCafeCouponRequest
.
builder
()
.
ver
(
Integer
.
valueOf
(
Version
.
VERSION_1
))
.
ver
(
Integer
.
valueOf
(
Version
.
VERSION_1
))
...
@@ -490,26 +497,27 @@ public class CheckMCCafeOrder {
...
@@ -490,26 +497,27 @@ public class CheckMCCafeOrder {
.
station_id
(
"1"
)
.
station_id
(
"1"
)
.
operator_id
(
createOrderVo
.
getUserId
())
.
operator_id
(
createOrderVo
.
getUserId
())
.
channel
(
UserLoginChannelEnum
.
ALIPAY
.
getCode
().
equals
(
userLoginInfoDto
.
getChannel
())?
MCCafeChannelEnum
.
MOCOFFEE_ZFB
.
getName
():
MCCafeChannelEnum
.
MOCOFFEE_WX
.
getName
())
.
channel
(
UserLoginChannelEnum
.
ALIPAY
.
getCode
().
equals
(
userLoginInfoDto
.
getChannel
())?
MCCafeChannelEnum
.
MOCOFFEE_ZFB
.
getName
():
MCCafeChannelEnum
.
MOCOFFEE_WX
.
getName
())
.
couponlist
(
Arrays
.
asList
(
new
MCCafeCouponVo
(
createOrderVo
.
getCouponCode
()))
)
.
couponlist
(
couponCodeList
)
.
sign
(
"skip"
)
.
sign
(
"skip"
)
.
build
();
.
build
();
McdNetBatchQueryResponse
mcdNetBatchQueryResponse
=
couponClientService
.
batchQuery
(
mcCafeCouponRequest
);
McdNetBatchQueryResponse
mcdNetBatchQueryResponse
=
couponClientService
.
batchQuery
(
mcCafeCouponRequest
);
if
(
mcdNetBatchQueryResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getStatusCode
())
if
(
mcdNetBatchQueryResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
mcdNetBatchQueryResponse
.
getCouponlist
()))
{
||
CollectionUtils
.
isEmpty
(
mcdNetBatchQueryResponse
.
getCouponlist
()))
{
LogUtil
.
error
(
"
该代金
券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
LogUtil
.
error
(
"
部分优惠
券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"
该代金
券当前不可用"
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"
部分优惠
券当前不可用"
);
}
else
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getStatusCode
()))
{
}
else
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getStatusCode
()))
{
if
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
()
!=
null
)
{
if
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
()
!=
null
)
{
LogUtil
.
error
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
LogUtil
.
error
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_name
()+
"当前不可用"
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_name
()+
"当前不可用"
);
}
else
{
}
else
{
LogUtil
.
error
(
"
该代金券暂
不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
LogUtil
.
error
(
"
部分优惠券暂时
不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"
该代金券暂
不可用"
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"
部分优惠券暂时
不可用"
);
}
}
}
}
String
activeCode
=
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_id
();
String
activeCode
=
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getCodeInfo
().
getAct_id
();
// 校验点餐方式,查询购物车接口内部已校验
// 校验点餐方式,查询购物车接口内部已校验
shoppingCartInfoRequestVo
.
setCouponCode
(
createOrderVo
.
getCouponCode
());
shoppingCartInfoRequestVo
.
setCouponCode
(
createOrderVo
.
getCouponCode
());
shoppingCartInfoRequestVo
.
setFreightCouponCode
(
createOrderVo
.
getFreightCouponCode
());
// 活动code
// 活动code
shoppingCartInfoRequestVo
.
setActivityCode
(
activeCode
);
shoppingCartInfoRequestVo
.
setActivityCode
(
activeCode
);
shoppingCartInfoRequestVo
.
setCardCode
(
createOrderVo
.
getCardCode
());
shoppingCartInfoRequestVo
.
setCardCode
(
createOrderVo
.
getCardCode
());
...
...
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