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