bug
This commit is contained in:
@@ -285,6 +285,10 @@ public class BuyOrderController {
|
|||||||
//是否存在时辰取穴的权限触发商品
|
//是否存在时辰取穴的权限触发商品
|
||||||
List<Integer> scqq = Arrays.asList(133,134,135);
|
List<Integer> scqq = Arrays.asList(133,134,135);
|
||||||
boolean scqq_check = false;
|
boolean scqq_check = false;
|
||||||
|
//五运六气权限
|
||||||
|
List<Integer> wylq = Arrays.asList(39,62,123,127);
|
||||||
|
boolean wylq_check = false;
|
||||||
|
|
||||||
|
|
||||||
// 遍历商品总价计算
|
// 遍历商品总价计算
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||||
@@ -294,6 +298,9 @@ public class BuyOrderController {
|
|||||||
if(scqq.contains(buyOrderProduct.getProductId())){
|
if(scqq.contains(buyOrderProduct.getProductId())){
|
||||||
scqq_check = true;
|
scqq_check = true;
|
||||||
}
|
}
|
||||||
|
if(wylq.contains(buyOrderProduct.getProductId())){
|
||||||
|
wylq_check = true;
|
||||||
|
}
|
||||||
|
|
||||||
Integer productId = buyOrderProduct.getProductId();
|
Integer productId = buyOrderProduct.getProductId();
|
||||||
int quantity = buyOrderProduct.getQuantity();
|
int quantity = buyOrderProduct.getQuantity();
|
||||||
@@ -332,7 +339,7 @@ public class BuyOrderController {
|
|||||||
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
||||||
buyOrder.setOrderStatus(Constants.ORDER_STATUS_TO_BE_SHIPPED);
|
buyOrder.setOrderStatus(Constants.ORDER_STATUS_TO_BE_SHIPPED);
|
||||||
MyUserEntity user = this.myUserService.getById(buyOrder.getUserId());
|
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");
|
buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0");
|
||||||
recordTransaction(buyOrder, user, totalPrice);
|
recordTransaction(buyOrder, user, totalPrice);
|
||||||
@@ -881,7 +888,7 @@ public class BuyOrderController {
|
|||||||
* @param totalPrice
|
* @param totalPrice
|
||||||
* @return
|
* @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) {
|
if (user.getPeanutCoin().compareTo(totalPrice) >= 0) {
|
||||||
user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice));
|
user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice));
|
||||||
if (sj_check){
|
if (sj_check){
|
||||||
@@ -890,6 +897,9 @@ public class BuyOrderController {
|
|||||||
if(scqq_check){
|
if(scqq_check){
|
||||||
user.setTgdzPower(1);
|
user.setTgdzPower(1);
|
||||||
}
|
}
|
||||||
|
if(wylq_check){
|
||||||
|
user.setWylqPower(1);
|
||||||
|
}
|
||||||
this.myUserService.updateById(user);
|
this.myUserService.updateById(user);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,11 @@ public class MyUserEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer tgdzPower;
|
private Integer tgdzPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 五运六气权限
|
||||||
|
*/
|
||||||
|
private Integer wylqPower;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -226,6 +226,11 @@ public class AliPayServiceImpl implements AliPayService {
|
|||||||
userInfo.setTgdzPower(1);
|
userInfo.setTgdzPower(1);
|
||||||
userService.updateById(userInfo);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,6 +162,11 @@ public class WeChatPayController {
|
|||||||
userInfo.setTgdzPower(1);
|
userInfo.setTgdzPower(1);
|
||||||
userService.updateById(userInfo);
|
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");
|
buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "0");
|
||||||
|
|||||||
Reference in New Issue
Block a user