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
051ac3cf
Commit
051ac3cf
authored
Sep 06, 2020
by
huiyang.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 核销券bug
parent
c537cce2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
56 deletions
+8
-56
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
+8
-56
No files found.
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
View file @
051ac3cf
...
...
@@ -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
;
}
...
...
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