| | |
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | rate = MoneyBigDecimalUtil.div(rate, hundred);
|
| | |
|
| | | BigDecimal afterUseCouponPrice = new BigDecimal(goods.getCommodityInfo().getCommodityPrice());
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {
|
| | | // 有券
|
| | | BigDecimal startPrice = new BigDecimal(goods.getCouponInfo().getBounsLimit());
|
| | | if (afterUseCouponPrice.compareTo(startPrice) >= 0) {
|
| | | afterUseCouponPrice = afterUseCouponPrice.subtract(startPrice);
|
| | | }
|
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = goods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | |
|
| | | BigDecimal money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.div(
|
| | | afterUseCouponPrice.multiply(new BigDecimal(goods.getCommodityInfo().getRate())), new BigDecimal(100)),
|
| | | BigDecimal afterUseCouponPrice = new BigDecimal(commodityPrice);
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {
|
| | | // 有券
|
| | | BigDecimal startPrice = null;
|
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo().getBounsLimit())) {
|
| | | startPrice = new BigDecimal(goods.getCouponInfo().getCouponValue());
|
| | | } else
|
| | | startPrice = new BigDecimal(goods.getCouponInfo().getBounsLimit());
|
| | | if (afterUseCouponPrice.compareTo(startPrice) >= 0) {
|
| | | afterUseCouponPrice = afterUseCouponPrice.subtract(new BigDecimal(goods.getCouponInfo().getCouponValue()));
|
| | | }
|
| | | }
|
| | | |
| | | BigDecimal commission=MoneyBigDecimalUtil.mul(afterUseCouponPrice,MoneyBigDecimalUtil.div(new BigDecimal(goods.getCommodityInfo().getRate()), new BigDecimal(100),5));
|
| | |
|
| | | BigDecimal money = MoneyBigDecimalUtil.mul(commission,
|
| | | rate);
|
| | | return BigDecimalUtil.getWithNoZera(money).setScale(2);
|
| | | }
|