| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | 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 com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | private ConvertLinkManager convertLinkManager; |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | @Resource |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private UserCloudService userCloudService; |
| | | private PIDManager pidManager; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | |
| | | } else if (cid == TYPE_SUCAI) { |
| | | type = 2; |
| | | } |
| | | List<GoodsEvaluate> listNew = new ArrayList<GoodsEvaluate>(); |
| | | List<GoodsEvaluate> listNew = new ArrayList<>(); |
| | | |
| | | List<GoodsEvaluate> list = goodsEvaluateService.queryMaterialsCache((page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, type, acceptData.getSystem()); |
| | |
| | | } |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | if (SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.threeSale)) { |
| | | inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | if (StringUtil.isNullOrEmpty(inviteCode)) { |
| | | out.print(JsonUtil.loadFalseResult(1, "邀请码未激活")); |
| | | return; |
| | |
| | | } |
| | | |
| | | if (list.size() == 0) { |
| | | out.print(JsonUtil.loadFalseResult("该信息已下架")); |
| | | out.print(JsonUtil.loadFalseResult("操作失败")); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system,user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | relationId, null); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | e.printStackTrace(); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html"; |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share), |
| | | user.getId() + ""); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), |
| | | PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + ""); |
| | | PDDGoodsDetail pddGoodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(goodsVO.getGoodsId())); |
| | | if (pddGoodsDetail == null) { |
| | | return null; |
| | | } |
| | | |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(pddGoodsDetail.getGoodsSign(), pidManager.getPidCache(system, Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.share), user.getId() + ""); |
| | | } |
| | | |
| | | FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode, |
| | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | String erCodeContent = ""; |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true); |
| | | // 获取口令 |
| | | List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText); |
| | | if (tokenList != null && tokenList.size() > 0) { |
| | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | newText = convertLinkManager.convertLinkFromText(acceptData.getSystem(), text, uid, true, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |