mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
feat:购物车模块
This commit is contained in:
parent
861c47e09a
commit
e4b45afb19
@ -21,6 +21,6 @@ public class CartItemBo {
|
||||
*/
|
||||
@NotNull(message = "商品数量不能为空")
|
||||
@Min(value = 0, message = "商品数量不能为负数")
|
||||
private Integer num;
|
||||
private Integer number;
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CartItemChooseBo {
|
||||
public class CartItemCheckBo {
|
||||
|
||||
/**
|
||||
* 商品sku id
|
||||
@ -18,6 +18,6 @@ public class CartItemChooseBo {
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer choose = 1;
|
||||
private Integer check = 1;
|
||||
|
||||
}
|
@ -44,6 +44,8 @@ public class CartItemVo implements Serializable {
|
||||
*/
|
||||
private Long price;
|
||||
|
||||
private Long coupon = 0L;
|
||||
|
||||
/**
|
||||
* 小计
|
||||
*/
|
||||
@ -109,6 +111,14 @@ public class CartItemVo implements Serializable {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Long getCoupon() {
|
||||
return coupon;
|
||||
}
|
||||
|
||||
public void setCoupon(Long coupon) {
|
||||
this.coupon = coupon;
|
||||
}
|
||||
|
||||
public Long getSubTotal() {
|
||||
long total = 0;
|
||||
if (price != null && number != null) {
|
||||
|
@ -20,6 +20,8 @@ public class CartVo implements Serializable {
|
||||
|
||||
private Long totalPrice;
|
||||
|
||||
private Long totalCoupon;
|
||||
|
||||
public List<CartItemVo> getItems() {
|
||||
return items;
|
||||
}
|
||||
@ -51,4 +53,16 @@ public class CartVo implements Serializable {
|
||||
public void setTotalPrice(Long totalPrice) {
|
||||
this.totalPrice = totalPrice;
|
||||
}
|
||||
|
||||
public Long getTotalCoupon() {
|
||||
long total = 0L;
|
||||
// if (items != null && items.size() > 0) {
|
||||
// total = items.stream().filter(CartItemVo::isChecked).mapToLong(CartItemVo::getCoupon).sum();
|
||||
// }
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotalCoupon(Long totalCoupon) {
|
||||
this.totalCoupon = totalCoupon;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user