puzhibing
2024-12-06 e1e015bfbeff67f27ab09ff1b381d8ad647b5a88
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -421,6 +421,7 @@
      paymentUserCoupon.setType(confirmOrder.getType());
      if(confirmOrder.getPaymentType() == 1){
         List<PaymentUserCouponVo> data = userCouponClient.getPaymentUserCoupon(paymentUserCoupon).getData();
         if(null != data){
         for (PaymentUserCouponVo couponInfo : data) {
            List<Integer> forGoodIds = couponInfo.getForGoodIds();
            //全部商品适用
@@ -450,6 +451,7 @@
               //代金券
               if(2 == couponInfo.getCouponType() || 3 == couponInfo.getCouponType()){
                  couponInfo.setAvailable(true);
                  }
               }
            }
         }
@@ -493,7 +495,7 @@
      for (ShoppingCart shoppingCart : list) {
         Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData();
         MyShoppingCartVo vo = new MyShoppingCartVo();
         vo.setId(shoppingCart.getId());
         vo.setId(shoppingCart.getId().toString());
         vo.setGoodsId(goods.getId());
         vo.setHomePicture(goods.getHomePagePicture());
         vo.setName(goods.getName());
@@ -510,6 +512,7 @@
         //获取支付价格
         Price price = getPrice(appUser, shoppingCart.getGoodsId(), shopId);
         if(null == price){
            price = new Price();
            //使用商品的基础价格
            price.setCash(1 == goods.getCashPayment() ? goods.getSellingPrice() : null);
            price.setPoint(1 == goods.getPointPayment() ? goods.getIntegral() : null);
@@ -829,7 +832,7 @@
         }
      }
      //判断运费支付是否足够
      if(2 == shoppingCartPayment.getFreightPaymentType() && expressFee.compareTo(BigDecimal.ZERO) > 0){
      if(null != shoppingCartPayment.getFreightPaymentType() && 2 == shoppingCartPayment.getFreightPaymentType() && expressFee.compareTo(BigDecimal.ZERO) > 0){
         BigDecimal balance = appUser.getBalance();
         if(balance.compareTo(expressFee) < 0){
            return R.fail("账户余额不足");