Commit 3d180883 by 徐康

麦咖啡新增优惠券类型

parent f1db549e
...@@ -1362,6 +1362,9 @@ public class OrderSdkAdapter { ...@@ -1362,6 +1362,9 @@ public class OrderSdkAdapter {
case "SEED_PRODUCT_COUPON": case "SEED_PRODUCT_COUPON":
type = 37; type = 37;
break; break;
case "EVM_PRODUCT_COUPON":
type = 39;
break;
case "DISCOUNT_COUPON": case "DISCOUNT_COUPON":
type = 208; type = 208;
break; break;
...@@ -1990,6 +1993,9 @@ public class OrderSdkAdapter { ...@@ -1990,6 +1993,9 @@ public class OrderSdkAdapter {
case 37: case 37:
newOrderAccountType = OldOrderAccountType.SEED_PRODUCT_COUPON.getCode(); newOrderAccountType = OldOrderAccountType.SEED_PRODUCT_COUPON.getCode();
break; break;
case 39:
newOrderAccountType = OldOrderAccountType.EVM_PRODUCT_COUPON.getCode();
break;
case 208: case 208:
newOrderAccountType = OldOrderAccountType.DISCOUNT_COUPON.getCode(); newOrderAccountType = OldOrderAccountType.DISCOUNT_COUPON.getCode();
break; break;
......
...@@ -23,6 +23,7 @@ public enum OldOrderAccountType { ...@@ -23,6 +23,7 @@ public enum OldOrderAccountType {
COUPON(5, "代金券", "COUPON"), COUPON(5, "代金券", "COUPON"),
PRODUCT_COUPON(6, "商品券", "PRODUCT_COUPON"), PRODUCT_COUPON(6, "商品券", "PRODUCT_COUPON"),
SEED_PRODUCT_COUPON(37, "种子券", "SEED_PRODUCT_COUPON"), SEED_PRODUCT_COUPON(37, "种子券", "SEED_PRODUCT_COUPON"),
EVM_PRODUCT_COUPON(39, "EVM券", "EVM_PRODUCT_COUPON"),
DISCOUNT_COUPON(7, "折扣券", "DISCOUNT_COUPON"), DISCOUNT_COUPON(7, "折扣券", "DISCOUNT_COUPON"),
DRIVER_FEE(7, "骑手小费", "DRIVER_FEE"), DRIVER_FEE(7, "骑手小费", "DRIVER_FEE"),
WITH_ORDER_BUY_COUPON_FEE(10, "随单买月卡", "WITH_ORDER_BUY_COUPON_FEE"), WITH_ORDER_BUY_COUPON_FEE(10, "随单买月卡", "WITH_ORDER_BUY_COUPON_FEE"),
......
...@@ -25,6 +25,7 @@ public enum QueryOrderAccountType { ...@@ -25,6 +25,7 @@ public enum QueryOrderAccountType {
FREIGHT_COUPON("FREIGHT_COUPON", "运费券"), FREIGHT_COUPON("FREIGHT_COUPON", "运费券"),
PRODUCT_COUPON("PRODUCT_COUPON", "商品券"), PRODUCT_COUPON("PRODUCT_COUPON", "商品券"),
SEED_PRODUCT_COUPON("SEED_PRODUCT_COUPON", "种子券"), SEED_PRODUCT_COUPON("SEED_PRODUCT_COUPON", "种子券"),
EVM_PRODUCT_COUPON("EVM_PRODUCT_COUPON", "种子券"),
DISCOUNT_COUPON("DISCOUNT_COUPON", "折扣券"), DISCOUNT_COUPON("DISCOUNT_COUPON", "折扣券"),
DISCOUNT_AMOUNT("DISCOUNT_AMOUNT", "限时折扣金额"), DISCOUNT_AMOUNT("DISCOUNT_AMOUNT", "限时折扣金额"),
PREMIUM_EXCHANGE("PREMIUM_EXCHANGE", "加价购"), PREMIUM_EXCHANGE("PREMIUM_EXCHANGE", "加价购"),
......
...@@ -660,7 +660,7 @@ public class CouponAdapter { ...@@ -660,7 +660,7 @@ public class CouponAdapter {
public MCCafeCouponRequest convert2MCCafeCouponRequest(QueryOrdersResponseDto.DataBean.OrderBean orderBean, QueryOrdersResponseDto.DataBean.OrderBean.AccountBean accountBean, McdNetBatchQueryResponse.Coupon coupon) { public MCCafeCouponRequest convert2MCCafeCouponRequest(QueryOrdersResponseDto.DataBean.OrderBean orderBean, QueryOrdersResponseDto.DataBean.OrderBean.AccountBean accountBean, McdNetBatchQueryResponse.Coupon coupon) {
List<MCCafeProductRedeemVo> products = new ArrayList<>(); 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++) { for (int i = 0; i < orderBean.getProductList().size(); i++) {
QueryOrdersResponseDto.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i); QueryOrdersResponseDto.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i);
String pid = org.apache.commons.lang3.StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId(); String pid = org.apache.commons.lang3.StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId();
...@@ -691,7 +691,7 @@ public class CouponAdapter { ...@@ -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++) { for (int i = 0; i < orderBean.getProductList().size(); i++) {
QueryOrdersResponseDto.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i); QueryOrdersResponseDto.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i);
String pid = org.apache.commons.lang3.StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId(); String pid = org.apache.commons.lang3.StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId();
...@@ -703,7 +703,7 @@ public class CouponAdapter { ...@@ -703,7 +703,7 @@ public class CouponAdapter {
mcCafeProductRedeemVo.setSeq(i + 1); mcCafeProductRedeemVo.setSeq(i + 1);
products.add(mcCafeProductRedeemVo); 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) { if(null != coupon) {
McdNetCouponProductRespDto mcdNetCouponProductRespDto = coupon.getCodeInfo().getProducts().get(0); McdNetCouponProductRespDto mcdNetCouponProductRespDto = coupon.getCodeInfo().getProducts().get(0);
MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo(); MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo();
......
...@@ -2642,6 +2642,9 @@ public class OrderAdapter { ...@@ -2642,6 +2642,9 @@ public class OrderAdapter {
if (ActivityTypeEnum.TYPE_31.getCode().equals(activityType)) { if (ActivityTypeEnum.TYPE_31.getCode().equals(activityType)) {
return OldOrderAccountType.DISCOUNT_COUPON; return OldOrderAccountType.DISCOUNT_COUPON;
} }
if (ActivityTypeEnum.TYPE_39.getCode().equals(activityType)) {
return OldOrderAccountType.EVM_PRODUCT_COUPON;
}
if (ActivityTypeEnum.TYPE_PACKAGE.getCode().equals(activityType)) { if (ActivityTypeEnum.TYPE_PACKAGE.getCode().equals(activityType)) {
return OldOrderAccountType.PACK_AMOUNT; return OldOrderAccountType.PACK_AMOUNT;
} }
......
...@@ -33,6 +33,7 @@ public enum ActivityTypeEnum { ...@@ -33,6 +33,7 @@ public enum ActivityTypeEnum {
TYPE_34(34, "运费券"), TYPE_34(34, "运费券"),
TYPE_35(35, "买1赠3券"), TYPE_35(35, "买1赠3券"),
TYPE_37(37, "种子券"), TYPE_37(37, "种子券"),
TYPE_39(39, "EVM券"),
TYPE_5(5, "整单满金额折"), TYPE_5(5, "整单满金额折"),
TYPE_51(51, "每满金额折"), TYPE_51(51, "每满金额折"),
TYPE_52(52, "阶梯满金额折"), TYPE_52(52, "阶梯满金额折"),
......
...@@ -71,10 +71,11 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -71,10 +71,11 @@ public class CouponClientServiceImpl implements CouponClientService {
return null; return null;
} }
List<QueryOrdersResponseDto.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter( List<QueryOrdersResponseDto.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter(
account -> (orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.COUPON) account -> (OldOrderAccountType.COUPON.getCode().equals(account.getType())
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON) || OldOrderAccountType.PRODUCT_COUPON.getCode().equals(account.getType())
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON) || OldOrderAccountType.EVM_PRODUCT_COUPON.getCode().equals(account.getType())
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.FREIGHT_COUPON)) || OldOrderAccountType.DISCOUNT_COUPON.getCode().equals(account.getType())
|| OldOrderAccountType.FREIGHT_COUPON.getCode().equals(account.getType()))
).collect(Collectors.toList()); ).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList)) { if (CollectionUtils.isEmpty(accountList)) {
return null; return null;
...@@ -143,9 +144,10 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -143,9 +144,10 @@ public class CouponClientServiceImpl implements CouponClientService {
return null; return null;
} }
List<QueryOrdersResponseDto.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter( List<QueryOrdersResponseDto.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter(
account -> (OldOrderAccountType.PRODUCT_COUPON.equals(OldOrderAccountType.getByCode(account.getType())) account -> (OldOrderAccountType.PRODUCT_COUPON.getCode().equals(account.getType())
|| OldOrderAccountType.COUPON.equals(OldOrderAccountType.getByCode(account.getType())) || OldOrderAccountType.EVM_PRODUCT_COUPON.getCode().equals(account.getType())
|| OldOrderAccountType.DISCOUNT_COUPON.equals(OldOrderAccountType.getByCode(account.getType())) || OldOrderAccountType.COUPON.getCode().equals(account.getType())
|| OldOrderAccountType.DISCOUNT_COUPON.getCode().equals(account.getType())
)).collect(Collectors.toList()); )).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList)) { if (CollectionUtils.isEmpty(accountList)) {
return null; return null;
......
...@@ -43,9 +43,11 @@ public class McCafeCouponAdapter { ...@@ -43,9 +43,11 @@ public class McCafeCouponAdapter {
} }
List<QueryOrdersResponse.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter( List<QueryOrdersResponse.DataBean.OrderBean.AccountBean> accountList = orderBean.getAccountList().stream().filter(
account -> (getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.COUPON) account -> (OldOrderAccountType.COUPON.getCode().equals(account.getType())
|| getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON) || OldOrderAccountType.PRODUCT_COUPON.getCode().equals(account.getType())
|| getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON)) || 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()); ).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList) ) { if (CollectionUtils.isEmpty(accountList) ) {
return null; return null;
...@@ -78,7 +80,7 @@ public class McCafeCouponAdapter { ...@@ -78,7 +80,7 @@ public class McCafeCouponAdapter {
public MCCafeCouponRequest convert2MCCafeCouponRequest(QueryOrdersResponse.DataBean.OrderBean orderBean, QueryOrdersResponse.DataBean.OrderBean.AccountBean accountBean, McdNetBatchQueryResponse.Coupon coupon) { public MCCafeCouponRequest convert2MCCafeCouponRequest(QueryOrdersResponse.DataBean.OrderBean orderBean, QueryOrdersResponse.DataBean.OrderBean.AccountBean accountBean, McdNetBatchQueryResponse.Coupon coupon) {
List<MCCafeProductRedeemVo> products = new ArrayList<>(); 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++) { for (int i = 0; i < orderBean.getProductList().size(); i++) {
QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i); QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i);
String pid = StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId(); String pid = StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId();
...@@ -109,7 +111,7 @@ public class McCafeCouponAdapter { ...@@ -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++) { for (int i = 0; i < orderBean.getProductList().size(); i++) {
QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i); QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = orderBean.getProductList().get(i);
String pid = StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId(); String pid = StringUtils.isNotBlank(productBean.getSpecification()) ? productBean.getSpecification() : productBean.getProductId();
......
...@@ -36,6 +36,7 @@ public enum ActivityTypeEnum { ...@@ -36,6 +36,7 @@ public enum ActivityTypeEnum {
TYPE_32(32, "商品券"), TYPE_32(32, "商品券"),
TYPE_33(33, "换购券"), TYPE_33(33, "换购券"),
TYPE_37(37, "月享卡种子券"), TYPE_37(37, "月享卡种子券"),
TYPE_39(39, "EVM券"),
TYPE_5(5, "整单满金额折"), TYPE_5(5, "整单满金额折"),
TYPE_51(51, "每满金额折"), TYPE_51(51, "每满金额折"),
TYPE_52(52, "阶梯满金额折"), TYPE_52(52, "阶梯满金额折"),
......
...@@ -202,7 +202,6 @@ public class CalculationServiceImpl { ...@@ -202,7 +202,6 @@ public class CalculationServiceImpl {
}); });
for (int i = 0, len = cartGoodsList.size(); i < len; i++) { for (int i = 0, len = cartGoodsList.size(); i < len; i++) {
CartGoods cartGoods = cartGoodsList.get(i); CartGoods cartGoods = cartGoodsList.get(i);
// List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = shoppingCartConvertAdapter.convertCartGoods2DetailGoodsList(cartGoods, apportionGoodsList,duplicateGoodsMap);
List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = shoppingCartMccafeAdapter.convertCartGoods2DetailGoodsList(cartGoods, apportionGoodsList,duplicateGoodsMap); List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = shoppingCartMccafeAdapter.convertCartGoods2DetailGoodsList(cartGoods, apportionGoodsList,duplicateGoodsMap);
cartGoodsDetailDtoList.addAll(cartGoodsDetailDtos); cartGoodsDetailDtoList.addAll(cartGoodsDetailDtos);
} }
......
...@@ -154,10 +154,14 @@ public class CouponDiscountCalculation { ...@@ -154,10 +154,14 @@ public class CouponDiscountCalculation {
*/ */
public void updateShoppingCartGoodsApportion(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo){ public void updateShoppingCartGoodsApportion(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo){
if (calculationDiscountResult == null || CollectionUtils.isEmpty(calculationDiscountResult.getDiscounts()) if (calculationDiscountResult == null
|| !calculationDiscountResult.getDiscounts().stream().anyMatch(discount -> (ActivityTypeEnum.TYPE_3.getCode().equals(discount.getType()) || CollectionUtils.isEmpty(calculationDiscountResult.getDiscounts())
||(ActivityTypeEnum.TYPE_31.getCode().equals(discount.getType())) || (ActivityTypeEnum.TYPE_32.getCode().equals(discount.getType())) || !calculationDiscountResult.getDiscounts().stream().anyMatch(
||(ActivityTypeEnum.TYPE_37.getCode().equals(discount.getType()))))) { 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; return;
} }
Map<String, Integer> extendTypeMap = calculationDiscountResult.getDiscounts().stream().filter(o -> o.getExtendType() != null) Map<String, Integer> extendTypeMap = calculationDiscountResult.getDiscounts().stream().filter(o -> o.getExtendType() != null)
...@@ -168,9 +172,12 @@ public class CouponDiscountCalculation { ...@@ -168,9 +172,12 @@ public class CouponDiscountCalculation {
if (CollectionUtils.isEmpty(couponDiscounts)) { if (CollectionUtils.isEmpty(couponDiscounts)) {
return; return;
} }
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount> discounts = couponDiscounts.stream().filter(discount -> (ActivityTypeEnum.TYPE_3.getCode().equals(discount.getType()) List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount> discounts = couponDiscounts.stream().filter(
|| (ActivityTypeEnum.TYPE_31.getCode().equals(discount.getType())) || (ActivityTypeEnum.TYPE_32.getCode().equals(discount.getType()) discount -> (ActivityTypeEnum.TYPE_3.getCode().equals(discount.getType())
|| (ActivityTypeEnum.TYPE_37.getCode().equals(discount.getType()))))).collect(Collectors.toList()); || 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)) { if (CollectionUtils.isEmpty(discounts)) {
return; return;
} }
......
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