修改下单
This commit is contained in:
@@ -49,6 +49,9 @@ public class OrderController {
|
||||
BookEntity bookEntity = bookService.getById(buyOrder.getAbroadBookId());
|
||||
BigDecimal totalPrice = buyOrder.getOrderMoney();
|
||||
//校验价格
|
||||
if (totalPrice.compareTo(new BigDecimal(0))<=0){
|
||||
return R.error("订单价格不能为0");
|
||||
}
|
||||
if (totalPrice.compareTo(bookEntity.getAbroadPrice())!=0){
|
||||
return R.error("订单价格异常");
|
||||
}
|
||||
@@ -77,8 +80,7 @@ public class OrderController {
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("orderSn", buyOrder.getOrderSn());
|
||||
result.put("money", totalPrice);
|
||||
result.put("orderId", buyOrder.getOrderId());
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user