Commit 8f7d4f66 by weijiguang

test

parent 385449b2
......@@ -190,6 +190,9 @@ public class CouponUserServiceImpl implements ICouponUserService {
BigDecimal orderTotalAmount = orderDetails.stream().map(x -> x.getAmountShould().multiply(new BigDecimal(x.getNum()))).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal orderTotalOrigDiscount = orderDetails.stream().map(x -> x.getOrigDiscount().multiply(new BigDecimal(x.getNum()))).reduce(BigDecimal.ZERO, BigDecimal::add);
log.info("orderTotalAmount:{}, orderTotalOrigDiscount:{}", orderTotalAmount, orderTotalOrigDiscount);
if (!CollectionUtils.isEmpty(couponVos)) {
orderDetails.forEach(orderDetail -> orderDetail.setAmountShould(orderDetail.getOrigDiscount()));
}
couponVos.stream().filter(couponVo -> StringUtils.isEmpty(couponVo.getNotFitableDesc())).forEach(couponVo -> {
/** 可用饮品范围的判断 */
List<Long> fitCouponGoodsIdList = goods.stream().filter(good ->
......@@ -231,9 +234,6 @@ public class CouponUserServiceImpl implements ICouponUserService {
orderDetails.forEach(orderDetail -> {
BigDecimal couponAmount = couponAmountMap.get(orderDetail.getSkuId());
orderDetail.setCouponAmount(couponAmount == null ? BigDecimal.ZERO : couponAmount.negate());
if (orderDetail.getCouponAmount().compareTo(BigDecimal.ZERO) > 0) {
orderDetail.setAmountShould(orderDetail.getOrigDiscount());
}
if (orderDetail.getAmountShould().add(orderDetail.getCouponAmount()).compareTo(BigDecimal.ZERO) < 0) {
orderDetail.setRealAmount(BigDecimal.ZERO);
} 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