| | |
| | | import com.yeshi.fanli.entity.dynamic.SimpleGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.PidUser; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2; |
| | | import com.yeshi.fanli.exception.dynamic.ActivityUserException; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException; |
| | | import com.yeshi.fanli.exception.share.ShareGoodsException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService; |
| | |
| | | commentInfo.setContent(comment); |
| | | commentInfo.setType(""); |
| | | } else { |
| | | goodsBrief.setCouponLink(null); |
| | | String token = shareGoodsService.createTaoBaoToken(Constant.LINK_TOKEN_VERIFY_UID, goodsBrief); |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | |
| | | i++; |
| | | } |
| | | |
| | | |
| | | // 生成口令 |
| | | String token = null; |
| | | try { |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, goodsBrief.getAuctionId(), "1"); |
| | | token = taoBaoLink.getTaoToken(); |
| | | } catch (ShareGoodsException e) { |
| | | e.printStackTrace(); |
| | | throw new GoodsEvaluateException(1, "转链失败"); |
| | | } |
| | | |
| | | |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | "\r\n"); |
| | | } |
| | | // 评论内容 |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setNeedSpin(true); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | if (!StringUtil.isNullOrEmpty(comment)) { |
| | | commentInfo.setContent(comment); |
| | | commentInfo.setType(""); |
| | | } else { |
| | | String token = shareGoodsService.createTaoBaoToken(Constant.LINK_TOKEN_VERIFY_UID, goodsBrief); |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | "\r\n"); |
| | | } |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); |
| | | } |
| | | commentInfo.setContent(commentText); |
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); |
| | | |
| | | List<CommentInfo> commentsNew = new ArrayList<>(); |
| | | commentsNew.add(commentInfo); |