修改下单

This commit is contained in:
wuchunlei
2024-12-04 14:36:51 +08:00
parent 76730d890d
commit e6293ffbbd
2 changed files with 8 additions and 58 deletions

View File

@@ -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);
}