Commit 2179781a by weijiguang

test

parent 3b5a8081
...@@ -222,14 +222,14 @@ public class CouponUserServiceImpl implements ICouponUserService { ...@@ -222,14 +222,14 @@ public class CouponUserServiceImpl implements ICouponUserService {
log.info("nums:{}", nums); log.info("nums:{}", nums);
if (nums.get() <= 1) { if (nums.get() <= 1) {
OrderDetail orderDetail = orderDetails.get(0); OrderDetail orderDetail = orderDetails.get(0);
orderDetail.setCouponAmount(couponVo.getCouponAmount()); orderDetail.setCouponAmount(couponVo.getCouponAmount().negate());
orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount())); orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount()));
} else { } else {
orderDetails.forEach(orderDetail -> { orderDetails.forEach(orderDetail -> {
BigDecimal rate = orderDetail.getAmountShould().divide(orderTotalOrigDiscount); BigDecimal rate = orderDetail.getAmountShould().divide(orderTotalOrigDiscount);
log.info("rate:{},detail:{}", rate, JSON.toJSON(orderDetail)); orderDetail.setCouponAmount(couponVo.getCouponAmount().negate().multiply(rate));
orderDetail.setCouponAmount(couponVo.getCouponAmount().multiply(rate));
orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount()).divide(new BigDecimal(orderDetail.getNum()))); orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount()).divide(new BigDecimal(orderDetail.getNum())));
log.info("rate:{},detail:{}", rate, JSON.toJSON(orderDetail));
}); });
} }
} else { } 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