From 81e2df077da0ce2cb4fa21b69529c2de8e1a2c0c Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 13 May 2024 14:41:50 +0800 Subject: [PATCH] =?UTF-8?q?jf=20=E6=B6=88=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../peanut/modules/book/controller/BuyOrderController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java index 6b955893..5e3fb3fc 100644 --- a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java +++ b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java @@ -289,7 +289,9 @@ public class BuyOrderController { buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "2"); } //记录用户虚拟币消费 - recordTransaction(buyOrder, user, totalPrice); + if(totalPrice.compareTo(BigDecimal.ZERO)>0){ + recordTransaction(buyOrder, user, totalPrice); + } //记录用户积分消费情况 if(buyOrder.getJfDeduction().compareTo(BigDecimal.ZERO) > 0){ recordJfTransaction(buyOrder, user, buyOrder.getJfDeduction()); @@ -848,6 +850,9 @@ public class BuyOrderController { */ private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice, boolean sj_check, boolean scqq_check, boolean wylq_check, boolean prescript_b_check) { if (user.getPeanutCoin().compareTo(totalPrice) >= 0) { + if(totalPrice.compareTo(BigDecimal.ZERO)==0){//纯积分支付,虚拟币不用支付 + return true; + } user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice)); if (sj_check){ user.setPointPower(1);