前端+后端:完整接入订单确认的优惠劵计算
This commit is contained in:
@@ -105,7 +105,7 @@ public class UsersCartController {
|
||||
}
|
||||
|
||||
@GetMapping("/confirm_create_order")
|
||||
public CommonResult<UsersOrderConfirmCreateVO> getConfirmCreateOrder(@RequestParam("couponCardId") Integer couponCardId) {
|
||||
public CommonResult<UsersOrderConfirmCreateVO> getConfirmCreateOrder(@RequestParam(value = "couponCardId", required = false) Integer couponCardId) {
|
||||
Integer userId = UserSecurityContextHolder.getContext().getUserId();
|
||||
// 获得购物车中选中的
|
||||
List<CartItemBO> cartItems = cartService.list(userId, true).getData();
|
||||
|
||||
@@ -94,7 +94,7 @@ public class UsersOrderController {
|
||||
@ApiOperation("确认创建订单")
|
||||
public CommonResult<UsersOrderConfirmCreateVO> getConfirmCreateOrder(@RequestParam("skuId") Integer skuId,
|
||||
@RequestParam("quantity") Integer quantity,
|
||||
@RequestParam("couponCardId") Integer couponCardId) {
|
||||
@RequestParam(value = "couponCardId", required = false) Integer couponCardId) {
|
||||
// 创建 CalcOrderPriceDTO 对象,并执行价格计算
|
||||
CalcOrderPriceDTO calcOrderPriceDTO = new CalcOrderPriceDTO()
|
||||
.setUserId(UserSecurityContextHolder.getContext().getUserId())
|
||||
|
||||
@@ -24,6 +24,10 @@ public class UsersOrderConfirmCreateVO {
|
||||
* 优惠劵列表 TODO 芋艿,后续改改
|
||||
*/
|
||||
private List<CouponCardAvailableBO> couponCards;
|
||||
/**
|
||||
* 优惠劵优惠金额
|
||||
*/
|
||||
private Integer couponCardDiscountTotal;
|
||||
/**
|
||||
* 商品分组
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user