肿瘤古方 权限
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user