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 8179a363..605f1077 100644 --- a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java +++ b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java @@ -250,6 +250,11 @@ public class BuyOrderController { totalPrice = totalPrice.subtract(buyOrder.getJfDeduction()==null?BigDecimal.ZERO:buyOrder.getJfDeduction()); + + if(buyOrder.getRealMoney().compareTo(totalPrice)!=0){ + return R.error("系统错误订单金额异常!"); + } + String orderSn = IdWorker.getTimeId().substring(0, 32); buyOrder.setOrderSn(orderSn); if(buyOrder.getAddressId()!=0){