From 1bde058be964cef0d3934a26808aa96789898554 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 20 Dec 2023 14:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=82=BF=E7=98=A4=E5=8F=A4=E6=96=B9=20?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/book/controller/BuyOrderController.java | 12 ++++++++++-- .../pay/alipay/service/impl/AliPayServiceImpl.java | 5 +++++ .../pay/weChatPay/service/impl/WxpayServiceImpl.java | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) 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 2cded2cc..b44d8597 100644 --- a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java +++ b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java @@ -208,6 +208,8 @@ public class BuyOrderController { //五运六气权限 List wylq = Arrays.asList(39,62,123,127); boolean wylq_check = false; + List prescript_b = Arrays.asList(43,62,124); + boolean prescriot_b_check = false; // 遍历商品总价计算 @@ -221,6 +223,9 @@ public class BuyOrderController { if(wylq.contains(buyOrderProduct.getProductId())){ wylq_check = true; } + if(prescript_b.contains(buyOrderProduct.getProductId())){ + prescriot_b_check = true; + } Integer productId = buyOrderProduct.getProductId(); int quantity = buyOrderProduct.getQuantity(); @@ -259,7 +264,7 @@ public class BuyOrderController { if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) { buyOrder.setOrderStatus(Constants.ORDER_STATUS_TO_BE_SHIPPED); MyUserEntity user = this.myUserService.getById(buyOrder.getUserId()); - if (usePeanutCoin(user, totalPrice,sj_check,scqq_check,wylq_check)) { + if (usePeanutCoin(user, totalPrice,sj_check,scqq_check,wylq_check,prescriot_b_check)) { // 更新订单状态 buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0"); recordTransaction(buyOrder, user, totalPrice); @@ -809,7 +814,7 @@ public class BuyOrderController { * @param totalPrice * @return */ - private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_check,boolean scqq_check,boolean wylq_check) { + 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) { user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice)); if (sj_check){ @@ -821,6 +826,9 @@ public class BuyOrderController { if(wylq_check){ user.setWylqPower(1); } + if(prescript_b_check){ + user.setPrescriptBPower(1); + } this.myUserService.updateById(user); return true; } diff --git a/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java b/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java index dcbfe9c0..db597a18 100644 --- a/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java +++ b/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java @@ -233,6 +233,11 @@ public class AliPayServiceImpl implements AliPayService { userService.updateById(userInfo); } + if(collect.contains(43)||collect.contains(62)||collect.contains(124)){ + MyUserEntity userInfo = userService.getById(orderEntity.getUserId()); + userInfo.setPrescriptBPower(1); + userService.updateById(userInfo); + } } diff --git a/src/main/java/com/peanut/modules/pay/weChatPay/service/impl/WxpayServiceImpl.java b/src/main/java/com/peanut/modules/pay/weChatPay/service/impl/WxpayServiceImpl.java index 8893b840..9bd704d6 100644 --- a/src/main/java/com/peanut/modules/pay/weChatPay/service/impl/WxpayServiceImpl.java +++ b/src/main/java/com/peanut/modules/pay/weChatPay/service/impl/WxpayServiceImpl.java @@ -160,6 +160,11 @@ public class WxpayServiceImpl extends ServiceImpl