前端+后端:完整接入订单确认的优惠劵计算

This commit is contained in:
YunaiV
2019-04-20 01:22:39 +08:00
parent cb07eb3f71
commit bc2bf52039
8 changed files with 42 additions and 16 deletions

View File

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

View File

@@ -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())

View File

@@ -24,6 +24,10 @@ public class UsersOrderConfirmCreateVO {
* 优惠劵列表 TODO 芋艿,后续改改
*/
private List<CouponCardAvailableBO> couponCards;
/**
* 优惠劵优惠金额
*/
private Integer couponCardDiscountTotal;
/**
* 商品分组
*