Commit af237c33 by weijiguang

test

parent 887781b1
package com.soss.system.service.impl;
import com.alibaba.fastjson.JSON;
import com.soss.common.enums.CouponCategoryType;
import com.soss.common.enums.CouponState;
import com.soss.common.enums.CouponUserType;
......@@ -225,10 +224,12 @@ public class CouponUserServiceImpl implements ICouponUserService {
orderDetail.setRealAmount(orderDetail.getAmountShould().add(orderDetail.getCouponAmount()));
} else {
orderDetails.forEach(orderDetail -> {
BigDecimal rate = orderDetail.getAmountShould().divide(new BigDecimal(orderDetail.getNum())).divide(orderTotalOrigDiscount);
log.info("rate:{},detail:{}", rate, JSON.toJSON(orderDetail));
orderDetail.setCouponAmount(couponVo.getCouponAmount().multiply(rate));
orderDetail.setRealAmount(orderDetail.getAmountShould().divide(new BigDecimal(orderDetail.getNum())).add(orderDetail.getCouponAmount()));
// BigDecimal rate = orderDetail.getAmountShould().divide(new BigDecimal(orderDetail.getNum())).divide(orderTotalOrigDiscount);
// log.info("rate:{},detail:{}", rate, JSON.toJSON(orderDetail));
// orderDetail.setCouponAmount(couponVo.getCouponAmount().multiply(rate));
// orderDetail.setRealAmount(orderDetail.getAmountShould().divide(new BigDecimal(orderDetail.getNum())).add(orderDetail.getCouponAmount()));
orderDetail.setCouponAmount(BigDecimal.TEN);
orderDetail.setRealAmount(BigDecimal.TEN.max(BigDecimal.TEN));
});
}
} 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