Commit af237c33 by weijiguang

test

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