admin
2019-05-23 6b8479885090a7ee0be754a793278e0acb967f3b
分享模板不保留小数位数
1个文件已修改
9 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
@@ -6,6 +6,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.BigDecimalUtil;
import org.yeshi.utils.HttpUtil;
import com.yeshi.fanli.dao.mybatis.goods.ShareGoodsTextTemplateMapper;
@@ -119,15 +120,15 @@
            String shortLink, boolean hasCoupon) {
        if (!hasCoupon) {
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}",  BigDecimalUtil.getWithNoZera(goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{短链}", shortLink)
                    .replace("{淘口令}", "").replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价"
                            : "淘宝价");
        } else {
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
                    .replace("{淘口令}", token).replace("{优惠券面额}", goods.getCouponAmount().toString())
                    .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(goods).toString())
                    .replace("{淘口令}", token).replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
                    .replace("{优惠券价}", BigDecimalUtil.getWithNoZera( TaoBaoUtil.getAfterUseCouplePrice(goods)).toString())
                    .replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价" : "淘宝价");
        }
    }