| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo; |
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | |
| | | } |
| | | } |
| | | |
| | | public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String 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); |
| | | commentText = commentText.replace("[淘口令]", token); |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | |
| | | 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()), |
| | | shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | |
| | | shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } else { |
| | | shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), |
| | | taoBaoLink.getGoods(), shareInfo.getToken())); |
| | | } |
| | | |
| | |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", goods.getZkPrice().toString()); |
| | | commentText = commentText.replace("[口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | commentText = commentText.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | |
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | String template2 = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | | recommendText = template2.replace("[商品标题]", jdGoods.getSkuName()); |
| | | // 无推荐语 |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days()); |
| | | if (sales.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w")); |
| | | } |
| | | |
| | | BigDecimal price = jdGoods.getPrice(); |
| | | JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo(); |
| | | if (pinGouInfo != null) { |
| | | price = pinGouInfo.getPingouPrice(); |
| | | } |
| | | |
| | | String template3 = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey()); |
| | | commentText = template3.replace("[原价]", BigDecimalUtil.getWithNoZera(price).toString()); |
| | | if (!hasCoupon) { |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | } else { |
| | | recommendText = recommendText.replace("[券面额]", BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString()); |
| | | commentText = commentText.replace("[券后价]", BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString()); |
| | | } |
| | | commentText = commentText.replace("[链接]", jumpLink); |
| | | } else { |
| | | commentText = shareInfo.getShareText(); |
| | | recommendText = shareInfo.getDescText(); |