Commit 2179781a by weijiguang

test

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