Commit 3d180883 by 徐康

麦咖啡新增优惠券类型

parent f1db549e
......@@ -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;
......
......@@ -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"),
......
......@@ -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", "加价购"),
......
......@@ -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();
......
......@@ -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;
}
......
......@@ -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, "阶梯满金额折"),
......
......@@ -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;
......
......@@ -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();
......
......@@ -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, "阶梯满金额折"),
......
......@@ -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);
}
......
......@@ -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;
}
......
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