| | |
| | | private final MallElectronicFenceMapper mallElectronicFenceMapper; |
| | | private final MallMemberCouponMapper mallMemberCouponMapper; |
| | | private final MallGoodsCouponMapper mallGoodsCouponMapper; |
| | | private final CouponGoodsMapper couponGoodsMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | if(1 != state){ |
| | | throw new FebsException(mallMemberCoupon.getCouponName()+"无法使用"); |
| | | } |
| | | Long goodsId = mallMemberCoupon.getGoodsId(); |
| | | if(goodsId != sku.getGoodsId()){ |
| | | //卷是否和商品绑定 |
| | | Long skuGoodsId = sku.getGoodsId(); |
| | | Long couponId = mallMemberCoupon.getCouponId(); |
| | | List<CouponGoods> couponGoods = couponGoodsMapper.selectByGoodIdAndCouponId(skuGoodsId, couponId); |
| | | if(ObjectUtil.isEmpty(couponGoods)){ |
| | | throw new FebsException(sku.getGoodsName()+"无法使用"+mallMemberCoupon.getCouponName()); |
| | | } |
| | | // Long goodsId = mallMemberCoupon.getGoodsId(); |
| | | // if(goodsId != sku.getGoodsId()){ |
| | | // throw new FebsException(sku.getGoodsName()+"无法使用"+mallMemberCoupon.getCouponName()); |
| | | // } |
| | | MallGoodsCoupon mallGoodsCoupon = mallGoodsCouponMapper.selectById(mallMemberCoupon.getCouponId()); |
| | | if(ObjectUtil.isEmpty(mallGoodsCoupon)){ |
| | | throw new FebsException(mallGoodsCoupon.getName()+"无法使用"); |