| | |
| | |
|
| | | @Override
|
| | | public void isCommonTemplateRightPDD(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{标题}", "{商品原价}", "{月销量}", "{短链接}", "{多多口令}" };
|
| | | String[] keys = new String[] { "{标题}", "{商品原价}", "{月销量}", "{短链接}"};
|
| | | int keysCount = 0;
|
| | | for (String key : keys)
|
| | | if (template != null && template.contains(key))
|
| | |
| | | if (!hasCoupon) {
|
| | | template = template.replace("{标题}", goods.getGoodsName()).replace("{商品原价}", BigDecimalUtil.getWithNoZera(price).toString())
|
| | | .replace("{总销量}", goods.getSalesTip()).replace("{短链接}", shortLink);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("复制本条信息,{多多口令}打开拼多多", "点击链接,打开拼多多");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | }
|
| | | } else {
|
| | | BigDecimal amount = MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), hundred);
|
| | | template = template.replace("{标题}", goods.getGoodsName()).replace("{商品原价}", BigDecimalUtil.getWithNoZera(price).toString())
|
| | | .replace("{总销量}", goods.getSalesTip()).replace("{短链接}", shortLink)
|
| | | .replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(amount).toString())
|
| | | .replace("{优惠券价}", BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString());
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("{多多口令}打开拼多多,", "");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("{多多口令}", "");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | }
|
| | | }
|
| | |
|
| | | return template;
|