Commit 3ceb10e6 by chongfu.liang

fix

parent 24e361a3
...@@ -30,10 +30,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -30,10 +30,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -186,8 +183,18 @@ public class CalculationSharingDiscountService { ...@@ -186,8 +183,18 @@ public class CalculationSharingDiscountService {
// 返回成功 // 返回成功
if (sharingDiscountResponseDto != null && StringUtils.equals(sharingDiscountResponseDto.getStatusCode(), ResponseCodeConstant.RESPONSE_SUCCESS_STR)) { if (sharingDiscountResponseDto != null && StringUtils.equals(sharingDiscountResponseDto.getStatusCode(), ResponseCodeConstant.RESPONSE_SUCCESS_STR)) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult result = sharingDiscountResponseDto.getResult(); CalculationSharingDiscountResponseDto.CalculationDiscountResult result = sharingDiscountResponseDto.getResult();
if (validCouponMap != null){
List<String> activityCodeList = result.getDiscounts().stream().map(p -> p.getActivityCode()).collect(Collectors.toList());
for (String spqId : validCouponMap.keySet()) {
if (!activityCodeList.contains(spqId)){ // 表示商品券不够启用金额
}
}
}
List<Integer> activityTypes = result.getDiscounts().stream().map(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount::getType).collect(Collectors.toList()); List<Integer> activityTypes = result.getDiscounts().stream().map(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount::getType).collect(Collectors.toList());
if (activityTypes.contains(221)) { if (activityTypes.contains(221)) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount discountDTO = result.getDiscounts().stream().filter(d -> 221 == d.getType()).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount discountDTO = result.getDiscounts().stream().filter(d -> 221 == d.getType()).findFirst().get();
......
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