Commit 75c1ee68 by xiaoer.li@freemud.com

去掉赠品max判断

parent a9aee4e6
......@@ -81,11 +81,11 @@ public class BuySendPromotionService implements IPromotionService {
//Todo
List<String> activitySpuIds = new ArrayList<>();
Map<String, ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsMap = new HashMap<>();
Map<String, Integer> maxNums = new HashMap<>();
//Map<String, Integer> maxNums = new HashMap<>();
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity activityList : sendActivityLists) {
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods sendGood : activityList.getSendGoods()) {
sendGoodsMap.put(sendGood.getGoodsId(), sendGood);
maxNums.put(sendGood.getGoodsId(), activityList.getMaxNum());
//maxNums.put(sendGood.getGoodsId(), activityList.getMaxNum());
activitySpuIds.add(sendGood.getGoodsId());
}
}
......@@ -130,11 +130,11 @@ public class BuySendPromotionService implements IPromotionService {
}
*/
for (CartGoods cartGoods : newCartGoodsList) {
Integer max = maxNums.get(cartGoods.getGoodsId());
//if (max <= 0) continue;
if (max < cartGoods.getQty()) {
cartGoods.setQty(max);
}
//Integer max = maxNums.get(cartGoods.getGoodsId());
////if (max <= 0) continue;
//if (max < cartGoods.getQty()) {
// cartGoods.setQty(max);
//}
givePackAmount = givePackAmount + cartGoods.getPackPrice() * cartGoods.getQty();
giveTotalAmount = giveTotalAmount + cartGoods.getOriginalPrice() * cartGoods.getQty();
cartGoods.setOriginalAmount(cartGoods.getOriginalPrice() * cartGoods.getQty());
......
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