Commit 60cb0f5a by chongfu.liang

积分抵扣,优惠信息为空判断

parent 259e0553
......@@ -74,18 +74,18 @@ public class CustomerScoreService implements IPromotionService {
if (getValue(userScoreUseDetail.getResult().getOverlayOffers()) == 0) {
customerScoreVo.setScoreReduceState(getValue(userScoreUseDetail.getResult().getScoreState()));
} else {
if (StringUtils.isNotBlank(shoppingCartInfoRequestVo.getCouponCode()) || (calculationDiscountResult != null && calculationDiscountResult.getTotalDiscountAmount().intValue() > 0)
|| (calculationDiscountResult != null && !CollectionUtils.isEmpty(calculationDiscountResult.getDiscounts()))) {
//是否有换购
int type81 = 0;
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount discount : calculationDiscountResult.getDiscounts()) {
if (ActivityTypeEnum.TYPE_81.getCode().equals(discount.getType())) {
type81 = 1;
break;
if (StringUtils.isNotBlank(shoppingCartInfoRequestVo.getCouponCode()) || (calculationDiscountResult != null && calculationDiscountResult.getTotalDiscountAmount().intValue() > 0)) {
if (calculationDiscountResult != null && !CollectionUtils.isEmpty(calculationDiscountResult.getDiscounts())){
//是否有换购
int type81 = 0;
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount discount : calculationDiscountResult.getDiscounts()) {
if (ActivityTypeEnum.TYPE_81.getCode().equals(discount.getType())) {
type81 = 1;
break;
}
}
}
//集点
long discountCount = calculationDiscountResult.getDiscounts().stream().filter(discount -> !ActivityTypeEnum.TYPE_221.getCode().equals(discount.getType())).count();
//集点
long discountCount = calculationDiscountResult.getDiscounts().stream().filter(discount -> !ActivityTypeEnum.TYPE_221.getCode().equals(discount.getType())).count();
/*
int discountCount = calculationDiscountResult.getDiscounts().size();
int type211 = 0;
......@@ -97,17 +97,19 @@ public class CustomerScoreService implements IPromotionService {
}
discountCount = discountCount - type211;
*/
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if ((type81 == 0 && discountCount >= 1)
|| (type81 == 1 && !CollectionUtils.isEmpty(shoppingCartInfoRequestVo.getSendGoods()))
|| (type81 == 1 && discountCount > 1)) {
customerScoreVo.setScoreReduceState(5);
userScoreUseDetail.getResult().setScoreState(5);
discountAmount = 0;
customerScoreVo.setReduceAmount(0);
//积分抵扣开关禁用 有换购活动 且选中了换购商品
// - 有换购且选中了换购商品
// - 有换购且没有选中换购商品 且除集点以外还有其他促销
if ((type81 == 0 && discountCount >= 1)
|| (type81 == 1 && !CollectionUtils.isEmpty(shoppingCartInfoRequestVo.getSendGoods()))
|| (type81 == 1 && discountCount > 1)) {
customerScoreVo.setScoreReduceState(5);
userScoreUseDetail.getResult().setScoreState(5);
discountAmount = 0;
customerScoreVo.setReduceAmount(0);
}
}
}
}
......
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