Commit ca9e4c00 by ping.wu

list->map去重

parent 497130ed
......@@ -363,7 +363,7 @@ public class ShoppingCartMCoffeeServiceImpl {
if(CollectionUtils.isNotEmpty(couponList)) {
List<CouponState> couponStates = couponDiscountCalculation.buildAvailableCoupons(cartGoodsList, partnerId, storeId, couponList);
if(CollectionUtils.isNotEmpty(couponStates)) {
Map<String, Integer> couponStateMap = couponStates.stream().collect(Collectors.toMap(CouponState::getCouponCode, CouponState::getState));
Map<String, Integer> couponStateMap = couponStates.stream().collect(Collectors.toMap(CouponState::getCouponCode, CouponState::getState,(k1,k2)-> k1));
if(null == couponStateMap.get(couponCode) || Objects.equals(couponStateMap.get(couponCode), CouponStateEnum.STATE_1.getCode())) {
couponCode = "";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment