| | |
| | | import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | |
|
| | | /**
|
| | | * 分享商品模板
|
| | |
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
|
| | |
|
| | | private ConfigTaoLiJinService configTaoLiJinService;
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public void saveCommonTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | isCommonTemplateRight(template);
|
| | |
| | |
|
| | | @Override
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
|
| | | String shortLink, boolean hasCoupon, String from) {
|
| | | String shortLink, boolean hasCoupon, Long tljId) {
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
|
| | | BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
|
| | | if (tljId != null) {
|
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value");
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
|
| | | |
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
|
| | | .replace("{淘口令}", token).replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
|