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
60ab0a39
Commit
60ab0a39
authored
Sep 06, 2020
by
huiyang.chen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2020/8/6-McCafe-会阳' into feature-2020/9/6-fabu-huiyang
parents
af70e3d8
051ac3cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
70 deletions
+10
-70
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
+8
-56
order-management/src/main/java/cn/freemud/management/service/handle/CouponHandle.java
+2
-0
order-management/src/main/java/cn/freemud/management/service/handle/OrderVerifyHandle.java
+0
-14
No files found.
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
View file @
60ab0a39
...
...
@@ -32,9 +32,9 @@ public class McCafeCouponAdapter {
}
List
<
QueryOrdersResponse
.
DataBean
.
OrderBean
.
AccountBean
>
accountList
=
orderBean
.
getAccountList
().
stream
().
filter
(
account
->
(
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
))
&&
account
.
getPrice
()
!=
0
l
).
collect
(
Collectors
.
toList
());
account
->
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
))
&&
account
.
getPrice
()
!=
0
l
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
accountList
)
)
{
return
null
;
}
...
...
@@ -46,7 +46,7 @@ public class McCafeCouponAdapter {
public
MCCafeCouponRequest
convert2MCCafeCouponRequest
(
QueryOrdersResponse
.
DataBean
.
OrderBean
orderBean
,
QueryOrdersResponse
.
DataBean
.
OrderBean
.
AccountBean
accountBean
)
{
List
<
MCCafeProductRedeemVo
>
products
=
new
ArrayList
<>();
//商品券核销核销参数
if
(
QueryOrderAccountType
.
PRODUCT_COUPON
.
equals
(
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
accountBean
.
getType
()))))
{
if
(
QueryOrderAccountType
.
PRODUCT_COUPON
.
equals
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
accountBean
.
getType
()))))
{
for
(
int
i
=
0
;
i
<
orderBean
.
getProductList
().
size
();
i
++)
{
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
orderBean
.
getProductList
().
get
(
i
);
String
pid
=
StringUtils
.
isNotBlank
(
productBean
.
getSpecification
())
?
productBean
.
getSpecification
()
:
productBean
.
getProductId
();
...
...
@@ -67,7 +67,7 @@ public class McCafeCouponAdapter {
}
}
}
}
else
if
(
QueryOrderAccountType
.
COUPON
.
equals
(
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
accountBean
.
getType
()))))
{
}
else
if
(
QueryOrderAccountType
.
COUPON
.
equals
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
accountBean
.
getType
()))))
{
for
(
int
i
=
0
;
i
<
orderBean
.
getProductList
().
size
();
i
++)
{
QueryOrdersResponse
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
orderBean
.
getProductList
().
get
(
i
);
String
pid
=
StringUtils
.
isNotBlank
(
productBean
.
getSpecification
())
?
productBean
.
getSpecification
()
:
productBean
.
getProductId
();
...
...
@@ -115,54 +115,6 @@ public class McCafeCouponAdapter {
}
/**
* 将促销的枚举 ActivityTypeEnum 和orderAccountType 关联映射
*/
public
OldOrderAccountType
getOrderAccountType
(
Integer
activityType
)
{
if
(
ActivityTypeEnum
.
TYPE_1
.
getCode
().
equals
(
activityType
)
||
ActivityTypeEnum
.
TYPE_11
.
getCode
().
equals
(
activityType
)
||
ActivityTypeEnum
.
TYPE_12
.
getCode
().
equals
(
activityType
)
||
ActivityTypeEnum
.
TYPE_13
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
BUY_DISCOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_3
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
COUPON
;
}
if
(
ActivityTypeEnum
.
TYPE_2
.
getCode
().
equals
(
activityType
)
||
ActivityTypeEnum
.
TYPE_21
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
DISCOUNT_AMOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
PREMIUM_EXCHANGE
;
}
if
(
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
PRODUCT_COUPON
;
}
if
(
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
DISCOUNT_COUPON
;
}
if
(
ActivityTypeEnum
.
TYPE_PACKAGE
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
PACK_AMOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_DELIVERY
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
DELIVERY_AMOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_61
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
BUYM_SENDN
;
}
if
(
ActivityTypeEnum
.
TYPE_53
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
SECOND_DISCOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_211
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
SET_MEAL
;
}
if
(
ActivityTypeEnum
.
TYPE_104
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
XY_DISCOUNT
;
}
if
(
ActivityTypeEnum
.
TYPE_14
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
FULL_DISTRIBUTION_FEE
;
}
if
(
ActivityTypeEnum
.
TYPE_320
.
getCode
().
equals
(
activityType
)){
return
OldOrderAccountType
.
MEMBER_PRICE_DISCOUNT
;
}
return
OldOrderAccountType
.
BUYM_SENDN
;
}
public
List
<
MCCafeCouponLockRequest
>
convertOrderBean2UnlockCoupon
(
QueryOrdersResponse
.
DataBean
.
OrderBean
orderBean
)
{
...
...
@@ -170,9 +122,9 @@ public class McCafeCouponAdapter {
return
null
;
}
List
<
QueryOrdersResponse
.
DataBean
.
OrderBean
.
AccountBean
>
accountList
=
orderBean
.
getAccountList
().
stream
().
filter
(
account
->
(
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
getQueryOrderAccountType
(
getOrderAccountTyp
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
))
&&
account
.
getPrice
()
!=
0
l
).
collect
(
Collectors
.
toList
());
account
->
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCod
e
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
))
&&
account
.
getPrice
()
!=
0
l
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
accountList
)
)
{
return
null
;
}
...
...
order-management/src/main/java/cn/freemud/management/service/handle/CouponHandle.java
View file @
60ab0a39
...
...
@@ -37,7 +37,9 @@ public class CouponHandle {
for
(
MCCafeCouponRequest
mcCafeCouponRequest:
list
)
{
//重试3次
for
(
int
i
=
2
;
i
>=
0
;
i
--)
{
log
.
info
(
"核销券码入参:{}"
,
JSONObject
.
toJSONString
(
mcCafeCouponRequest
));
CouponRedeemResponse
redeem
=
couponOfflineMCCafeClient
.
redeem
(
mcCafeCouponRequest
);
log
.
info
(
"核销券码出参:{}"
,
JSONObject
.
toJSONString
(
redeem
));
if
(
RESPONSE_SUCCESS
.
equals
(
redeem
.
getStatusCode
()))
{
break
;
}
...
...
order-management/src/main/java/cn/freemud/management/service/handle/OrderVerifyHandle.java
View file @
60ab0a39
...
...
@@ -264,20 +264,6 @@ public class OrderVerifyHandle {
&&
orderBean
.
getRefundList
().
get
(
orderBean
.
getRefundList
().
size
()
-
1
).
getStatus
()
!=
1
)
{
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_REFUND_NOT_APPLY
);
}
//订单是否支持退款
boolean
isCanRefund
=
false
;
//订单
boolean
isRefundDeliveryFee
=
false
;
//saas渠道订单,已完成的订单不能操作, 商户配置已完成订单可退款可退款
if
(
ObjectUtils
.
equals
(
orderBean
.
getSource
(),
OrderSource
.
SAAS
.
getSource
()))
{
isCanRefund
=
getRefundConfig
(
orderBean
);
if
(!
isCanRefund
)
{
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_HAD_AFFIRM_CAN_NOT_REFUND
);
}
}
if
(
isCanRefund
)
{
orderBean
.
setAmount
(
getRefundAmount
(
orderBean
,
isRefundDeliveryFee
).
longValue
());
}
return
ResponseUtil
.
success
();
}
...
...
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