解决一个可能导致优惠券在购物车条件不满足就可以选择优惠券的问题
This commit is contained in:
parent
a2fd6dd8d1
commit
7e58b98e74
@ -19,6 +19,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购物车视图
|
* 购物车视图
|
||||||
@ -147,4 +148,16 @@ public class TradeDTO implements Serializable {
|
|||||||
public TradeDTO() {
|
public TradeDTO() {
|
||||||
this(CartTypeEnum.CART);
|
this(CartTypeEnum.CART);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤购物车中已选择的sku
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<CartSkuVO> getCheckedSkuList() {
|
||||||
|
if (skuList != null && !skuList.isEmpty()) {
|
||||||
|
return skuList.stream().filter(CartSkuVO::getChecked).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return skuList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ public class CouponRender implements CartRenderStep {
|
|||||||
if (memberCoupon == null) {
|
if (memberCoupon == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<CartSkuVO> filterSku = filterSkuVo(tradeDTO.getSkuList(), memberCoupon);
|
List<CartSkuVO> filterSku = filterSkuVo(tradeDTO.getCheckedSkuList(), memberCoupon);
|
||||||
if (filterSku == null || filterSku.isEmpty()) {
|
if (filterSku == null || filterSku.isEmpty()) {
|
||||||
tradeDTO.getCantUseCoupons().add(new MemberCouponVO(memberCoupon,
|
tradeDTO.getCantUseCoupons().add(new MemberCouponVO(memberCoupon,
|
||||||
"购物车中没有满足优惠券使用范围的优惠券"));
|
"购物车中没有满足优惠券使用范围的优惠券"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user