| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkException; |
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException; |
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | |
| | | @Resource |
| | | private TaoBaoLinkManager taoBaoLinkManager; |
| | | |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | @Override |
| | | public UserCloud getValidByUid(Long uid) { |
| | |
| | | for (CommentInfo commentInfo : comments) { |
| | | String comment = null; |
| | | try { |
| | | comment = convertLinkManager.convertLinkFromText(commentInfo.getContent(), uid, true,false); |
| | | comment = convertLinkManager.convertLinkFromText(user.getSystem(), commentInfo.getContent(), uid, true, false); |
| | | hasToken = true; |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | } catch (ConvertLinkException e) { |
| | | if (e.getCode() != ConvertLinkException.CODE_NONE) { |
| | | throw new UserCloudException(1, e.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), goodsId, relationId, null); |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getSystem(), user.getId(), goodsId, relationId, null); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | throw new UserCloudException(1, "该商品已下架"); |
| | |
| | | String couponAmount = ""; |
| | | if (coupon) { |
| | | description = goods.getDescription(); |
| | | quanPrice = TaoBaoUtil.getAfterUseCouplePrice(goods) + ""; |
| | | quanPrice = TaoBaoUtil.getCouponPrice(goods) + ""; |
| | | couponAmount = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString(); |
| | | } |
| | | String sales = TaoBaoUtil.getSaleCount(goods.getBiz30day()); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(user.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | user.getId() + ""); |
| | | |
| | | boolean coupon = false; |
| | |
| | | String quanPrice = ""; |
| | | String couponAmount = ""; |
| | | if (coupon) { |
| | | quanPrice = BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString() + ""; |
| | | quanPrice = BigDecimalUtil.getWithNoZera(JDUtil.getCouponPrice(jdGoods)).toString() + ""; |
| | | couponAmount = BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString(); |
| | | } |
| | | |
| | |
| | | if (goods == null) |
| | | throw new UserCloudException(1, "该商品已下架"); |
| | | |
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + ""); |
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goods.getGoodsSign(), pidManager.getPidCache(user.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.share), user.getId() + ""); |
| | | |
| | | boolean coupon = true; |
| | | if (goods.getHasCoupon() == null || !goods.getHasCoupon()) { |
| | |
| | | BigDecimal hundred = new BigDecimal(100); |
| | | BigDecimal amount = MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), hundred); |
| | | quanPrice = BigDecimalUtil.getWithNoZera(amount).toString(); |
| | | couponAmount = BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString(); |
| | | couponAmount = BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getCouponPrice(goods)).toString(); |
| | | } |
| | | |
| | | String sales = goods.getSalesTip(); |
| | |
| | | |
| | | String couponLink = goods.getCouponInfo().getCouponUrl(); |
| | | String jumpLink = SuningApiUtil.convertLink(SuningUtil.getProductUrl(sellerId + "", goodsId + ""), |
| | | StringUtil.isNullOrEmpty(couponLink) ? null : couponLink, SuningApiUtil.PID_SHARE, user.getId() + ""); |
| | | StringUtil.isNullOrEmpty(couponLink) ? null : couponLink, pidManager.getPidCache(user.getSystem(), Constant.SOURCE_TYPE_SUNING, SystemPIDInfo.PidType.share), user.getId() + ""); |
| | | |
| | | boolean coupon = false; |
| | | String couponAmount = ""; |