bug
This commit is contained in:
@@ -262,8 +262,16 @@ public class BuyOrderController {
|
|||||||
List<BuyOrderProduct> buyOrderProductList = buyOrder.getProductList();
|
List<BuyOrderProduct> buyOrderProductList = buyOrder.getProductList();
|
||||||
// 订单总金额
|
// 订单总金额
|
||||||
BigDecimal totalPrice = new BigDecimal(0);
|
BigDecimal totalPrice = new BigDecimal(0);
|
||||||
|
//是否存在手摸或脚模
|
||||||
|
List<Integer> sjc =Arrays.asList(128,129,130);
|
||||||
|
boolean sj_check = false;
|
||||||
|
|
||||||
// 遍历商品总价计算
|
// 遍历商品总价计算
|
||||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||||
|
if(sjc.contains(buyOrderProduct.getProductId())){
|
||||||
|
sj_check = true;
|
||||||
|
}
|
||||||
|
|
||||||
Integer productId = buyOrderProduct.getProductId();
|
Integer productId = buyOrderProduct.getProductId();
|
||||||
int quantity = buyOrderProduct.getQuantity();
|
int quantity = buyOrderProduct.getQuantity();
|
||||||
ShopProduct product = shopProductService.getById(productId);
|
ShopProduct product = shopProductService.getById(productId);
|
||||||
@@ -301,7 +309,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)) {
|
if (usePeanutCoin(user, totalPrice,sj_check)) {
|
||||||
// 更新订单状态
|
// 更新订单状态
|
||||||
buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0");
|
buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0");
|
||||||
recordTransaction(buyOrder, user, totalPrice);
|
recordTransaction(buyOrder, user, totalPrice);
|
||||||
@@ -818,9 +826,12 @@ public class BuyOrderController {
|
|||||||
* @param totalPrice
|
* @param totalPrice
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice) {
|
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_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){
|
||||||
|
user.setPointPower(1);
|
||||||
|
}
|
||||||
this.myUserService.updateById(user);
|
this.myUserService.updateById(user);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user