积分商品不允许使用优惠券

This commit is contained in:
Chopper 2022-07-06 15:57:49 +08:00
parent 826c3a8f8f
commit 53f6910a34
2 changed files with 10 additions and 1 deletions

View File

@ -293,6 +293,8 @@ public enum ResultCode {
COUPON_MEMBER_NOT_EXIST(41015, "没有当前会员优惠券"),
COUPON_MEMBER_STATUS_ERROR(41016, "当前会员优惠券已过期/作废无法变更状态!"),
SPECIAL_CANT_USE(41020, "特殊商品不能使用优惠券,不能使用"),
/**
* 拼团

View File

@ -287,9 +287,10 @@ public class CartServiceImpl implements CartService {
/**
* 当购物车商品发生变更时取消已选择当优惠券
*
* @param tradeDTO
*/
private void remoteCoupon(TradeDTO tradeDTO){
private void remoteCoupon(TradeDTO tradeDTO) {
tradeDTO.setPlatformCoupon(null);
tradeDTO.setStoreCoupons(new HashMap<>());
}
@ -526,6 +527,12 @@ public class CartServiceImpl implements CartService {
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
//获取购物车然后重新写入优惠券
CartTypeEnum cartTypeEnum = getCartType(way);
//积分商品不允许使用优惠券
if (cartTypeEnum.equals(CartTypeEnum.POINTS)) {
throw new ServiceException(ResultCode.SPECIAL_CANT_USE);
}
TradeDTO tradeDTO = this.readDTO(cartTypeEnum);
MemberCouponSearchParams searchParams = new MemberCouponSearchParams();