Commit 051ac3cf by huiyang.chen

fix 核销券bug

parent c537cce2
......@@ -32,9 +32,9 @@ public class McCafeCouponAdapter {
}
List<QueryOrdersResponse.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter(
account -> (getQueryOrderAccountType(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.COUPON)
|| getQueryOrderAccountType(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON)
|| getQueryOrderAccountType(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON)) && account.getPrice() != 0l).collect(Collectors.toList());
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.getPrice() != 0l).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(getOrderAccountType(accountBean.getType())))) {
if (QueryOrderAccountType.PRODUCT_COUPON.equals(getQueryOrderAccountType(OldOrderAccountType.getByCode(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(getOrderAccountType(accountBean.getType())))) {
}else if (QueryOrderAccountType.COUPON.equals(getQueryOrderAccountType(OldOrderAccountType.getByCode(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(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.COUPON)
|| getQueryOrderAccountType(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON)
|| getQueryOrderAccountType(getOrderAccountType(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON)) && account.getPrice() != 0l).collect(Collectors.toList());
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.getPrice() != 0l).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList) ) {
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment