Commit fcb4b766 by ping.wu

优惠计算修改

parent 4091f137
...@@ -381,15 +381,17 @@ public class CalculationServiceImpl { ...@@ -381,15 +381,17 @@ public class CalculationServiceImpl {
calculationDiscountGoods.setSmallMaterial(materials); calculationDiscountGoods.setSmallMaterial(materials);
} }
//累加需加入计算的商品 calculationDiscountGoodsList.add(calculationDiscountGoods);
int index;
// 当商品已存在时,需累加数量 // //累加需加入计算的商品
if ((index = calculationDiscountGoodsList.indexOf(calculationDiscountGoods)) >= 0 && !GoodsTypeEnum.COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { // int index;
ActivityCalculationDiscountRequestDto.CalculationDiscountGoods oldCalculationDiscountGoods = calculationDiscountGoodsList.get(index); // // 当商品已存在时,需累加数量
oldCalculationDiscountGoods.setGoodsQuantity(oldCalculationDiscountGoods.getGoodsQuantity() + calculationDiscountGoods.getGoodsQuantity()); // if ((index = calculationDiscountGoodsList.indexOf(calculationDiscountGoods)) >= 0 && !GoodsTypeEnum.COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
} else { // ActivityCalculationDiscountRequestDto.CalculationDiscountGoods oldCalculationDiscountGoods = calculationDiscountGoodsList.get(index);
calculationDiscountGoodsList.add(calculationDiscountGoods); // oldCalculationDiscountGoods.setGoodsQuantity(oldCalculationDiscountGoods.getGoodsQuantity() + calculationDiscountGoods.getGoodsQuantity());
} // } else {
//
// }
} }
......
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