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 7d7d96fb..f265f1e6 100644 --- a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java +++ b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java @@ -285,6 +285,10 @@ public class BuyOrderController { //是否存在时辰取穴的权限触发商品 List scqq = Arrays.asList(133,134,135); boolean scqq_check = false; + //五运六气权限 + List wylq = Arrays.asList(39,62,123,127); + boolean wylq_check = false; + // 遍历商品总价计算 for (BuyOrderProduct buyOrderProduct : buyOrderProductList) { @@ -294,6 +298,9 @@ public class BuyOrderController { if(scqq.contains(buyOrderProduct.getProductId())){ scqq_check = true; } + if(wylq.contains(buyOrderProduct.getProductId())){ + wylq_check = true; + } Integer productId = buyOrderProduct.getProductId(); int quantity = buyOrderProduct.getQuantity(); @@ -332,7 +339,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)) { + if (usePeanutCoin(user, totalPrice,sj_check,scqq_check,wylq_check)) { // 更新订单状态 buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0"); recordTransaction(buyOrder, user, totalPrice); @@ -881,7 +888,7 @@ public class BuyOrderController { * @param totalPrice * @return */ - private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_check,boolean scqq_check) { + private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_check,boolean scqq_check,boolean wylq_check) { if (user.getPeanutCoin().compareTo(totalPrice) >= 0) { user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice)); if (sj_check){ @@ -890,6 +897,9 @@ public class BuyOrderController { if(scqq_check){ user.setTgdzPower(1); } + if(wylq_check){ + user.setWylqPower(1); + } this.myUserService.updateById(user); return true; } diff --git a/src/main/java/com/peanut/modules/book/entity/MyUserEntity.java b/src/main/java/com/peanut/modules/book/entity/MyUserEntity.java index e8fcb547..e13f089d 100644 --- a/src/main/java/com/peanut/modules/book/entity/MyUserEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/MyUserEntity.java @@ -92,6 +92,11 @@ public class MyUserEntity implements Serializable { */ private Integer tgdzPower; + /** + * 五运六气权限 + */ + private Integer wylqPower; + /** * 创建时间 */ 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 086d57d2..1fdba331 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 @@ -226,6 +226,11 @@ public class AliPayServiceImpl implements AliPayService { userInfo.setTgdzPower(1); userService.updateById(userInfo); } + if(collect.contains(39)||collect.contains(62)||collect.contains(123)||collect.contains(127)){ + MyUserEntity userInfo = userService.getById(orderEntity.getUserId()); + userInfo.setWylqPower(1); + userService.updateById(userInfo); + } } diff --git a/src/main/java/com/peanut/modules/pay/weChatPay/controller/WeChatPayController.java b/src/main/java/com/peanut/modules/pay/weChatPay/controller/WeChatPayController.java index 499075f5..c63989a4 100644 --- a/src/main/java/com/peanut/modules/pay/weChatPay/controller/WeChatPayController.java +++ b/src/main/java/com/peanut/modules/pay/weChatPay/controller/WeChatPayController.java @@ -162,6 +162,11 @@ public class WeChatPayController { userInfo.setTgdzPower(1); userService.updateById(userInfo); } + if(collect.contains(39)||collect.contains(62)||collect.contains(123)||collect.contains(127)){ + MyUserEntity userInfo = userService.getById(order.getUserId()); + userInfo.setWylqPower(1); + userService.updateById(userInfo); + } buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "0");