肿瘤古方 权限

This commit is contained in:
wangjinlei
2023-12-20 14:39:34 +08:00
parent c93679804b
commit 1bde058be9
3 changed files with 20 additions and 2 deletions

View File

@@ -208,6 +208,8 @@ public class BuyOrderController {
//五运六气权限
List<Integer> wylq = Arrays.asList(39,62,123,127);
boolean wylq_check = false;
List<Integer> 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;
}

View File

@@ -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);
}
}

View File

@@ -160,6 +160,11 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
userInfo.setWylqPower(1);
userService.updateById(userInfo);
}
if(collect.contains(43)||collect.contains(62)||collect.contains(124)){
MyUserEntity userInfo = userService.getById(order.getUserId());
userInfo.setPrescriptBPower(1);
userService.updateById(userInfo);
}
buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "0");