Commit d11d8de7 by huiyang.chen

商品价格均摊问题

parent 81ff357a
...@@ -37,7 +37,7 @@ public class PromotionAdapter { ...@@ -37,7 +37,7 @@ public class PromotionAdapter {
List<CalculationApportionGoodsDto> apportionGoodsByGoodsId = apportionGoodsList.stream().filter(a -> ObjectUtils.equals(orderProductBean.getProductId(), a.getGoodsId())).collect(Collectors.toList()); List<CalculationApportionGoodsDto> apportionGoodsByGoodsId = apportionGoodsList.stream().filter(a -> ObjectUtils.equals(orderProductBean.getProductId(), a.getGoodsId())).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(apportionGoodsByGoodsId)) { if(CollectionUtils.isNotEmpty(apportionGoodsByGoodsId)) {
Long discountPrice = 0L; Long discountPrice = 0L;
int goodsTotalQty = apportionGoodsList.stream().mapToInt(CalculationApportionGoodsDto::getGoodsQuantity).sum(); int goodsTotalQty = apportionGoodsByGoodsId.stream().mapToInt(CalculationApportionGoodsDto::getGoodsQuantity).sum();
for(CalculationApportionGoodsDto apportionGoods : apportionGoodsByGoodsId) { for(CalculationApportionGoodsDto apportionGoods : apportionGoodsByGoodsId) {
if (isApportion) { if (isApportion) {
discountPrice += apportionGoods.getApportionDetails().stream().filter(d -> ObjectUtils.notEqual(ActivityTypeEnum.TYPE_32.getCode(), d.getActivityType()) discountPrice += apportionGoods.getApportionDetails().stream().filter(d -> ObjectUtils.notEqual(ActivityTypeEnum.TYPE_32.getCode(), d.getActivityType())
......
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