Commit 33cc5da6 by weijiguang

.

parent 7aaec3c9
...@@ -229,7 +229,11 @@ public class CouponUserServiceImpl implements ICouponUserService { ...@@ -229,7 +229,11 @@ public class CouponUserServiceImpl implements ICouponUserService {
orderDetails.forEach(orderDetail -> { orderDetails.forEach(orderDetail -> {
BigDecimal couponAmount = couponAmountMap.get(orderDetail.getSkuId()); BigDecimal couponAmount = couponAmountMap.get(orderDetail.getSkuId());
orderDetail.setCouponAmount(couponAmount == null ? BigDecimal.ZERO : couponAmount.negate()); orderDetail.setCouponAmount(couponAmount == null ? BigDecimal.ZERO : couponAmount.negate());
orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount())); if (orderDetail.getAmountShould().add(orderDetail.getCouponAmount()).compareTo(BigDecimal.ZERO) < 0) {
orderDetail.setRealAmount(BigDecimal.ZERO);
} else {
orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount()));
}
}); });
} }
}); });
......
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