Commit 24806fc5 by 徐康

map去重

parent 9224d133
......@@ -345,7 +345,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