Commit 0e43c84b by weijiguang

fix orig_discount bug

parent 39f0f84f
...@@ -234,8 +234,8 @@ public class CouponUserServiceImpl implements ICouponUserService { ...@@ -234,8 +234,8 @@ public class CouponUserServiceImpl implements ICouponUserService {
} }
} else { } else {
List<OrderDetail> fitOrderDetails = orderDetails.stream().filter(orderDetail -> fitCouponGoodsIdList.contains(orderDetail.getGoodsId())).collect(Collectors.toList()); List<OrderDetail> fitOrderDetails = orderDetails.stream().filter(orderDetail -> fitCouponGoodsIdList.contains(orderDetail.getGoodsId())).collect(Collectors.toList());
BigDecimal fitGoodsAmount = fitOrderDetails.stream().map(x -> x.getAmountShould().multiply(new BigDecimal(x.getNum()))).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal fitGoodsAmount = fitOrderDetails.stream().map(OrderDetail::getAmountShould).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal fitGoodsOrigDiscount = fitOrderDetails.stream().map(x -> x.getOrigDiscount().multiply(new BigDecimal(x.getNum()))).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal fitGoodsOrigDiscount = fitOrderDetails.stream().map(OrderDetail::getOrigDiscount).reduce(BigDecimal.ZERO, BigDecimal::add);
log.info("fitGoodsOrigDiscount:{}, fitGoodsAmount:{}", fitGoodsOrigDiscount, fitGoodsAmount); log.info("fitGoodsOrigDiscount:{}, fitGoodsAmount:{}", fitGoodsOrigDiscount, fitGoodsAmount);
if (couponVo.getPriceLimit() != null && couponVo.getPriceLimit().compareTo(BigDecimal.ZERO) != 0 && couponVo.getPriceLimit().compareTo(fitGoodsAmount) > 0) { if (couponVo.getPriceLimit() != null && couponVo.getPriceLimit().compareTo(BigDecimal.ZERO) != 0 && couponVo.getPriceLimit().compareTo(fitGoodsAmount) > 0) {
if (couponVo.getType().equals(CouponCategoryType.DISCOUNT.getType())) { // 折扣 if (couponVo.getType().equals(CouponCategoryType.DISCOUNT.getType())) { // 折扣
......
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