| | |
| | | } |
| | | |
| | | public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) { |
| | | // return template.replace("[淘口令]", token); |
| | | return template.replace("[淘口令]", token); |
| | | } |
| | | |
| | | |
| | | public static String getERCodeContentNew(String template, TaoBaoGoodsBrief goods, String token) { |
| | | String commentText = template.replace("[原价]", goods.getZkPrice().toString()); |
| | | commentText = commentText.replace("[口令]", token); |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) { |
| | |
| | | } |
| | | return commentText; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建淘宝分享信息 |
| | | * |
| | |
| | | descText = descText.substring(0); |
| | | } |
| | | shareInfo.setDescText(descText); |
| | | |
| | | |
| | | // 测试 |
| | | // 2.0.2之前 |
| | | if (!VersionUtil.greaterThan_2_0_2(platform, version)) |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | | shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } else if (!VersionUtil.greaterThan_2_0_2(platform, version)) { |
| | | shareInfo.setClickUrl(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | | shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | | shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | |
| | | } else { |
| | | shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | | |
| | | // 提示图文内容 |
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform, |
| | | Integer.parseInt(version)); |
| | |
| | | if (VersionUtil.greaterThan_2_0_7(platform, version)) { |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods(); |
| | | String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | | recommendText = template.replace("[商品标题]", goods.getTitle()).replace("[销量]", |
| | | TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day())); |
| | | recommendText = template.replace("[商品标题]", goods.getTitle()); |
| | | if (StringUtil.isNullOrEmpty(goods.getDescription())) { |
| | | recommendText = recommendText.replace("推荐语:[推荐语]", ""); |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[推荐语]", goods.getDescription()); |
| | | } |
| | | |
| | | String sales = TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()); |
| | | if (sales.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w")); |
| | | } |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | |
| | | if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", |
| | | TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + ""); |
| | |
| | | String recommendText = ""; |
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | | recommendText = template.replace("[商品标题]", jdGoods.getSkuName()).replace("[销量]", |
| | | JDUtil.getSaleCount(jdGoods.getInOrderCount30Days())); |
| | | recommendText = template.replace("[商品标题]", jdGoods.getSkuName()); |
| | | // 无推荐语 |
| | | recommendText = recommendText.replace("推荐语:[推荐语]", ""); |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days()); |
| | | if (sales.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w")); |
| | | } |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", jdGoods.getPrice().toString()); |
| | | commentText = commentText.replace("[链接]", jumpLink); |
| | | if (couponInfo == null) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", |
| | | BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString()); |
| | |
| | | if (StringUtil.isNullOrEmpty(salesTip)) { |
| | | salesTip = "0"; |
| | | } |
| | | recommendText = recommendText.replace("[销量]", salesTip); |
| | | recommendText = recommendText.replace("推荐语:[推荐语]", ""); |
| | | if (salesTip.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", salesTip.replace("万", "w")); |
| | | recommendText = recommendText.replace("销量", "总销量"); |
| | | } |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", MoneyBigDecimalUtil |
| | |
| | | if (!hasCoupon) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", |
| | | BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString()); |