Authored by LUOXC

闪购寄存不可以用券

@@ -2,11 +2,13 @@ package com.yohoufo.order.charge; @@ -2,11 +2,13 @@ package com.yohoufo.order.charge;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
4 import com.yohobuy.ufo.model.order.constants.RegionEnum; 4 import com.yohobuy.ufo.model.order.constants.RegionEnum;
  5 +import com.yohobuy.ufo.model.order.constants.SkupType;
5 import com.yohobuy.ufo.model.promotion.UserCouponsBo; 6 import com.yohobuy.ufo.model.promotion.UserCouponsBo;
6 import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum; 7 import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum;
7 import com.yohobuy.ufo.model.promotion.constant.CouponUseLimitTypeEnum; 8 import com.yohobuy.ufo.model.promotion.constant.CouponUseLimitTypeEnum;
8 import com.yohoufo.order.charge.model.ChargeGoods; 9 import com.yohoufo.order.charge.model.ChargeGoods;
9 import com.yohoufo.order.charge.model.CouponMatchResult; 10 import com.yohoufo.order.charge.model.CouponMatchResult;
  11 +import com.yohoufo.order.utils.BuyerOrderUtils;
10 import com.yohoufo.order.utils.LoggerUtils; 12 import com.yohoufo.order.utils.LoggerUtils;
11 import org.apache.commons.collections.CollectionUtils; 13 import org.apache.commons.collections.CollectionUtils;
12 import org.slf4j.Logger; 14 import org.slf4j.Logger;
@@ -155,13 +157,23 @@ public class CouponRuleMatcher { @@ -155,13 +157,23 @@ public class CouponRuleMatcher {
155 @Override 157 @Override
156 public boolean match(ChargeGoods chargeGoods, UserCouponsBo couponsBo) { 158 public boolean match(ChargeGoods chargeGoods, UserCouponsBo couponsBo) {
157 159
  160 + // 闪购寄存不可以用券 TODO 后台可控制
  161 + if (chargeGoods.getSkupType() == SkupType.QUICK_DELIVER && chargeGoods.isDepositRequirement()) {
  162 + return false;
  163 + }
  164 +
158 if (couponsBo.getSkupForbidType() == null){ 165 if (couponsBo.getSkupForbidType() == null){
159 return true; 166 return true;
160 } 167 }
161 168
  169 +
  170 +
162 if (Arrays.asList(couponsBo.getSkupForbidType().split(",")).contains(String.valueOf(chargeGoods.getAttributes()))){ 171 if (Arrays.asList(couponsBo.getSkupForbidType().split(",")).contains(String.valueOf(chargeGoods.getAttributes()))){
163 return false; 172 return false;
164 } 173 }
  174 +
  175 +
  176 +
165 return true; 177 return true;
166 } 178 }
167 } 179 }