KKSU
2024-01-02 63b5728cd6348f37cd95e21680e0a066956c641c
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -85,6 +85,7 @@
    private final MallElectronicFenceMapper mallElectronicFenceMapper;
    private final MallMemberCouponMapper mallMemberCouponMapper;
    private final MallGoodsCouponMapper mallGoodsCouponMapper;
    private final CouponGoodsMapper couponGoodsMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -197,10 +198,17 @@
                        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()+"无法使用");