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
3d180883
Commit
3d180883
authored
May 12, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
麦咖啡新增优惠券类型
parent
f1db549e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
24 deletions
+47
-24
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/adapter/OrderSdkAdapter.java
+6
-0
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/enums/OldOrderAccountType.java
+1
-0
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/enums/QueryOrderAccountType.java
+1
-0
order-application-service/src/main/java/cn/freemud/adapter/CouponAdapter.java
+3
-3
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+3
-0
order-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
+1
-0
order-application-service/src/main/java/cn/freemud/service/mccafe/impl/CouponClientServiceImpl.java
+10
-8
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
+7
-5
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+0
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+14
-7
No files found.
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/adapter/OrderSdkAdapter.java
View file @
3d180883
...
...
@@ -1362,6 +1362,9 @@ public class OrderSdkAdapter {
case
"SEED_PRODUCT_COUPON"
:
type
=
37
;
break
;
case
"EVM_PRODUCT_COUPON"
:
type
=
39
;
break
;
case
"DISCOUNT_COUPON"
:
type
=
208
;
break
;
...
...
@@ -1990,6 +1993,9 @@ public class OrderSdkAdapter {
case
37
:
newOrderAccountType
=
OldOrderAccountType
.
SEED_PRODUCT_COUPON
.
getCode
();
break
;
case
39
:
newOrderAccountType
=
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
();
break
;
case
208
:
newOrderAccountType
=
OldOrderAccountType
.
DISCOUNT_COUPON
.
getCode
();
break
;
...
...
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/enums/OldOrderAccountType.java
View file @
3d180883
...
...
@@ -23,6 +23,7 @@ public enum OldOrderAccountType {
COUPON
(
5
,
"代金券"
,
"COUPON"
),
PRODUCT_COUPON
(
6
,
"商品券"
,
"PRODUCT_COUPON"
),
SEED_PRODUCT_COUPON
(
37
,
"种子券"
,
"SEED_PRODUCT_COUPON"
),
EVM_PRODUCT_COUPON
(
39
,
"EVM券"
,
"EVM_PRODUCT_COUPON"
),
DISCOUNT_COUPON
(
7
,
"折扣券"
,
"DISCOUNT_COUPON"
),
DRIVER_FEE
(
7
,
"骑手小费"
,
"DRIVER_FEE"
),
WITH_ORDER_BUY_COUPON_FEE
(
10
,
"随单买月卡"
,
"WITH_ORDER_BUY_COUPON_FEE"
),
...
...
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/enums/QueryOrderAccountType.java
View file @
3d180883
...
...
@@ -25,6 +25,7 @@ public enum QueryOrderAccountType {
FREIGHT_COUPON
(
"FREIGHT_COUPON"
,
"运费券"
),
PRODUCT_COUPON
(
"PRODUCT_COUPON"
,
"商品券"
),
SEED_PRODUCT_COUPON
(
"SEED_PRODUCT_COUPON"
,
"种子券"
),
EVM_PRODUCT_COUPON
(
"EVM_PRODUCT_COUPON"
,
"种子券"
),
DISCOUNT_COUPON
(
"DISCOUNT_COUPON"
,
"折扣券"
),
DISCOUNT_AMOUNT
(
"DISCOUNT_AMOUNT"
,
"限时折扣金额"
),
PREMIUM_EXCHANGE
(
"PREMIUM_EXCHANGE"
,
"加价购"
),
...
...
order-application-service/src/main/java/cn/freemud/adapter/CouponAdapter.java
View file @
3d180883
...
...
@@ -660,7 +660,7 @@ public class CouponAdapter {
public
MCCafeCouponRequest
convert2MCCafeCouponRequest
(
QueryOrdersResponseDto
.
DataBean
.
OrderBean
orderBean
,
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
AccountBean
accountBean
,
McdNetBatchQueryResponse
.
Coupon
coupon
)
{
List
<
MCCafeProductRedeemVo
>
products
=
new
ArrayList
<>();
//商品券核销核销参数
if
(
QueryOrderAccountType
.
PRODUCT_COUPON
.
equals
(
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
accountBean
.
getType
())
)))
{
if
(
OldOrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
accountBean
.
getType
())
||
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
().
equals
(
accountBean
.
getType
(
)))
{
for
(
int
i
=
0
;
i
<
orderBean
.
getProductList
().
size
();
i
++)
{
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
orderBean
.
getProductList
().
get
(
i
);
String
pid
=
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
productBean
.
getSpecification
())
?
productBean
.
getSpecification
()
:
productBean
.
getProductId
();
...
...
@@ -691,7 +691,7 @@ public class CouponAdapter {
}
}
}
}
else
if
(
QueryOrderAccountType
.
COUPON
.
equals
(
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
accountBean
.
getType
())
)))
{
}
else
if
(
OldOrderAccountType
.
COUPON
.
getCode
().
equals
(
accountBean
.
getType
(
)))
{
for
(
int
i
=
0
;
i
<
orderBean
.
getProductList
().
size
();
i
++)
{
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
productBean
=
orderBean
.
getProductList
().
get
(
i
);
String
pid
=
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
productBean
.
getSpecification
())
?
productBean
.
getSpecification
()
:
productBean
.
getProductId
();
...
...
@@ -703,7 +703,7 @@ public class CouponAdapter {
mcCafeProductRedeemVo
.
setSeq
(
i
+
1
);
products
.
add
(
mcCafeProductRedeemVo
);
}
}
else
if
(
QueryOrderAccountType
.
FREIGHT_COUPON
.
equals
(
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
accountBean
.
getType
())
)))
{
}
else
if
(
OldOrderAccountType
.
FREIGHT_COUPON
.
getCode
().
equals
(
accountBean
.
getType
(
)))
{
if
(
null
!=
coupon
)
{
McdNetCouponProductRespDto
mcdNetCouponProductRespDto
=
coupon
.
getCodeInfo
().
getProducts
().
get
(
0
);
MCCafeProductRedeemVo
mcCafeProductRedeemVo
=
new
MCCafeProductRedeemVo
();
...
...
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
3d180883
...
...
@@ -2642,6 +2642,9 @@ public class OrderAdapter {
if
(
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
DISCOUNT_COUPON
;
}
if
(
ActivityTypeEnum
.
TYPE_39
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
EVM_PRODUCT_COUPON
;
}
if
(
ActivityTypeEnum
.
TYPE_PACKAGE
.
getCode
().
equals
(
activityType
))
{
return
OldOrderAccountType
.
PACK_AMOUNT
;
}
...
...
order-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
View file @
3d180883
...
...
@@ -33,6 +33,7 @@ public enum ActivityTypeEnum {
TYPE_34
(
34
,
"运费券"
),
TYPE_35
(
35
,
"买1赠3券"
),
TYPE_37
(
37
,
"种子券"
),
TYPE_39
(
39
,
"EVM券"
),
TYPE_5
(
5
,
"整单满金额折"
),
TYPE_51
(
51
,
"每满金额折"
),
TYPE_52
(
52
,
"阶梯满金额折"
),
...
...
order-application-service/src/main/java/cn/freemud/service/mccafe/impl/CouponClientServiceImpl.java
View file @
3d180883
...
...
@@ -71,11 +71,12 @@ public class CouponClientServiceImpl implements CouponClientService {
return
null
;
}
List
<
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
AccountBean
>
accountList
=
orderBean
.
getAccountList
().
stream
().
filter
(
account
->
(
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
)
||
orderAdapter
.
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
FREIGHT_COUPON
))
).
collect
(
Collectors
.
toList
());
account
->
(
OldOrderAccountType
.
COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
DISCOUNT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
FREIGHT_COUPON
.
getCode
().
equals
(
account
.
getType
()))
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
accountList
))
{
return
null
;
}
...
...
@@ -143,9 +144,10 @@ public class CouponClientServiceImpl implements CouponClientService {
return
null
;
}
List
<
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
AccountBean
>
accountList
=
orderBean
.
getAccountList
().
stream
().
filter
(
account
->
(
OldOrderAccountType
.
PRODUCT_COUPON
.
equals
(
OldOrderAccountType
.
getByCode
(
account
.
getType
()))
||
OldOrderAccountType
.
COUPON
.
equals
(
OldOrderAccountType
.
getByCode
(
account
.
getType
()))
||
OldOrderAccountType
.
DISCOUNT_COUPON
.
equals
(
OldOrderAccountType
.
getByCode
(
account
.
getType
()))
account
->
(
OldOrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
DISCOUNT_COUPON
.
getCode
().
equals
(
account
.
getType
())
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
accountList
))
{
return
null
;
...
...
order-management/src/main/java/cn/freemud/management/adapter/McCafeCouponAdapter.java
View file @
3d180883
...
...
@@ -43,9 +43,11 @@ public class McCafeCouponAdapter {
}
List
<
QueryOrdersResponse
.
DataBean
.
OrderBean
.
AccountBean
>
accountList
=
orderBean
.
getAccountList
().
stream
().
filter
(
account
->
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
PRODUCT_COUPON
)
||
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
account
.
getType
())).
equals
(
QueryOrderAccountType
.
DISCOUNT_COUPON
))
account
->
(
OldOrderAccountType
.
COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
DISCOUNT_COUPON
.
getCode
().
equals
(
account
.
getType
())
||
OldOrderAccountType
.
FREIGHT_COUPON
.
getCode
().
equals
(
account
.
getType
()))
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
accountList
)
)
{
return
null
;
...
...
@@ -78,7 +80,7 @@ public class McCafeCouponAdapter {
public
MCCafeCouponRequest
convert2MCCafeCouponRequest
(
QueryOrdersResponse
.
DataBean
.
OrderBean
orderBean
,
QueryOrdersResponse
.
DataBean
.
OrderBean
.
AccountBean
accountBean
,
McdNetBatchQueryResponse
.
Coupon
coupon
)
{
List
<
MCCafeProductRedeemVo
>
products
=
new
ArrayList
<>();
//商品券核销核销参数
if
(
QueryOrderAccountType
.
PRODUCT_COUPON
.
equals
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
accountBean
.
getType
())
)))
{
if
(
OldOrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
accountBean
.
getType
())
||
OldOrderAccountType
.
EVM_PRODUCT_COUPON
.
getCode
().
equals
(
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
();
...
...
@@ -109,7 +111,7 @@ public class McCafeCouponAdapter {
}
}
}
}
else
if
(
QueryOrderAccountType
.
COUPON
.
equals
(
getQueryOrderAccountType
(
OldOrderAccountType
.
getByCode
(
accountBean
.
getType
())
)))
{
}
else
if
(
OldOrderAccountType
.
COUPON
.
getCode
().
equals
(
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
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
View file @
3d180883
...
...
@@ -36,6 +36,7 @@ public enum ActivityTypeEnum {
TYPE_32
(
32
,
"商品券"
),
TYPE_33
(
33
,
"换购券"
),
TYPE_37
(
37
,
"月享卡种子券"
),
TYPE_39
(
39
,
"EVM券"
),
TYPE_5
(
5
,
"整单满金额折"
),
TYPE_51
(
51
,
"每满金额折"
),
TYPE_52
(
52
,
"阶梯满金额折"
),
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
3d180883
...
...
@@ -202,7 +202,6 @@ public class CalculationServiceImpl {
});
for
(
int
i
=
0
,
len
=
cartGoodsList
.
size
();
i
<
len
;
i
++)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
// List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = shoppingCartConvertAdapter.convertCartGoods2DetailGoodsList(cartGoods, apportionGoodsList,duplicateGoodsMap);
List
<
ShoppingCartGoodsDto
.
CartGoodsDetailDto
>
cartGoodsDetailDtos
=
shoppingCartMccafeAdapter
.
convertCartGoods2DetailGoodsList
(
cartGoods
,
apportionGoodsList
,
duplicateGoodsMap
);
cartGoodsDetailDtoList
.
addAll
(
cartGoodsDetailDtos
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
3d180883
...
...
@@ -154,10 +154,14 @@ public class CouponDiscountCalculation {
*/
public
void
updateShoppingCartGoodsApportion
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
){
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getDiscounts
())
||
!
calculationDiscountResult
.
getDiscounts
().
stream
().
anyMatch
(
discount
->
(
ActivityTypeEnum
.
TYPE_3
.
getCode
().
equals
(
discount
.
getType
())
||(
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
discount
.
getType
()))
||
(
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
discount
.
getType
()))
||(
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
discount
.
getType
())))))
{
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getDiscounts
())
||
!
calculationDiscountResult
.
getDiscounts
().
stream
().
anyMatch
(
discount
->
ActivityTypeEnum
.
TYPE_3
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_39
.
getCode
().
equals
(
discount
.
getType
())))
{
return
;
}
Map
<
String
,
Integer
>
extendTypeMap
=
calculationDiscountResult
.
getDiscounts
().
stream
().
filter
(
o
->
o
.
getExtendType
()
!=
null
)
...
...
@@ -168,9 +172,12 @@ public class CouponDiscountCalculation {
if
(
CollectionUtils
.
isEmpty
(
couponDiscounts
))
{
return
;
}
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
>
discounts
=
couponDiscounts
.
stream
().
filter
(
discount
->
(
ActivityTypeEnum
.
TYPE_3
.
getCode
().
equals
(
discount
.
getType
())
||
(
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
discount
.
getType
()))
||
(
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
discount
.
getType
())
||
(
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
discount
.
getType
()))))).
collect
(
Collectors
.
toList
());
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
>
discounts
=
couponDiscounts
.
stream
().
filter
(
discount
->
(
ActivityTypeEnum
.
TYPE_3
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_31
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
discount
.
getType
())
||
ActivityTypeEnum
.
TYPE_39
.
getCode
().
equals
(
discount
.
getType
()))).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
discounts
))
{
return
;
}
...
...
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