| | |
| | | |
| | | @Resource |
| | | private QrCodeService qrCodeService; |
| | | |
| | | |
| | | @Resource |
| | | private ConvertLinkManager convertLinkManager; |
| | | |
| | |
| | | @RequestMapping(value = "getDynamicList", method = RequestMethod.POST) |
| | | public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, PrintWriter out) { |
| | | int type = 1; |
| | | if (cid == TYPE_FAQUAN){ |
| | | if (cid == TYPE_FAQUAN) { |
| | | type = 1; |
| | | } else if (cid == TYPE_SUCAI) { |
| | | type = 2; |
| | |
| | | continue; |
| | | } |
| | | |
| | | String jumpLink = getJumpLink(goodsVO, user,relationId, inviteCode); |
| | | String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user,relationId, inviteCode); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | } else if (type == 2 || type == 3) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user,relationId, inviteCode); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | Integer shareCount = goodsEvaluate.getShareNum(); |
| | | if (shareCount == null) { |
| | |
| | | data.put("list", list); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user,String relationId, String inviteCode) { |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode) { |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink=null; |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsVO.getGoodsId(), relationId); |
| | | } catch (ShareGoodsException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | jumpLink =configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()).replace("[淘口令]", taoBaoLink.getTaoToken()); |
| | | |
| | | jumpLink = configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()).replace("[淘口令]", |
| | | taoBaoLink.getTaoToken()); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId()); |
| | | if (jdGoods == null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | try { |
| | | text=convertLinkManager.convertLinkFromText(text, uid, true); |
| | | text = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | out.print(JsonUtil.loadFalseResult("转链失败")); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | |
| | |
| | | data.put("text", text); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |