Commit 6d07a8f8 by shuhu.hou@freemud.cn

套餐特价有份数限制,均摊翻倍不正确fixbug

parent 77fbc27e
......@@ -197,6 +197,10 @@ public class ActivityCalculationDiscountResponseDto {
* 活动类型
*/
private Integer type;
/**
* 当前活动实际优惠的商品数量
*/
private Integer actualGoodsNumber;
}
}
......
......@@ -138,7 +138,8 @@ public class SetMealServiceImpl implements IPromotionService {
return "";
}
if (numberMap.get(cartGoods.getGoodsId()) == null) {
numberMap.put(cartGoods.getGoodsId(), goodsMap.get(cartGoods.getGoodsId()).getActualGoodsNumber());
int actualGoodsNumber = goodsMap.get(cartGoods.getGoodsId()).getDiscounts().stream().mapToInt(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount::getActualGoodsNumber).min().getAsInt();
numberMap.put(cartGoods.getGoodsId(), actualGoodsNumber);
}
// 可优惠数量
Integer number = numberMap.get(cartGoods.getGoodsId());
......
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