| | |
| | | BigDecimal hundred = new BigDecimal(100); |
| | | rate = MoneyBigDecimalUtil.div(rate, hundred); |
| | | |
| | | BigDecimal afterUseCouponPrice = getCouponPrice(goods); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 获取券后价 |
| | | * |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | |
| | | public static BigDecimal getCouponPrice(SuningGoodsInfo goods) { |
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice(); |
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) { |
| | | commodityPrice = goods.getCommodityInfo().getSnPrice(); |
| | |
| | | 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); |
| | | return afterUseCouponPrice; |
| | | } |
| | | |
| | | /** |
| | | * 获取拼接的商品ID |
| | | * @Title: getConcatGoodsIId |
| | | * @Description: |
| | | * |
| | | * @param supplierCode |
| | | * @param goodsId |
| | | * @return |
| | | * String 返回类型 |
| | | * @return String 返回类型 |
| | | * @throws |
| | | * @Title: getConcatGoodsIId |
| | | * @Description: |
| | | */ |
| | | public static String getConcatGoodsIId(String supplierCode, String goodsId) { |
| | | |
| | |
| | | |
| | | /** |
| | | * 通过拼接的商品ID解析出来正确的商品ID |
| | | * |
| | | * @param concatGoodsId |
| | | * @return String[] 返回类型 |
| | | * @throws |
| | | * @Title: getGoodsIdDetail |
| | | * @Description: |
| | | * @param concatGoodsId |
| | | * @return |
| | | * String[] 返回类型 |
| | | * @throws |
| | | */ |
| | | public static String[] getGoodsIdDetail(String concatGoodsId) { |
| | | String[] sts = concatGoodsId.split("-"); |